[cairo-commit] cairo/src cairo-win32-surface.c,1.21,1.22

Owen Taylor commit at pdx.freedesktop.org
Wed May 11 16:32:46 PDT 2005


Committed by: otaylor

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv14291/src

Modified Files:
	cairo-win32-surface.c 
Log Message:
2005-05-11  Owen Taylor  <otaylor at redhat.com>

	* src/cairo-win32-surface.c (categorize_solid_dest_operator):
	Handle more cases by assuming no-super-luminescent colors.

Index: cairo-win32-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-win32-surface.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- cairo-win32-surface.c	11 May 2005 23:01:56 -0000	1.21
+++ cairo-win32-surface.c	11 May 2005 23:32:44 -0000	1.22
@@ -604,12 +604,15 @@
 
 /* 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 @@
     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 @@
 	break;
 	
     case CAIRO_OPERATOR_ADD:	  /* 1                1 */
-	return DO_UNSUPPORTED;
+	if (source == SOURCE_TRANSPARENT)
+	    return DO_NOTHING;
+	else
+	    return DO_UNSUPPORTED;
 	break;
     }	
 }




More information about the cairo-commit mailing list