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

Andrea Canciani <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
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

--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.