summaryrefslogtreecommitdiff
path: root/src/cairo-pdf-surface-private.h
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2007-08-25 06:44:08 +0930
committerCarl Worth <cworth@cworth.org>2007-08-27 14:21:36 -0700
commit1cdd11873b18ec55521ffd744ad12c619cf9b227 (patch)
treedbccc06669660d612d087a44913b40e003272f31 /src/cairo-pdf-surface-private.h
parent1e8446609b01a3a60c3cc5b69d95d26cc9df460b (diff)
Add finer-grained fallback support to the PDF surface
The stream handling has been changed to support writing the content to one or more group objects. Each page has a top level knockout group. The first operation in the knockout group paints another group containing the content. Fallback images are painted from the knockout group. This ensures that fallback images do not composite with any content under the image.
Diffstat (limited to 'src/cairo-pdf-surface-private.h')
-rw-r--r--src/cairo-pdf-surface-private.h55
1 files changed, 40 insertions, 15 deletions
diff --git a/src/cairo-pdf-surface-private.h b/src/cairo-pdf-surface-private.h
index 1af2ad06..79e24d4d 100644
--- a/src/cairo-pdf-surface-private.h
+++ b/src/cairo-pdf-surface-private.h
@@ -2,6 +2,7 @@
*
* Copyright © 2004 Red Hat, Inc
* Copyright © 2006 Red Hat, Inc
+ * Copyright © 2007 Adrian Johnson
*
* This library is free software; you can redistribute it and/or
* modify it either under the terms of the GNU Lesser General Public
@@ -34,6 +35,7 @@
* Contributor(s):
* Kristian Høgsberg <krh@redhat.com>
* Carl Worth <cworth@cworth.org>
+ * Adrian Johnson <ajohnson@redneon.com>
*/
#ifndef CAIRO_PDF_SURFACE_PRIVATE_H
@@ -47,6 +49,14 @@ typedef struct _cairo_pdf_resource {
unsigned int id;
} cairo_pdf_resource_t;
+typedef struct _cairo_pdf_group_resources {
+ cairo_array_t alphas;
+ cairo_array_t smasks;
+ cairo_array_t patterns;
+ cairo_array_t xobjects;
+ cairo_array_t fonts;
+} cairo_pdf_group_resources_t;
+
typedef struct _cairo_pdf_surface cairo_pdf_surface_t;
struct _cairo_pdf_surface {
@@ -62,13 +72,11 @@ struct _cairo_pdf_surface {
cairo_array_t objects;
cairo_array_t pages;
- cairo_array_t patterns;
- cairo_array_t xobjects;
cairo_array_t streams;
- cairo_array_t alphas;
- cairo_array_t smasks;
cairo_array_t rgb_linear_functions;
cairo_array_t alpha_linear_functions;
+ cairo_array_t knockout_group;
+ cairo_array_t content_group;
cairo_scaled_font_subsets_t *font_subsets;
cairo_array_t fonts;
@@ -81,21 +89,38 @@ struct _cairo_pdf_surface {
cairo_pdf_resource_t self;
cairo_pdf_resource_t length;
long start_offset;
- cairo_bool_t compressed;
- cairo_output_stream_t *old_output;
- } current_stream;
+ cairo_bool_t compressed;
+ cairo_output_stream_t *old_output;
+ } pdf_stream;
+
+ struct {
+ cairo_bool_t active;
+ cairo_output_stream_t *stream;
+ cairo_output_stream_t *old_output;
+ cairo_pdf_group_resources_t resources;
+ cairo_bool_t is_knockout;
+ cairo_pdf_resource_t first_object;
+ } group_stream;
+
+ struct {
+ cairo_bool_t active;
+ cairo_output_stream_t *stream;
+ cairo_output_stream_t *old_output;
+ cairo_pdf_group_resources_t resources;
+ } content_stream;
struct {
- cairo_pattern_type_t type;
- double red;
- double green;
- double blue;
- int alpha;
- cairo_pdf_resource_t smask;
- cairo_pdf_resource_t pattern;
+ cairo_pattern_type_t type;
+ double red;
+ double green;
+ double blue;
+ double alpha;
+ cairo_pdf_resource_t smask;
+ cairo_pdf_resource_t pattern;
} emitted_pattern;
- cairo_bool_t has_clip;
+ cairo_array_t *current_group;
+ cairo_pdf_group_resources_t *current_resources;
cairo_paginated_mode_t paginated_mode;