[cairo] [PATCH 1/5] pattern: Infinite color-only sources are always opaque

Andrea Canciani ranma42 at gmail.com
Sun Jan 15 05:59:04 PST 2012


No matter what the sampling extents are, infinite color-only sources
are opaque.
---
 src/cairo-pattern.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index bcc0035..41d7384 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -3132,18 +3132,18 @@ static cairo_bool_t
 _surface_is_opaque (const cairo_surface_pattern_t *pattern,
 		    const cairo_rectangle_int_t *sample)
 {
+    cairo_rectangle_int_t extents;
+
     if (pattern->surface->content & CAIRO_CONTENT_ALPHA)
 	return FALSE;
 
     if (pattern->base.extend != CAIRO_EXTEND_NONE)
 	return TRUE;
 
-    if (sample != NULL) {
-	cairo_rectangle_int_t extents;
-
-	if (! _cairo_surface_get_extents (pattern->surface, &extents))
-	    return TRUE;
+    if (! _cairo_surface_get_extents (pattern->surface, &extents))
+	return TRUE;
 
+    if (sample != NULL) {
 	if (sample->x >= extents.x &&
 	    sample->y >= extents.y &&
 	    sample->x + sample->width  <= extents.x + extents.width &&
-- 
1.7.5.4



More information about the cairo mailing list