summaryrefslogtreecommitdiff
path: root/src/cairo-pdf-surface-private.h
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2016-06-04 14:43:43 +0930
committerAdrian Johnson <ajohnson@redneon.com>2016-06-05 20:43:36 +0930
commit1e07ced66d26475e6631df9ffa2a15709104bd8f (patch)
tree03b3a0a2940eb44e902e028e7f49e77ef8de57f9 /src/cairo-pdf-surface-private.h
parentd2dc2e90a71ae4822845ac4bab3871475335a69e (diff)
downloadcairo-1e07ced66d26475e6631df9ffa2a15709104bd8f.tar.gz
pdf: change from pdf coordinates to cairo coordinates
When an unbounded recording surface is used multiple times with different extents for each operation we need the XObject containing the recording surface to have the same origin for each operation. This is not possible when the recording surface is converted to PDF coordinates because each operation has different extents resulting in a different origin when the Y-axis is flipped (since the flip matrix depends on the recording surface height which for unbounded surfaces depends on the extents of the operation that paints the recording surface). Switching to cairo coordinates by emitting a Y-axis flip matrix as the first object of each page allows the recording surface to be emitted in cairo coordinates. This results in the same origin for all operations using the recording surface XObject.
Diffstat (limited to 'src/cairo-pdf-surface-private.h')
-rw-r--r--src/cairo-pdf-surface-private.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cairo-pdf-surface-private.h b/src/cairo-pdf-surface-private.h
index 618ca4ede..66ebf609d 100644
--- a/src/cairo-pdf-surface-private.h
+++ b/src/cairo-pdf-surface-private.h
@@ -97,6 +97,17 @@ typedef struct _cairo_pdf_pattern {
cairo_pdf_resource_t gstate_res;
cairo_operator_t operator;
cairo_bool_t is_shading;
+
+ /* PDF pattern space is the pattern matrix concatenated with the
+ * initial space of the parent object. If the parent object is the
+ * page, the intial space does not include the Y-axis flipping
+ * matrix emitted at the start of the page content stream. If the
+ * parent object is not the page content stream, the initial space
+ * will have a flipped Y-axis. The inverted_y_axis flag is true
+ * when the initial space of the parent object that is drawing
+ * this pattern has a flipped Y-axis.
+ */
+ cairo_bool_t inverted_y_axis;
} cairo_pdf_pattern_t;
typedef enum _cairo_pdf_operation {
@@ -150,6 +161,7 @@ struct _cairo_pdf_surface {
double width;
double height;
cairo_matrix_t cairo_to_pdf;
+ cairo_bool_t in_xobject;
cairo_array_t objects;
cairo_array_t pages;