diff options
author | M Joonas Pihlaja <jpihlaja@cc.helsinki.fi> | 2008-07-31 01:54:53 +0300 |
---|---|---|
committer | M Joonas Pihlaja <jpihlaja@cc.helsinki.fi> | 2008-12-06 14:04:35 +0200 |
commit | 4b227143b3daab75148cd54c9e7580d509864e0d (patch) | |
tree | 884d1e07e50c1b68df1c186c1c2d5c1cd2ac438b /src/cairo-rectangle.c | |
parent | a370d077bc697588b6dac2556afa0b95ff83a77d (diff) | |
download | cairo-4b227143b3daab75148cd54c9e7580d509864e0d.tar.gz |
[cairo-spans] Introduce a type to track which pixels combine in a compositing op.
A cairo_composite_rectangles_t contains the coordinates of rectangular
windows into each of the source pattern, mask, clip and destination
surface containing the pixels that will combine in a compositing
operation. The idea is to have a uniform way to represent all the
translations involved rather than overloading parameters like src_x/y,
dst_x/y, etc., sometimes with different incompatible meanings across
functions.
Diffstat (limited to 'src/cairo-rectangle.c')
-rw-r--r-- | src/cairo-rectangle.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/cairo-rectangle.c b/src/cairo-rectangle.c index 2143f0c64..9a68409c2 100644 --- a/src/cairo-rectangle.c +++ b/src/cairo-rectangle.c @@ -223,3 +223,24 @@ _cairo_box_contains_point (cairo_box_t *box, cairo_point_t *point) return FALSE; return TRUE; } + +void +_cairo_composite_rectangles_init( + cairo_composite_rectangles_t *rects, + int all_x, + int all_y, + int width, + int height) +{ + rects->src.x = all_x; + rects->src.y = all_y; + rects->mask.x = all_x; + rects->mask.y = all_y; + rects->clip.x = all_x; + rects->clip.y = all_y; + rects->dst.x = all_x; + rects->dst.y = all_y; + + rects->width = width; + rects->height = height; +} |