summaryrefslogtreecommitdiff
path: root/src/cairo-pdf-surface-private.h
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2008-09-07 13:09:09 +0930
committerChris Wilson <chris@chris-wilson.co.uk>2009-06-02 15:13:48 +0100
commitc9ddaf8e7f0006f308aab0b87cf0425b2690d914 (patch)
treef85fa8933e5e0843453458ee672d2036ee5af73f /src/cairo-pdf-surface-private.h
parentf7613eeecea1218d353a183078fb77bc5cf4e72e (diff)
PDF: Don't embed the same pattern more than once
The PDF surface now keeps track of all the patterns it is embedding in a hash table keyed by the unique_id returned by the _cairo_surface_get_unique_id().
Diffstat (limited to 'src/cairo-pdf-surface-private.h')
-rw-r--r--src/cairo-pdf-surface-private.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/cairo-pdf-surface-private.h b/src/cairo-pdf-surface-private.h
index d2fa43c4..e64b78ac 100644
--- a/src/cairo-pdf-surface-private.h
+++ b/src/cairo-pdf-surface-private.h
@@ -60,13 +60,19 @@ typedef struct _cairo_pdf_group_resources {
cairo_array_t fonts;
} cairo_pdf_group_resources_t;
+typedef struct _cairo_pdf_pattern_entry {
+ cairo_hash_entry_t base;
+ unsigned int id;
+ cairo_pdf_resource_t pattern_res;
+ cairo_pdf_resource_t gstate_res;
+} cairo_pdf_pattern_entry_t;
+
typedef struct _cairo_pdf_pattern {
double width;
double height;
cairo_rectangle_int_t extents;
cairo_pattern_t *pattern;
- cairo_pdf_resource_t pattern_res;
- cairo_pdf_resource_t gstate_res;
+ cairo_pdf_pattern_entry_t *hash_entry;
} cairo_pdf_pattern_t;
typedef enum _cairo_pdf_operation {
@@ -118,7 +124,8 @@ struct _cairo_pdf_surface {
cairo_array_t pages;
cairo_array_t rgb_linear_functions;
cairo_array_t alpha_linear_functions;
- cairo_array_t patterns;
+ cairo_array_t page_patterns;
+ cairo_hash_table_t *all_patterns;
cairo_array_t smask_groups;
cairo_array_t knockout_group;