[cairo-commit] 3 commits - src/cairo-path-fixed.c src/cairo-recording-surface.c src/cairo-spans-compositor.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Feb 12 02:28:40 PST 2013


 src/cairo-path-fixed.c        |   11 +++++++++++
 src/cairo-recording-surface.c |    2 +-
 src/cairo-spans-compositor.c  |    7 ++++++-
 3 files changed, 18 insertions(+), 2 deletions(-)

New commits:
commit a09b7c79278465ee1ad916697e0153eae640d8df
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Feb 12 10:25:03 2013 +0000

    path: Fix bbox computation for negative scale factors
    
    The fast path for transforming a path by a simple scale factor, forgot
    to fix up the orientation of the box if that scale factor was negative.
    
    Reported-by: Edward Zimmermann <Edward.Zimmermann at cib.de>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index 66fbdfe..10a6515 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -965,8 +965,19 @@ _cairo_path_fixed_offset_and_scale (cairo_path_fixed_t *path,
 
     path->extents.p1.x = _cairo_fixed_mul (scalex, path->extents.p1.x) + offx;
     path->extents.p2.x = _cairo_fixed_mul (scalex, path->extents.p2.x) + offx;
+    if (scalex < 0) {
+	cairo_fixed_t t = path->extents.p1.x;
+	path->extents.p1.x = path->extents.p2.x;
+	path->extents.p2.x = t;
+    }
+
     path->extents.p1.y = _cairo_fixed_mul (scaley, path->extents.p1.y) + offy;
     path->extents.p2.y = _cairo_fixed_mul (scaley, path->extents.p2.y) + offy;
+    if (scaley < 0) {
+	cairo_fixed_t t = path->extents.p1.y;
+	path->extents.p1.y = path->extents.p2.y;
+	path->extents.p2.y = t;
+    }
 }
 
 void
commit be1561dadece6e947a3ca78d1124197b4278ce96
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Feb 12 10:24:08 2013 +0000

    recording: Avoid indirection through indices array if not reduced
    
    If we don't discard any elements, then the index array is simply a 1:1
    mapping of the element array, and we may as well bypass it.
    
    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 edbeed7..c6d34c0 100644
--- a/src/cairo-recording-surface.c
+++ b/src/cairo-recording-surface.c
@@ -1654,7 +1654,7 @@ _cairo_recording_surface_replay_internal (cairo_recording_surface_t	*surface,
     if (extents.width < r->width || extents.height < r->height) {
 	num_elements =
 	    _cairo_recording_surface_get_visible_commands (surface, &extents);
-	use_indices = TRUE;
+	use_indices = num_elements != surface->commands.num_elements;
     }
 
     for (i = 0; i < num_elements; i++) {
commit 14237f11439831377b59e8ea5717de5dd3e19e73
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Feb 12 10:11:12 2013 +0000

    spans: Mark the surface as cleared in preparing for recording surface playback
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-spans-compositor.c b/src/cairo-spans-compositor.c
index cb3e973..6eb9b42 100644
--- a/src/cairo-spans-compositor.c
+++ b/src/cairo-spans-compositor.c
@@ -589,11 +589,16 @@ composite_aligned_boxes (const cairo_spans_compositor_t		*compositor,
 	/* XXX could also do tiling repeat modes... */
 
 	/* first clear the area about to be overwritten */
-	if (! dst->is_clear)
+	if (! dst->is_clear) {
 	    status = compositor->fill_boxes (dst,
 					     CAIRO_OPERATOR_CLEAR,
 					     CAIRO_COLOR_TRANSPARENT,
 					     boxes);
+	    if (unlikely (status))
+		return status;
+
+	    dst->is_clear = TRUE;
+	}
 
 	recording_clip = _cairo_clip_from_boxes (boxes);
 	status = _cairo_recording_surface_replay_with_clip (unwrap_source (source),


More information about the cairo-commit mailing list