[cairo-commit] cairo/src cairo-glitz-surface.c, 1.34, 1.35 cairo-gstate.c, 1.121, 1.122 cairo-image-surface.c, 1.38, 1.39 cairo-ps-surface.c, 1.33, 1.34 cairo-surface.c, 1.64, 1.65 cairo-xlib-surface.c, 1.60, 1.61 cairo.h, 1.111, 1.112

Carl Worth commit at pdx.freedesktop.org
Fri May 6 13:26:23 PDT 2005


Committed by: cworth

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

Modified Files:
	cairo-glitz-surface.c cairo-gstate.c cairo-image-surface.c 
	cairo-ps-surface.c cairo-surface.c cairo-xlib-surface.c 
	cairo.h 
Log Message:

        * src/cairo-glitz-surface.c: (_glitz_operator),
        (_cairo_glitz_surface_fill_rectangles):
        * src/cairo-gstate.c: (_cairo_gstate_mask):
        * src/cairo-image-surface.c: (_pixman_operator),
        (_cairo_image_surface_composite_trapezoids):
        * src/cairo-ps-surface.c: (_cairo_ps_surface_erase),
        (_cairo_ps_surface_copy_page):
        * src/cairo-surface.c: (_cairo_surface_create_similar_solid):
        * src/cairo-xlib-surface.c: (_render_operator):
        * src/cairo.h:
        * test/cairo-test.c: (cairo_test_for_target):
        * test/mask.c: (mask_polygon), (draw):

        Rename and re-order the cairo_operator_t enum to names that
        abbreviate less and are easier to understand,
        (eg. CAIRO_OPERATOR_DEST_OVER instead of
        CAIRO_OPEERATOR_OVER_REVERSE).


Index: cairo-glitz-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-glitz-surface.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- cairo-glitz-surface.c	4 May 2005 12:46:00 -0000	1.34
+++ cairo-glitz-surface.c	6 May 2005 20:26:16 -0000	1.35
@@ -399,32 +399,49 @@
     switch (op) {
     case CAIRO_OPERATOR_CLEAR:
 	return GLITZ_OPERATOR_CLEAR;
-    case CAIRO_OPERATOR_SRC:
+
+    case CAIRO_OPERATOR_SOURCE:
 	return GLITZ_OPERATOR_SRC;
-    case CAIRO_OPERATOR_DST:
-	return GLITZ_OPERATOR_DST;
-    case CAIRO_OPERATOR_OVER_REVERSE:
-	return GLITZ_OPERATOR_OVER_REVERSE;
+    case CAIRO_OPERATOR_OVER:
+	return GLITZ_OPERATOR_OVER;
     case CAIRO_OPERATOR_IN:
 	return GLITZ_OPERATOR_IN;
-    case CAIRO_OPERATOR_IN_REVERSE:
-	return GLITZ_OPERATOR_IN_REVERSE;
     case CAIRO_OPERATOR_OUT:
 	return GLITZ_OPERATOR_OUT;
-    case CAIRO_OPERATOR_OUT_REVERSE:
-	return GLITZ_OPERATOR_OUT_REVERSE;
     case CAIRO_OPERATOR_ATOP:
 	return GLITZ_OPERATOR_ATOP;
-    case CAIRO_OPERATOR_ATOP_REVERSE:
+
+    case CAIRO_OPERATOR_DEST:
+	return GLITZ_OPERATOR_DST;
+    case CAIRO_OPERATOR_DEST_OVER:
+	return GLITZ_OPERATOR_OVER_REVERSE;
+    case CAIRO_OPERATOR_DEST_IN:
+	return GLITZ_OPERATOR_IN_REVERSE;
+    case CAIRO_OPERATOR_DEST_OUT:
+	return GLITZ_OPERATOR_OUT_REVERSE;
+    case CAIRO_OPERATOR_DEST_ATOP:
 	return GLITZ_OPERATOR_ATOP_REVERSE;
+
     case CAIRO_OPERATOR_XOR:
 	return GLITZ_OPERATOR_XOR;
     case CAIRO_OPERATOR_ADD:
 	return GLITZ_OPERATOR_ADD;
-    case CAIRO_OPERATOR_OVER:
-    default:
+    case CAIRO_OPERATOR_SATURATE:
+	/* XXX: OVER is definitely not the right thing here, (but it
+	 * is what the original glitz backend code has always
+	 * done). Cairo's SATURATE operator is the native GL
+	 * compositing mode, (from my understanding). So why isn't
+	 * there a GLITZ_OPERATOR_SATURATE for us to use here? */
 	return GLITZ_OPERATOR_OVER;
     }
+
+    ASSERT_NOT_REACHED;
+
+    /* Something's very broken if this line of code can be reached, so
+       we want to return something that would give a noticeably
+       incorrect result. The XOR operator seems so rearely desired
+       that it should fit the bill here. */
+    return CAIRO_OPERATOR_XOR;
 }
 
 static glitz_status_t
@@ -888,7 +905,7 @@
 {
     cairo_glitz_surface_t *dst = abstract_dst;
 
-    if (op == CAIRO_OPERATOR_SRC)
+    if (op == CAIRO_OPERATOR_SOURCE)
     {
 	glitz_color_t glitz_color;
 

Index: cairo-gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-gstate.c,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -d -r1.121 -r1.122
--- cairo-gstate.c	6 May 2005 20:23:41 -0000	1.121
+++ cairo-gstate.c	6 May 2005 20:26:16 -0000	1.122
@@ -924,7 +924,7 @@
 	if (intermediate == NULL)
 	    return CAIRO_STATUS_NO_MEMORY;
 
-	status = _cairo_surface_composite (CAIRO_OPERATOR_SRC,
+	status = _cairo_surface_composite (CAIRO_OPERATOR_SOURCE,
 					   mask, NULL, intermediate,
 					   extents.x,     extents.y,
 					   0,             0,

Index: cairo-image-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-image-surface.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- cairo-image-surface.c	26 Apr 2005 03:42:54 -0000	1.38
+++ cairo-image-surface.c	6 May 2005 20:26:16 -0000	1.39
@@ -442,32 +442,40 @@
     return status;
 }
 
+/* XXX: I think we should fix pixman to match the names/order of the
+ * cairo operators, but that will likely be better done at the same
+ * time the X server is ported to pixman, (which will change a lot of
+ * things in pixman I think).
+ */
 static pixman_operator_t
 _pixman_operator (cairo_operator_t operator)
 {
     switch (operator) {
     case CAIRO_OPERATOR_CLEAR:
 	return PIXMAN_OPERATOR_CLEAR;
-    case CAIRO_OPERATOR_SRC:
+
+    case CAIRO_OPERATOR_SOURCE:
 	return PIXMAN_OPERATOR_SRC;
-    case CAIRO_OPERATOR_DST:
-	return PIXMAN_OPERATOR_DST;
     case CAIRO_OPERATOR_OVER:
 	return PIXMAN_OPERATOR_OVER;
-    case CAIRO_OPERATOR_OVER_REVERSE:
-	return PIXMAN_OPERATOR_OVER_REVERSE;
     case CAIRO_OPERATOR_IN:
 	return PIXMAN_OPERATOR_IN;
-    case CAIRO_OPERATOR_IN_REVERSE:
-	return PIXMAN_OPERATOR_IN_REVERSE;
     case CAIRO_OPERATOR_OUT:
 	return PIXMAN_OPERATOR_OUT;
-    case CAIRO_OPERATOR_OUT_REVERSE:
-	return PIXMAN_OPERATOR_OUT_REVERSE;
     case CAIRO_OPERATOR_ATOP:
 	return PIXMAN_OPERATOR_ATOP;
-    case CAIRO_OPERATOR_ATOP_REVERSE:
+
+    case CAIRO_OPERATOR_DEST:
+	return PIXMAN_OPERATOR_DST;
+    case CAIRO_OPERATOR_DEST_OVER:
+	return PIXMAN_OPERATOR_OVER_REVERSE;
+    case CAIRO_OPERATOR_DEST_IN:
+	return PIXMAN_OPERATOR_IN_REVERSE;
+    case CAIRO_OPERATOR_DEST_OUT:
+	return PIXMAN_OPERATOR_OUT_REVERSE;
+    case CAIRO_OPERATOR_DEST_ATOP:
 	return PIXMAN_OPERATOR_ATOP_REVERSE;
+
     case CAIRO_OPERATOR_XOR:
 	return PIXMAN_OPERATOR_XOR;
     case CAIRO_OPERATOR_ADD:
@@ -615,7 +623,7 @@
      * somehow. */
     status = _cairo_image_surface_set_attributes (src, &attributes);
     if (CAIRO_OK (status))
-	pixman_composite_trapezoids (operator,
+	pixman_composite_trapezoids (_pixman_operator (operator),
 				     src->pixman_image,
 				     dst->pixman_image,
 				     render_src_x + attributes.x_offset,

Index: cairo-ps-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ps-surface.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- cairo-ps-surface.c	19 Apr 2005 23:29:05 -0000	1.33
+++ cairo-ps-surface.c	6 May 2005 20:26:16 -0000	1.34
@@ -147,7 +147,7 @@
 _cairo_ps_surface_erase (cairo_ps_surface_t *surface)
 {
     _cairo_surface_fill_rectangle (&surface->image->base,
-				   CAIRO_OPERATOR_SRC,
+				   CAIRO_OPERATOR_SOURCE,
 				   CAIRO_COLOR_TRANSPARENT,
 				   0, 0,
 				   surface->image->width,
@@ -219,7 +219,7 @@
 
     _cairo_pattern_init_solid (&white_pattern, CAIRO_COLOR_WHITE);
 
-    _cairo_surface_composite (CAIRO_OPERATOR_OVER_REVERSE,
+    _cairo_surface_composite (CAIRO_OPERATOR_DEST_OVER,
 			      &white_pattern.base,
 			      NULL,
 			      &surface->image->base,

Index: cairo-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-surface.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- cairo-surface.c	6 May 2005 20:23:41 -0000	1.64
+++ cairo-surface.c	6 May 2005 20:26:16 -0000	1.65
@@ -219,7 +219,7 @@
 	surface = cairo_image_surface_create (format, width, height);
     
     status = _cairo_surface_fill_rectangle (surface,
-					    CAIRO_OPERATOR_SRC, color,
+					    CAIRO_OPERATOR_SOURCE, color,
 					    0, 0, width, height);
     if (status) {
 	cairo_surface_destroy (surface);

Index: cairo-xlib-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-xlib-surface.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- cairo-xlib-surface.c	19 Apr 2005 23:29:05 -0000	1.60
+++ cairo-xlib-surface.c	6 May 2005 20:26:16 -0000	1.61
@@ -600,26 +600,29 @@
     switch (operator) {
     case CAIRO_OPERATOR_CLEAR:
 	return PictOpClear;
-    case CAIRO_OPERATOR_SRC:
+
+    case CAIRO_OPERATOR_SOURCE:
 	return PictOpSrc;
-    case CAIRO_OPERATOR_DST:
-	return PictOpDst;
     case CAIRO_OPERATOR_OVER:
 	return PictOpOver;
-    case CAIRO_OPERATOR_OVER_REVERSE:
-	return PictOpOverReverse;
     case CAIRO_OPERATOR_IN:
 	return PictOpIn;
-    case CAIRO_OPERATOR_IN_REVERSE:
-	return PictOpInReverse;
     case CAIRO_OPERATOR_OUT:
 	return PictOpOut;
-    case CAIRO_OPERATOR_OUT_REVERSE:
-	return PictOpOutReverse;
     case CAIRO_OPERATOR_ATOP:
 	return PictOpAtop;
-    case CAIRO_OPERATOR_ATOP_REVERSE:
+
+    case CAIRO_OPERATOR_DEST:
+	return PictOpDst;
+    case CAIRO_OPERATOR_DEST_OVER:
+	return PictOpOverReverse;
+    case CAIRO_OPERATOR_DEST_IN:
+	return PictOpInReverse;
+    case CAIRO_OPERATOR_DEST_OUT:
+	return PictOpOutReverse;
+    case CAIRO_OPERATOR_DEST_ATOP:
 	return PictOpAtopReverse;
+
     case CAIRO_OPERATOR_XOR:
 	return PictOpXor;
     case CAIRO_OPERATOR_ADD:

Index: cairo.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.h,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- cairo.h	6 May 2005 20:23:41 -0000	1.111
+++ cairo.h	6 May 2005 20:26:16 -0000	1.112
@@ -228,18 +228,21 @@
 
 /* Modify state */
 
-typedef enum cairo_operator { 
+typedef enum cairo_operator {
     CAIRO_OPERATOR_CLEAR,
-    CAIRO_OPERATOR_SRC,
-    CAIRO_OPERATOR_DST,
+
+    CAIRO_OPERATOR_SOURCE,
     CAIRO_OPERATOR_OVER,
-    CAIRO_OPERATOR_OVER_REVERSE,
     CAIRO_OPERATOR_IN,
-    CAIRO_OPERATOR_IN_REVERSE,
     CAIRO_OPERATOR_OUT,
-    CAIRO_OPERATOR_OUT_REVERSE,
     CAIRO_OPERATOR_ATOP,
-    CAIRO_OPERATOR_ATOP_REVERSE,
+
+    CAIRO_OPERATOR_DEST,
+    CAIRO_OPERATOR_DEST_OVER,
+    CAIRO_OPERATOR_DEST_IN,
+    CAIRO_OPERATOR_DEST_OUT,
+    CAIRO_OPERATOR_DEST_ATOP,
+
     CAIRO_OPERATOR_XOR,
     CAIRO_OPERATOR_ADD,
     CAIRO_OPERATOR_SATURATE




More information about the cairo-commit mailing list