summaryrefslogtreecommitdiff
path: root/src/cairo-types-private.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-10-16 16:48:54 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-10-21 11:37:16 +0100
commitdf357f26ff72571acb840715efa4930054d4fdbe (patch)
tree66e9174c24c52564a5d691a21653c8b31a3b7156 /src/cairo-types-private.h
parentf0cd20e6cec445eb627c2708c2230c8bad1b64ce (diff)
downloadcairo-df357f26ff72571acb840715efa4930054d4fdbe.tar.gz
Support component-alpha.
Within our code base we carried a few hacks to utilize the component alpha capabilities of pixman, whilst not supporting the concept for our own masks. Thus we were setting it upon the pixman_image_t that we passed around through code that was blissfully unaware and indeed the component-alpha property was forgotten (e.g. upgrading glyph masks). The real issue is that without explicit support that a pattern carries subpixel masking information, that information is lost when using that pattern with composite. Again we can look at the example of compositing a sub-pixel glyph mask onto a remote xlib surface for further failure.
Diffstat (limited to 'src/cairo-types-private.h')
-rw-r--r--src/cairo-types-private.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/cairo-types-private.h b/src/cairo-types-private.h
index 82754cff2..16b27c254 100644
--- a/src/cairo-types-private.h
+++ b/src/cairo-types-private.h
@@ -340,4 +340,75 @@ struct _cairo_mime_data {
void *closure;
};
+struct _cairo_pattern {
+ cairo_pattern_type_t type;
+ cairo_reference_count_t ref_count;
+ cairo_status_t status;
+ cairo_user_data_array_t user_data;
+
+ cairo_matrix_t matrix;
+ cairo_filter_t filter;
+ cairo_extend_t extend;
+
+ cairo_bool_t has_component_alpha;
+};
+
+struct _cairo_solid_pattern {
+ cairo_pattern_t base;
+ cairo_color_t color;
+ cairo_content_t content;
+};
+
+typedef struct _cairo_surface_pattern {
+ cairo_pattern_t base;
+
+ cairo_surface_t *surface;
+} cairo_surface_pattern_t;
+
+typedef struct _cairo_gradient_stop {
+ double offset;
+ cairo_color_t color;
+} cairo_gradient_stop_t;
+
+typedef struct _cairo_gradient_pattern {
+ cairo_pattern_t base;
+
+ unsigned int n_stops;
+ unsigned int stops_size;
+ cairo_gradient_stop_t *stops;
+ cairo_gradient_stop_t stops_embedded[2];
+} cairo_gradient_pattern_t;
+
+typedef struct _cairo_linear_pattern {
+ cairo_gradient_pattern_t base;
+
+ cairo_point_t p1;
+ cairo_point_t p2;
+} cairo_linear_pattern_t;
+
+typedef struct _cairo_radial_pattern {
+ cairo_gradient_pattern_t base;
+
+ cairo_point_t c1;
+ cairo_fixed_t r1;
+ cairo_point_t c2;
+ cairo_fixed_t r2;
+} cairo_radial_pattern_t;
+
+typedef union {
+ cairo_gradient_pattern_t base;
+
+ cairo_linear_pattern_t linear;
+ cairo_radial_pattern_t radial;
+} cairo_gradient_pattern_union_t;
+
+typedef union {
+ cairo_pattern_type_t type;
+ cairo_pattern_t base;
+
+ cairo_solid_pattern_t solid;
+ cairo_surface_pattern_t surface;
+ cairo_gradient_pattern_union_t gradient;
+} cairo_pattern_union_t;
+
#endif /* CAIRO_TYPES_PRIVATE_H */