[cairo-commit] cairo/src cairo-gstate.c,1.142,1.143

Owen Taylor commit at pdx.freedesktop.org
Wed Jun 15 12:44:55 PDT 2005


Committed by: otaylor

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

Modified Files:
	cairo-gstate.c 
Log Message:
2005-06-15  Owen Taylor  <otaylor at redhat.com>

        * src/cairo-gstate.c (_cairo_gstate_clip_and_composite_trapezoids):
        Use a clip region when rendering a non-solid pattern through
        a rectangular path ... trapezoid rasterization is just too slow
        to use that path when we aren't forced to do so.


Index: cairo-gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-gstate.c,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -d -r1.142 -r1.143
--- cairo-gstate.c	15 Jun 2005 02:45:23 -0000	1.142
+++ cairo-gstate.c	15 Jun 2005 19:44:52 -0000	1.143
@@ -1417,16 +1417,23 @@
 	    /* Solid rectangles are handled specially */
 	    status = _composite_trap_region_solid (gstate, (cairo_solid_pattern_t *)src,
 						   operator, dst, trap_region);
-	} else if (trap_region && pixman_region_num_rects (trap_region) <= 1) {
-	    /* For a simple rectangle, we can just use composite(), for more
-	     * rectangles, we'd have to set a clip region. That might still
-	     * be a win, but it's less obvious. (Depends on the backend)
-	     */
-	    status = _composite_trap_region (gstate, src, operator, dst,
-					     trap_region, &extents);
 	} else {
-	    status = _composite_traps (gstate, src, operator,
-				       dst, traps, &extents);
+	    if (trap_region) {
+		/* For a simple rectangle, we can just use composite(), for more
+		 * rectangles, we have to set a clip region. The cost of rasterizing
+		 * trapezoids is pretty high for most backends currently, so it's
+		 * worthwhile even if a region is needed.
+		 */
+		status = _composite_trap_region (gstate, src, operator, dst,
+						 trap_region, &extents);
+		if (status != CAIRO_INT_STATUS_UNSUPPORTED)
+		    goto out;
+
+		/* If a clip regions aren't supported, fall through */
+	    }
+	  
+	  status = _composite_traps (gstate, src, operator,
+				     dst, traps, &extents);
 	}
     }
 




More information about the cairo-commit mailing list