[cairo-commit] 6 commits - src/cairo-composite-rectangles.c src/cairo-gl-device.c src/cairo-gl-traps-compositor.c src/cairo-recording-surface.c src/cairo-xlib-display.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Oct 11 09:02:00 PDT 2012


 src/cairo-composite-rectangles.c |    7 +++++++
 src/cairo-gl-device.c            |    2 +-
 src/cairo-gl-traps-compositor.c  |   32 ++++++++++++++++++++++++++++++++
 src/cairo-recording-surface.c    |    4 ++--
 src/cairo-xlib-display.c         |   34 +++++++++++++++++-----------------
 5 files changed, 59 insertions(+), 20 deletions(-)

New commits:
commit db488a1703d4ef3bcbd54138b51c01600a2f4d3a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Oct 11 17:00:57 2012 +0100

    recording: Copy across the is-clear? during snapshotting
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55799
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c
index e297273..ce7c760 100644
--- a/src/cairo-recording-surface.c
+++ b/src/cairo-recording-surface.c
@@ -1431,7 +1431,7 @@ _cairo_recording_surface_snapshot (void *abstract_other)
     surface->extents = other->extents;
     surface->unbounded = other->unbounded;
 
-    surface->base.is_clear = TRUE;
+    surface->base.is_clear = other->base.is_clear;
 
     surface->bbtree.left = surface->bbtree.right = NULL;
     surface->bbtree.chain = INVALID_CHAIN;
commit ed720007ba6be17434eb68b604fd36bd91c0d894
Author: Henry Song <henry.song at samsung.com>
Date:   Thu Oct 11 16:57:57 2012 +0100

    recording: copy reverses its dst and src parameters
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55799

diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c
index 73fc48a..e297273 100644
--- a/src/cairo-recording-surface.c
+++ b/src/cairo-recording-surface.c
@@ -1441,7 +1441,7 @@ _cairo_recording_surface_snapshot (void *abstract_other)
     surface->optimize_clears = TRUE;
 
     _cairo_array_init (&surface->commands, sizeof (cairo_command_t *));
-    status = _cairo_recording_surface_copy (other, surface);
+    status = _cairo_recording_surface_copy (surface, other);
     if (unlikely (status)) {
 	cairo_surface_destroy (&surface->base);
 	return _cairo_surface_create_in_error (status);
commit 26c8accd41163d86711ba900bec7d9cd6591d8a3
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Oct 11 16:52:07 2012 +0100

    xlib: Reorder CloseDisplay hooks
    
    As we may utilize X extensions as we shutdown and release resources
    during CloseDisplay, we need to run our own callback first. If we run
    last, than we reinstantiate the extensions which often have the
    unfortunate habit of then persisting with stale data across the next
    Display connection, causing invalid requests to be generated and raise
    XErrors.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-xlib-display.c b/src/cairo-xlib-display.c
index f23a655..67c0673 100644
--- a/src/cairo-xlib-display.c
+++ b/src/cairo-xlib-display.c
@@ -213,6 +213,13 @@ _cairo_xlib_device_create (Display *dpy)
 	goto UNLOCK;
     }
 
+    _cairo_device_init (&display->base, &_cairo_xlib_device_backend);
+
+    display->display = dpy;
+    cairo_list_init (&display->screens);
+    cairo_list_init (&display->fonts);
+    display->closed = FALSE;
+
     /* Xlib calls out to the extension close_display hooks in LIFO
      * order. So we have to ensure that all extensions that we depend
      * on in our close_display hook are properly initialized before we
@@ -240,23 +247,6 @@ _cairo_xlib_device_create (Display *dpy)
 
     _cairo_xlib_display_select_compositor (display);
 
-    codes = XAddExtension (dpy);
-    if (unlikely (codes == NULL)) {
-	device = _cairo_device_create_in_error (CAIRO_STATUS_NO_MEMORY);
-	free (display);
-	goto UNLOCK;
-    }
-
-    _cairo_device_init (&display->base, &_cairo_xlib_device_backend);
-
-    XESetCloseDisplay (dpy, codes->extension, _cairo_xlib_close_display);
-
-    cairo_device_reference (&display->base); /* add one for the CloseDisplay */
-    display->display = dpy;
-    cairo_list_init (&display->screens);
-    cairo_list_init (&display->fonts);
-    display->closed = FALSE;
-
     display->white = NULL;
     memset (display->alpha, 0, sizeof (display->alpha));
     memset (display->solid, 0, sizeof (display->solid));
@@ -352,6 +342,16 @@ _cairo_xlib_device_create (Display *dpy)
 	display->buggy_pad_reflect = TRUE;
     }
 
+    codes = XAddExtension (dpy);
+    if (unlikely (codes == NULL)) {
+	device = _cairo_device_create_in_error (CAIRO_STATUS_NO_MEMORY);
+	free (display);
+	goto UNLOCK;
+    }
+
+    XESetCloseDisplay (dpy, codes->extension, _cairo_xlib_close_display);
+    cairo_device_reference (&display->base); /* add one for the CloseDisplay */
+
     display->next = _cairo_xlib_display_list;
     _cairo_xlib_display_list = display;
 
commit fbf528f46deaebc7d8cf38fc61be9e016f207575
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Oct 9 17:37:53 2012 +0100

    compositor: Reduce glyph "overlap" if the inked pixels are opaque
    
    We can ignore the issue of overdraw if when we paint the glyphs, the
    result is opaque.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-composite-rectangles.c b/src/cairo-composite-rectangles.c
index c792985..c26098a 100644
--- a/src/cairo-composite-rectangles.c
+++ b/src/cairo-composite-rectangles.c
@@ -444,6 +444,13 @@ _cairo_composite_rectangles_init_for_glyphs (cairo_composite_rectangles_t *exten
     if (unlikely (status))
 	return status;
 
+    if (overlap && *overlap &&
+	scaled_font->options.antialias == CAIRO_ANTIALIAS_NONE &&
+	_cairo_pattern_is_opaque_solid (&extents->source_pattern.base))
+    {
+	*overlap = FALSE;
+    }
+
     return _cairo_composite_rectangles_intersect (extents, clip);
 }
 
commit 66500ef29fea41ccda554f85d82a6aa3de774903
Author: Henry Song <henry.song at samsung.com>
Date:   Thu Sep 27 19:22:23 2012 +0000

    gl/traps: ensure RGBA surface before upload image to texture for GLES2
    
    As GLESv2 may only use an RGBA surface as its source for texture
    uploads, we therefore need to perform a conversion.

diff --git a/src/cairo-gl-traps-compositor.c b/src/cairo-gl-traps-compositor.c
index a87fd16..4bae0d1 100644
--- a/src/cairo-gl-traps-compositor.c
+++ b/src/cairo-gl-traps-compositor.c
@@ -50,6 +50,7 @@
 #include "cairo-image-surface-private.h"
 #include "cairo-spans-compositor-private.h"
 #include "cairo-surface-backend-private.h"
+#include "cairo-surface-offset-private.h"
 
 static cairo_int_status_t
 acquire (void *abstract_dst)
@@ -300,6 +301,36 @@ traps_to_operand (void *_dst,
 	return image->status;
     }
 
+    /* GLES2 only supports RGB/RGBA when uploading */
+    if (_cairo_gl_get_flavor () == CAIRO_GL_FLAVOR_ES) {
+	cairo_surface_pattern_t pattern;
+	cairo_surface_t *rgba_image;
+
+	/* XXX perform this fixup inside _cairo_gl_draw_image() */
+
+	rgba_image =
+	    _cairo_image_surface_create_with_pixman_format (NULL,
+							    _cairo_is_little_endian () ?  PIXMAN_a8b8g8r8 : PIXMAN_r8g8b8a8,
+							    extents->width,
+							    extents->height,
+							    0);
+	if (unlikely (rgba_image->status))
+	    return rgba_image->status;
+
+	_cairo_pattern_init_for_surface (&pattern, image);
+	status = _cairo_surface_paint (rgba_image, CAIRO_OPERATOR_SOURCE,
+				       &pattern.base, NULL);
+	_cairo_pattern_fini (&pattern.base);
+
+	cairo_surface_destroy (image);
+	image = rgba_image;
+
+	if (unlikely (status)) {
+	    cairo_surface_destroy (image);
+	    return status;
+	}
+    }
+
     mask = _cairo_surface_create_similar_scratch (_dst,
 						  CAIRO_CONTENT_COLOR_ALPHA,
 						  extents->width,
@@ -315,6 +346,7 @@ traps_to_operand (void *_dst,
 					   extents->width, extents->height,
 					   0, 0);
     cairo_surface_destroy (image);
+
     if (unlikely (status))
 	goto error;
 
commit 188c34b40d6f08851b4076ad11aefe69d4a78a25
Author: Henry Song <henry.song at samsung.com>
Date:   Thu Sep 27 18:25:52 2012 +0000

    gl: gles2 only supports GL_DEPTH24_STENCIL8_OES
    
    Patch also provided by U. Artie Eoff <ullysses.a.eoff at intel.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50355

diff --git a/src/cairo-gl-device.c b/src/cairo-gl-device.c
index 9cb0c21..6563b3b 100644
--- a/src/cairo-gl-device.c
+++ b/src/cairo-gl-device.c
@@ -321,7 +321,7 @@ _get_depth_stencil_format (cairo_gl_context_t *ctx)
 
 #if CAIRO_HAS_GLESV2_SURFACE
     if (ctx->gl_flavor == CAIRO_GL_FLAVOR_DESKTOP)
-	return GL_DEPTH24_STENCIL8;
+	return GL_DEPTH24_STENCIL8_OES;
 #endif
 
 #if CAIRO_HAS_GL_SURFACE


More information about the cairo-commit mailing list