summaryrefslogtreecommitdiff
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
parentb913a81c3482f4dc8bc452d91bfaf64b416523f3 (diff)
Handle more cases by assuming no-super-luminescent colors.
-rw-r--r--ChangeLog5
-rw-r--r--src/cairo-win32-surface.c12
2 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 160dcc8c..be559920 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-05-11 Owen Taylor <otaylor@redhat.com>
+
+ * src/cairo-win32-surface.c (categorize_solid_dest_operator):
+ Handle more cases by assuming no-super-luminescent colors.
+
2005-05-11 T Rowley <tim.rowley@gmail.com>
* src/cairo-atsui-font.c:
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;
}
}