[cairo-commit] 3 commits - src/cairo-gl-composite.c src/cairo-surface-subsurface.c src/cairo-xlib-source.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Nov 2 04:01:36 PDT 2011


 src/cairo-gl-composite.c       |    7 +++++--
 src/cairo-surface-subsurface.c |    2 ++
 src/cairo-xlib-source.c        |   17 ++++++++++-------
 3 files changed, 17 insertions(+), 9 deletions(-)

New commits:
commit c64ec4e49c1f06a451187d5f8360df09a777f61c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Nov 2 11:00:40 2011 +0000

    gl: Initialize spans on the context
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-gl-composite.c b/src/cairo-gl-composite.c
index 2f9697a..17732d3 100644
--- a/src/cairo-gl-composite.c
+++ b/src/cairo-gl-composite.c
@@ -269,6 +269,7 @@ _cairo_gl_context_setup_spans (cairo_gl_context_t *ctx,
 				   GL_UNSIGNED_BYTE, GL_TRUE, vertex_size,
 				   (void *) (uintptr_t) vertex_offset);
     dispatch->EnableVertexAttribArray (CAIRO_GL_COLOR_ATTRIB_INDEX);
+    ctx->spans = TRUE;
 }
 
 void
@@ -520,9 +521,11 @@ _cairo_gl_composite_begin (cairo_gl_composite_t *setup,
     mask_size = _cairo_gl_operand_get_vertex_size (setup->mask.type);
 
     vertex_size = dst_size + src_size + mask_size;
-    if (ctx->vertex_size != vertex_size) {
+    if (setup->spans)
+	    vertex_size += sizeof (GLfloat);
+
+    if (ctx->vertex_size != vertex_size)
         _cairo_gl_composite_flush (ctx);
-    }
 
     _cairo_gl_context_set_destination (ctx, setup->dst);
 
commit 2a453ee7df543441986b0a52ec2c2de72005c091
Merge: ba855a1... 8ddecc0...
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Oct 27 19:00:58 2011 +0100

    Merge branch 'master' of git://cairographics.org/git/cairo

commit ba855a12e8d686f2137f82d317791f3ec4a68fc0
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Oct 14 16:01:27 2011 +0100

    xlib-xp

diff --git a/src/cairo-surface-subsurface.c b/src/cairo-surface-subsurface.c
index 48d10fb..b93604f 100644
--- a/src/cairo-surface-subsurface.c
+++ b/src/cairo-surface-subsurface.c
@@ -577,6 +577,7 @@ cairo_surface_create_for_rectangle (cairo_surface_t *target,
     }
 
     surface->target = cairo_surface_reference (target);
+    surface->base.type = surface->target->type;
 
     return &surface->base;
 }
@@ -609,6 +610,7 @@ _cairo_surface_create_for_rectangle_int (cairo_surface_t *target,
     surface->extents.x += target->device_transform.x0;
     surface->extents.y += target->device_transform.y0;
     surface->target = cairo_surface_reference (target);
+    surface->base.type = surface->target->type;
 
     return &surface->base;
 }
diff --git a/src/cairo-xlib-source.c b/src/cairo-xlib-source.c
index dc5aa7a..eb1dc8f 100644
--- a/src/cairo-xlib-source.c
+++ b/src/cairo-xlib-source.c
@@ -54,18 +54,19 @@
 #include "cairo-surface-offset-private.h"
 #include "cairo-surface-observer-private.h"
 #include "cairo-surface-snapshot-private.h"
+#include "cairo-surface-subsurface-private.h"
 
 #define PIXMAN_MAX_INT ((pixman_fixed_1 >> 1) - pixman_fixed_e) /* need to ensure deltas also fit */
 
 static cairo_surface_t *
 unwrap_surface (cairo_surface_t *surface, int *tx, int *ty)
 {
-    *tx = *ty = 0;
-
     if (_cairo_surface_is_paginated (surface))
 	surface = _cairo_paginated_surface_get_recording (surface);
     if (_cairo_surface_is_snapshot (surface))
 	surface = _cairo_surface_snapshot_get_target (surface);
+    if (_cairo_surface_is_subsurface (surface))
+	surface = _cairo_surface_subsurface_get_target_with_offset (surface, tx, ty);
     if (_cairo_surface_is_observer (surface))
 	surface = _cairo_surface_observer_get_target (surface);
     return surface;
@@ -567,15 +568,17 @@ native_source (cairo_xlib_surface_t *dst,
 	is_contained = TRUE;
     }
 
-    if (pattern->base.filter == CAIRO_FILTER_NEAREST && is_contained) {
+    if (pattern->base.filter == CAIRO_FILTER_NEAREST && is_contained &&
+	_cairo_matrix_is_translation (&pattern->base.matrix))
+    {
 	*src_x += pattern->base.matrix.x0;
 	*src_y += pattern->base.matrix.y0;
 	_cairo_xlib_surface_ensure_picture (src);
 	return cairo_surface_reference (&src->base);
     }
 
-    /* As these are frequent and meant to be fast we track pictures for
-     * enative surface and minimse update requests.
+    /* As these are frequent and meant to be fast, we track pictures for
+     * native surface and minimise update requests.
      */
     source = &src->embedded_source;
     if (source->picture == None) {
@@ -891,9 +894,9 @@ _cairo_xlib_source_create_for_pattern (cairo_surface_t *_dst,
     cairo_xlib_surface_t *dst = (cairo_xlib_surface_t *)_dst;
     int tx, ty;
 
-    if (pattern == NULL || pattern->type == CAIRO_PATTERN_TYPE_SOLID) {
-	*src_x = *src_y = 0;
+    *src_x = *src_y = 0;
 
+    if (pattern == NULL || pattern->type == CAIRO_PATTERN_TYPE_SOLID) {
 	if (pattern == NULL)
 	    pattern = &_cairo_pattern_white.base;
 


More information about the cairo-commit mailing list