diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2007-08-21 22:27:57 +0930 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2007-08-21 22:27:57 +0930 |
commit | bf92255edd20595a6eb220c6ee9d6aa40b244eef (patch) | |
tree | c6b6fa74ae75db976e044e84a433ee30d6f20f17 /src/cairo-meta-surface-private.h | |
parent | bf4bdbb6076dbe3b74534bc4308dbc9213bf628d (diff) |
PS: Add finer-grained image fallback support
The analysis surface now keeps track of two regions: supported
operations, and unsupported operations. If the target surface returns
CAIRO_INT_STATUS_FLATTEN_TRANSPARENCY, the analysis surface will check
if any previous operation intersects with this operation. If there is
nothing previously drawn under the operation, the status is changed to
supported.
The meta surface has two new functions:
_cairo_meta_surface_replay_region()
_cairo_meta_surface_replay_and_create_regions()
During the analysis stage, the paginated surface replays the meta
surface using _cairo_meta_surface_replay_and_create_regions(). The
return status from each analyzed operation is saved in the meta
surface. The _cairo_meta_surface_replay_region() function allows only
operations from either the supported or unsupported region to be
replayed. This allows the paginated surface to replay only the
supported operations before emitting a fallback image for each
rectangle in the unsupported region.
Diffstat (limited to 'src/cairo-meta-surface-private.h')
-rw-r--r-- | src/cairo-meta-surface-private.h | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/src/cairo-meta-surface-private.h b/src/cairo-meta-surface-private.h index 3f2d390c..b6d57302 100644 --- a/src/cairo-meta-surface-private.h +++ b/src/cairo-meta-surface-private.h @@ -31,6 +31,7 @@ * * Contributor(s): * Kristian Høgsberg <krh@redhat.com> + * Adrian Johnson <ajohnson@redneon.com> */ #ifndef CAIRO_META_SURFACE_H @@ -57,21 +58,32 @@ typedef enum { } cairo_command_type_t; -typedef struct _cairo_command_paint { +typedef enum { + CAIRO_META_REGION_ALL, + CAIRO_META_REGION_NATIVE, + CAIRO_META_REGION_IMAGE_FALLBACK, +} cairo_meta_region_type_t; + +typedef struct _cairo_command_header { cairo_command_type_t type; + cairo_meta_region_type_t region; +} cairo_command_header_t; + +typedef struct _cairo_command_paint { + cairo_command_header_t header; cairo_operator_t op; cairo_pattern_union_t source; } cairo_command_paint_t; typedef struct _cairo_command_mask { - cairo_command_type_t type; + cairo_command_header_t header; cairo_operator_t op; cairo_pattern_union_t source; cairo_pattern_union_t mask; } cairo_command_mask_t; typedef struct _cairo_command_stroke { - cairo_command_type_t type; + cairo_command_header_t header; cairo_operator_t op; cairo_pattern_union_t source; cairo_path_fixed_t path; @@ -83,7 +95,7 @@ typedef struct _cairo_command_stroke { } cairo_command_stroke_t; typedef struct _cairo_command_fill { - cairo_command_type_t type; + cairo_command_header_t header; cairo_operator_t op; cairo_pattern_union_t source; cairo_path_fixed_t path; @@ -93,7 +105,7 @@ typedef struct _cairo_command_fill { } cairo_command_fill_t; typedef struct _cairo_command_show_glyphs { - cairo_command_type_t type; + cairo_command_header_t header; cairo_operator_t op; cairo_pattern_union_t source; cairo_glyph_t *glyphs; @@ -102,7 +114,7 @@ typedef struct _cairo_command_show_glyphs { } cairo_command_show_glyphs_t; typedef struct _cairo_command_intersect_clip_path { - cairo_command_type_t type; + cairo_command_header_t header; cairo_path_fixed_t *path_pointer; cairo_path_fixed_t path; cairo_fill_rule_t fill_rule; @@ -111,7 +123,7 @@ typedef struct _cairo_command_intersect_clip_path { } cairo_command_intersect_clip_path_t; typedef union _cairo_command { - cairo_command_type_t type; + cairo_command_header_t header; /* The 5 basic drawing operations. */ cairo_command_paint_t paint; @@ -151,6 +163,14 @@ cairo_private cairo_status_t _cairo_meta_surface_replay (cairo_surface_t *surface, cairo_surface_t *target); +cairo_private cairo_status_t +_cairo_meta_surface_replay_and_create_regions (cairo_surface_t *surface, + cairo_surface_t *target); +cairo_private cairo_status_t +_cairo_meta_surface_replay_region (cairo_surface_t *surface, + cairo_surface_t *target, + cairo_meta_region_type_t region); + cairo_private cairo_bool_t _cairo_surface_is_meta (const cairo_surface_t *surface); |