[cairo-commit] 2 commits - src/cairo-gl-surface.c src/cairo-surface-fallback.c

Benjamin Otte company at kemper.freedesktop.org
Fri May 14 06:59:58 PDT 2010


 src/cairo-gl-surface.c       |   31 -------------------
 src/cairo-surface-fallback.c |   67 -------------------------------------------
 2 files changed, 98 deletions(-)

New commits:
commit 3a550eb2253588372b2c071b3c3152d5271c1aa2
Author: Benjamin Otte <otte at redhat.com>
Date:   Thu May 13 21:17:19 2010 +0200

    gl: Remove gradient optimizations
    
    These optimizations are done in cairo-gstate.c these days.

diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index eb2e91b..09932e1 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -1238,37 +1238,6 @@ _cairo_gl_gradient_operand_init(cairo_gl_context_t *ctx,
 {
     cairo_gradient_pattern_t *gradient = (cairo_gradient_pattern_t *)operand->pattern;
 
-    /* Fast path for gradients with less than 2 color stops.
-     * Required to prevent _cairo_pattern_acquire_surface() returning
-     * a solid color which is cached beyond the life of the context.
-     */
-    if (gradient->n_stops < 2) {
-	if (gradient->n_stops) {
-	    return _cairo_gl_solid_operand_init (operand,
-						 &gradient->stops->color);
-	} else {
-	    return _cairo_gl_solid_operand_init (operand,
-						 CAIRO_COLOR_TRANSPARENT);
-	}
-    } else {
-	unsigned int i;
-
-	/* Is the gradient a uniform colour?
-	 * Happens more often than you would believe.
-	 */
-	for (i = 1; i < gradient->n_stops; i++) {
-	    if (! _cairo_color_stop_equal (&gradient->stops[0].color,
-					   &gradient->stops[i].color))
-		{
-		    break;
-		}
-	}
-	if (i == gradient->n_stops) {
-	    return _cairo_gl_solid_operand_init (operand,
-						 &gradient->stops->color);
-	}
-    }
-
     if (! _cairo_gl_device_has_glsl (&ctx->base))
 	return CAIRO_INT_STATUS_UNSUPPORTED;
 
commit 3b1c0a4bd66660780095e6016e3db451f34503a3
Author: Benjamin Otte <otte at redhat.com>
Date:   Fri May 14 15:56:17 2010 +0200

    fallback: Remove span renderer paths
    
    Those paths were broken, as they didn't properly translate the polygon
    to the destination size. And rather than adding lots of code that allows
    translation, it's easier to just delete this code.
    
    Note that the only user of the code was the GL backend anyway.

diff --git a/src/cairo-surface-fallback.c b/src/cairo-surface-fallback.c
index 07ab60d..1edeac0 100644
--- a/src/cairo-surface-fallback.c
+++ b/src/cairo-surface-fallback.c
@@ -877,44 +877,6 @@ _clip_and_composite_trapezoids (const cairo_pattern_t *src,
 				&traps_info, dst, extents);
 }
 
-typedef struct {
-    cairo_polygon_t		*polygon;
-    cairo_fill_rule_t		 fill_rule;
-    cairo_antialias_t		 antialias;
-} cairo_composite_spans_info_t;
-
-static cairo_status_t
-_composite_spans_draw_func (void                          *closure,
-			    cairo_operator_t               op,
-			    const cairo_pattern_t         *src,
-			    cairo_surface_t               *dst,
-			    int                            dst_x,
-			    int                            dst_y,
-			    const cairo_rectangle_int_t   *extents,
-			    cairo_region_t		  *clip_region)
-{
-    cairo_composite_rectangles_t rects;
-    cairo_composite_spans_info_t *info = closure;
-
-    rects.source = *extents;
-    rects.mask = *extents;
-    rects.bounded = *extents;
-    /* The incoming dst_x/y are where we're pretending the origin of
-     * the dst surface is -- *not* the offset of a rectangle where
-     * we'd like to place the result. */
-    rects.bounded.x -= dst_x;
-    rects.bounded.y -= dst_y;
-    rects.unbounded = rects.bounded;
-    rects.is_bounded = _cairo_operator_bounded_by_either (op);
-
-    return _cairo_surface_composite_polygon (dst, op, src,
-					     info->fill_rule,
-					     info->antialias,
-					     &rects,
-					     info->polygon,
-					     clip_region);
-}
-
 cairo_status_t
 _cairo_surface_fallback_paint (cairo_surface_t		*surface,
 			       cairo_operator_t		 op,
@@ -1140,20 +1102,6 @@ _cairo_surface_fallback_stroke (cairo_surface_t		*surface,
 	    goto CLEANUP;
     }
 
-    if (_cairo_surface_check_span_renderer (op, source, surface, antialias)) {
-	cairo_composite_spans_info_t info;
-
-	info.polygon = &polygon;
-	info.fill_rule = CAIRO_FILL_RULE_WINDING;
-	info.antialias = antialias;
-
-	status = _clip_and_composite (clip, op, source,
-				      _composite_spans_draw_func,
-				      &info, surface,
-                                      extents.is_bounded ? &extents.bounded : &extents.unbounded);
-	goto CLEANUP;
-    }
-
     /* Fall back to trapezoid fills. */
     status = _cairo_bentley_ottmann_tessellate_polygon (&traps,
 							&polygon,
@@ -1257,21 +1205,6 @@ _cairo_surface_fallback_fill (cairo_surface_t		*surface,
 	    goto CLEANUP;
     }
 
-
-    if (_cairo_surface_check_span_renderer (op, source, surface, antialias)) {
-	cairo_composite_spans_info_t info;
-
-	info.polygon = &polygon;
-	info.fill_rule = fill_rule;
-	info.antialias = antialias;
-
-	status = _clip_and_composite (clip, op, source,
-				      _composite_spans_draw_func,
-				      &info, surface,
-                                      extents.is_bounded ? &extents.bounded : &extents.unbounded);
-	goto CLEANUP;
-    }
-
     /* Fall back to trapezoid fills. */
     status = _cairo_bentley_ottmann_tessellate_polygon (&traps,
 							&polygon,


More information about the cairo-commit mailing list