summaryrefslogtreecommitdiff
path: root/src/cairo-misc.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-01-19 17:11:55 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2010-01-22 23:01:51 +0000
commitae25f1c360b79f0b7b1bb73e9ebc47eb794d8007 (patch)
tree1e8275333922a32bf5f22bdf42a3a44751085adb /src/cairo-misc.c
parent9cd9137843f8f1c3d32bedb6510259ab3638a2c5 (diff)
downloadcairo-ae25f1c360b79f0b7b1bb73e9ebc47eb794d8007.tar.gz
Alter definition of cairo_composite_rectangles_t
This is a more useful definition that is able to individually track the rectangles that compose the composite operation. This will be used by the specialist compositors as a means to perform the common extents determination for an operation.
Diffstat (limited to 'src/cairo-misc.c')
-rw-r--r--src/cairo-misc.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/cairo-misc.c b/src/cairo-misc.c
index 5f9cba5f1..cd1032a49 100644
--- a/src/cairo-misc.c
+++ b/src/cairo-misc.c
@@ -421,6 +421,47 @@ _cairo_operator_bounded_by_source (cairo_operator_t op)
return FALSE;
}
+uint32_t
+_cairo_operator_bounded_by_either (cairo_operator_t op)
+{
+ switch (op) {
+ default:
+ ASSERT_NOT_REACHED;
+ case CAIRO_OPERATOR_OVER:
+ case CAIRO_OPERATOR_ATOP:
+ case CAIRO_OPERATOR_DEST:
+ case CAIRO_OPERATOR_DEST_OVER:
+ case CAIRO_OPERATOR_DEST_OUT:
+ case CAIRO_OPERATOR_XOR:
+ case CAIRO_OPERATOR_ADD:
+ case CAIRO_OPERATOR_SATURATE:
+ case CAIRO_OPERATOR_MULTIPLY:
+ case CAIRO_OPERATOR_SCREEN:
+ case CAIRO_OPERATOR_OVERLAY:
+ case CAIRO_OPERATOR_DARKEN:
+ case CAIRO_OPERATOR_LIGHTEN:
+ case CAIRO_OPERATOR_COLOR_DODGE:
+ case CAIRO_OPERATOR_COLOR_BURN:
+ case CAIRO_OPERATOR_HARD_LIGHT:
+ case CAIRO_OPERATOR_SOFT_LIGHT:
+ case CAIRO_OPERATOR_DIFFERENCE:
+ case CAIRO_OPERATOR_EXCLUSION:
+ case CAIRO_OPERATOR_HSL_HUE:
+ case CAIRO_OPERATOR_HSL_SATURATION:
+ case CAIRO_OPERATOR_HSL_COLOR:
+ case CAIRO_OPERATOR_HSL_LUMINOSITY:
+ return CAIRO_OPERATOR_BOUND_BY_MASK | CAIRO_OPERATOR_BOUND_BY_SOURCE;
+ case CAIRO_OPERATOR_CLEAR:
+ case CAIRO_OPERATOR_SOURCE:
+ return CAIRO_OPERATOR_BOUND_BY_MASK;
+ case CAIRO_OPERATOR_OUT:
+ case CAIRO_OPERATOR_IN:
+ case CAIRO_OPERATOR_DEST_IN:
+ case CAIRO_OPERATOR_DEST_ATOP:
+ return 0;
+ }
+
+}
/* This function is identical to the C99 function lround(), except that it
* performs arithmetic rounding (floor(d + .5) instead of away-from-zero rounding) and