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

Adrian Johnson ajohnson at kemper.freedesktop.org
Fri Sep 16 04:24:25 PDT 2011


 src/cairo-analysis-surface.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit d118ae5f648f2171754c877d27211730e6a003d8
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Fri Sep 16 20:51:30 2011 +0930

    analysis mask: unwrap recording surface snapshot
    
    fixes mask-alpha test

diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c
index e1c28b6..d9edcd7 100644
--- a/src/cairo-analysis-surface.c
+++ b/src/cairo-analysis-surface.c
@@ -410,8 +410,10 @@ _cairo_analysis_surface_mask (void			*abstract_surface,
 	cairo_int_status_t backend_mask_status = CAIRO_STATUS_SUCCESS;
 
 	if (source->type == CAIRO_PATTERN_TYPE_SURFACE) {
-	    const cairo_surface_pattern_t *surface_pattern = (const cairo_surface_pattern_t *) source;
-	    if (_cairo_surface_is_recording (surface_pattern->surface)) {
+	    cairo_surface_t *src_surface = ((cairo_surface_pattern_t *)source)->surface;
+	    if (_cairo_surface_is_snapshot (src_surface))
+		src_surface = _cairo_surface_snapshot_get_target (src_surface);
+	    if (_cairo_surface_is_recording (src_surface)) {
 		backend_source_status =
 		    _analyze_recording_surface_pattern (surface, source);
 		if (_cairo_int_status_is_error (backend_source_status))
@@ -420,8 +422,10 @@ _cairo_analysis_surface_mask (void			*abstract_surface,
 	}
 
 	if (mask->type == CAIRO_PATTERN_TYPE_SURFACE) {
-	    cairo_surface_pattern_t *surface_pattern = (cairo_surface_pattern_t *) mask;
-	    if (_cairo_surface_is_recording (surface_pattern->surface)) {
+	    cairo_surface_t *mask_surface = ((cairo_surface_pattern_t *)mask)->surface;
+	    if (_cairo_surface_is_snapshot (mask_surface))
+		mask_surface = _cairo_surface_snapshot_get_target (mask_surface);
+	    if (_cairo_surface_is_recording (mask_surface)) {
 		backend_mask_status =
 		    _analyze_recording_surface_pattern (surface, mask);
 		if (_cairo_int_status_is_error (backend_mask_status))


More information about the cairo-commit mailing list