summaryrefslogtreecommitdiff
path: root/src/cairo-win32-surface.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2005-05-11 16:32:44 +0000
committerOwen Taylor <otaylor@redhat.com>2005-05-11 16:32:44 +0000
commite4e5b1f00ded346f40c788fa9b6cfdd3164c1241 (patch)
treec15f754f59b3b99f2bd1b326dedb610709941213 /src/cairo-win32-surface.c
parentb913a81c3482f4dc8bc452d91bfaf64b416523f3 (diff)
Handle more cases by assuming no-super-luminescent colors.
Diffstat (limited to 'src/cairo-win32-surface.c')
-rw-r--r--src/cairo-win32-surface.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c
index 7d544e49..9df86380 100644
--- a/src/cairo-win32-surface.c
+++ b/src/cairo-win32-surface.c
@@ -604,12 +604,15 @@ _cairo_win32_surface_composite (cairo_operator_t operator,
/* This big function tells us how to optimize operators for the
* case of solid destination and constant-alpha source
+ *
+ * NOTE: This function needs revisiting if we add support for
+ * super-luminescent colors (a == 0, r,g,b > 0)
*/
static enum { DO_CLEAR, DO_SOURCE, DO_NOTHING, DO_UNSUPPORTED }
categorize_solid_dest_operator (cairo_operator_t operator,
unsigned short alpha)
{
- enum { SOURCE_TRANSPARENT, SOURCE_SOLID, SOURCE_OTHER } source;
+ enum { SOURCE_TRANSPARENT, SOURCE_LIGHT, SOURCE_SOLID, SOURCE_OTHER } source;
if (alpha >= 0xff00)
source = SOURCE_SOLID;
@@ -633,6 +636,8 @@ categorize_solid_dest_operator (cairo_operator_t operator,
case CAIRO_OPERATOR_ATOP: /* Ab 1 - Aa */
if (source == SOURCE_SOLID)
return DO_SOURCE;
+ else if (source == SOURCE_TRANSPARENT)
+ return DO_NOTHING;
else
return DO_UNSUPPORTED;
break;
@@ -664,7 +669,10 @@ categorize_solid_dest_operator (cairo_operator_t operator,
break;
case CAIRO_OPERATOR_ADD: /* 1 1 */
- return DO_UNSUPPORTED;
+ if (source == SOURCE_TRANSPARENT)
+ return DO_NOTHING;
+ else
+ return DO_UNSUPPORTED;
break;
}
}