summaryrefslogtreecommitdiff
path: root/src/cairo-path-fixed-private.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-06-11 09:06:20 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-06-11 09:06:20 +0100
commiteeafeebd2ec8ad8a9e7053aaaa0f845b58563b3b (patch)
tree849cce7e99962f9114c259c94238360086093869 /src/cairo-path-fixed-private.h
parentb0056a86b4f6c92fa7eb89baf8483a46979c8cf1 (diff)
downloadcairo-eeafeebd2ec8ad8a9e7053aaaa0f845b58563b3b.tar.gz
path: Exponentially grow buffer based on populated points and ops.
Instead of simply doubling the buffer size every time we overflow a point or an op, enlarge the buffer to fit twice the number of used points and ops. We expect paths to be fairly consistent in the mix of operations, and this allows the buffer size to tune itself to actual usage and reduce wastage.
Diffstat (limited to 'src/cairo-path-fixed-private.h')
-rw-r--r--src/cairo-path-fixed-private.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cairo-path-fixed-private.h b/src/cairo-path-fixed-private.h
index 4345fd53d..42e64eda3 100644
--- a/src/cairo-path-fixed-private.h
+++ b/src/cairo-path-fixed-private.h
@@ -61,9 +61,10 @@ typedef char cairo_path_op_t;
typedef struct _cairo_path_buf {
cairo_list_t link;
- unsigned int buf_size;
unsigned int num_ops;
+ unsigned int size_ops;
unsigned int num_points;
+ unsigned int size_points;
cairo_path_op_t *op;
cairo_point_t *points;