summaryrefslogtreecommitdiff
path: root/src/cairo-pdf-surface-private.h
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2009-06-13 22:47:41 +0930
committerAdrian Johnson <ajohnson@redneon.com>2009-06-14 00:43:41 +0930
commit1798bdd322e0d25147195198bf0c5e9506c61a15 (patch)
treef3389e682bed79b648e544d88e3775b416cf2d4a /src/cairo-pdf-surface-private.h
parentf115c5479ead934774fea99d74d780e2bb1681c4 (diff)
downloadcairo-1798bdd322e0d25147195198bf0c5e9506c61a15.tar.gz
Fix PDF pattern embedding
The PDF snapshot cow patch was reusing a previously emitted surface pattern if the surface unique id matched the current surface. This resulted in incorrect output as the new pattern may have a different pattern matrix. This patch fixes the PDF backend to always emit a new pattern but re-use previously emitted image or metasurface XObjects.
Diffstat (limited to 'src/cairo-pdf-surface-private.h')
-rw-r--r--src/cairo-pdf-surface-private.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/cairo-pdf-surface-private.h b/src/cairo-pdf-surface-private.h
index e64b78acc..5aedcd051 100644
--- a/src/cairo-pdf-surface-private.h
+++ b/src/cairo-pdf-surface-private.h
@@ -60,19 +60,27 @@ typedef struct _cairo_pdf_group_resources {
cairo_array_t fonts;
} cairo_pdf_group_resources_t;
-typedef struct _cairo_pdf_pattern_entry {
+typedef struct _cairo_pdf_source_surface_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;
+ cairo_bool_t interpolate;
+ cairo_pdf_resource_t surface_res;
+ int width;
+ int height;
+} cairo_pdf_source_surface_entry_t;
+
+typedef struct _cairo_pdf_source_surface {
+ cairo_surface_t *surface;
+ cairo_pdf_source_surface_entry_t *hash_entry;
+} cairo_pdf_source_surface_t;
typedef struct _cairo_pdf_pattern {
double width;
double height;
cairo_rectangle_int_t extents;
cairo_pattern_t *pattern;
- cairo_pdf_pattern_entry_t *hash_entry;
+ cairo_pdf_resource_t pattern_res;
+ cairo_pdf_resource_t gstate_res;
} cairo_pdf_pattern_t;
typedef enum _cairo_pdf_operation {
@@ -125,7 +133,8 @@ struct _cairo_pdf_surface {
cairo_array_t rgb_linear_functions;
cairo_array_t alpha_linear_functions;
cairo_array_t page_patterns;
- cairo_hash_table_t *all_patterns;
+ cairo_array_t page_surfaces;
+ cairo_hash_table_t *all_surfaces;
cairo_array_t smask_groups;
cairo_array_t knockout_group;