[cairo-commit] src/cairo-surface.c

Benjamin Otte company at kemper.freedesktop.org
Fri Apr 30 11:19:28 PDT 2010

 src/cairo-surface.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 3294daf423e88b55aa13841dfa7c557ee9833f92
Author: Benjamin Otte <otte at redhat.com>
Date:   Fri Apr 30 20:14:54 2010 +0200

    Create cleared surface instead of a scratch surface in clone_similar()
    A cleared surface is needed when playing back a recording surface that
    has semi-transparent operations.
    As this only affects surface types where scratch surfaces aren't already
    cleared (ie it affected xlib but not image), the effect was only visible
    for those backends.
    This should not cause any performance regressions as the other backends
    set surface->clear = TRUE when creating the scratch surface, so the
    clear operation is effectively a no-op.
    Covered by the existing pdf-surface-source and svg-surface-source tests.

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index a59c1ec..e676b92 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -1465,10 +1465,11 @@ _cairo_recording_surface_clone_similar (cairo_surface_t  *surface,
     if (recorder->unbounded ||
 	width*height*8 < recorder->extents.width*recorder->extents.height)
-	/* XXX use _solid to perform an initial CLEAR? */
-	similar = _cairo_surface_create_similar_scratch (surface,
-							 src->content,
-							 width, height);
+	similar = _cairo_surface_create_similar_solid (surface,
+						       src->content,
+						       width, height,
+                                                       CAIRO_COLOR_TRANSPARENT,
+                                                       FALSE);
 	if (similar == NULL)
 	if (unlikely (similar->status))

More information about the cairo-commit mailing list