Bug 751668. Avoid incorrectly using EXTEND_NONE. r=joe,a=jpr
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Thu, 03 May 2012 15:21:52 -0400
changeset 94158 e73465a6bfcb484df610af091eee29bf29d2058a
parent 94157 cb4881f73296cb98880c545f7171d99781e22eee
child 94159 99152272ca3e0561b6f927c829bd036163710a2f
push idunknown
push userunknown
push dateunknown
reviewersjoe, jpr
bugs751668
milestone14.0a2
Bug 751668. Avoid incorrectly using EXTEND_NONE. r=joe,a=jpr It seems like we sometimes end up using EXTEND_NONE unintentionally, this is likely caused by different rounding between cairo and pixman. Pixman already does a similar reduction to EXTEND_NONE so there's not point in duplicating it here.
gfx/cairo/README
gfx/cairo/avoid-extend-none.patch
gfx/cairo/cairo/src/cairo-image-surface.c
--- a/gfx/cairo/README
+++ b/gfx/cairo/README
@@ -173,16 +173,18 @@ lround-c99-only.patch: Only use lround i
 unicode-printing.patch: Print as unicode (bug 454532)
 
 quartz-mark-dirty.patch: Add a quartz implementation of mark_dirty_rectangle (bug 715704)
 
 expose-snapshot.patch: Make functions to add snapshots public, as well as allow creating null surfaces publically. (bug 715658)
 
 fix-build-with-Werror=return-type.patch: Fix builds with -Werror=return-type (bug 737909)
 
+avoid-extend-none.patch: Avoid incorrectly using EXTEND_NONE (bug 751668)
+
 ==== pixman patches ====
 
 pixman-android-cpu-detect.patch: Add CPU detection support for Android, where we can't reliably access /proc/self/auxv.
 
 pixman-rename-and-endian.patch: include cairo-platform.h for renaming of external symbols and endian macros
 
 NOTE: we previously supported ARM assembler on MSVC, this has been removed because of the maintenance burden
 
new file mode 100644
--- /dev/null
+++ b/gfx/cairo/avoid-extend-none.patch
@@ -0,0 +1,39 @@
+changeset:   93076:25d0c8a38d7d
+tag:         none
+tag:         qbase
+tag:         qtip
+tag:         tip
+user:        Jeff Muizelaar <jmuizelaar@mozilla.com>
+date:        Thu May 03 15:21:52 2012 -0400
+summary:     Bug 751668. Avoid incorrectly using EXTEND_NONE. r=joe
+
+diff --git a/gfx/cairo/cairo/src/cairo-image-surface.c b/gfx/cairo/cairo/src/cairo-image-surface.c
+--- a/gfx/cairo/cairo/src/cairo-image-surface.c
++++ b/gfx/cairo/cairo/src/cairo-image-surface.c
+@@ -1390,25 +1390,16 @@ static pixman_image_t *
+ 	cairo_image_surface_t *source = (cairo_image_surface_t *) pattern->surface;
+ 	cairo_surface_type_t type;
+ 
+ 	if (source->base.backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT)
+ 	    source = (cairo_image_surface_t *) ((cairo_surface_snapshot_t *) pattern->surface)->target;
+ 
+ 	type = source->base.backend->type;
+ 	if (type == CAIRO_SURFACE_TYPE_IMAGE) {
+-	    if (extend != CAIRO_EXTEND_NONE &&
+-		sample.x >= 0 &&
+-		sample.y >= 0 &&
+-		sample.x + sample.width  <= source->width &&
+-		sample.y + sample.height <= source->height)
+-	    {
+-		extend = CAIRO_EXTEND_NONE;
+-	    }
+-
+ 	    if (sample.width == 1 && sample.height == 1) {
+ 		if (sample.x < 0 ||
+ 		    sample.y < 0 ||
+ 		    sample.x >= source->width ||
+ 		    sample.y >= source->height)
+ 		{
+ 		    if (extend == CAIRO_EXTEND_NONE)
+ 			return _pixman_transparent_image ();
+
--- a/gfx/cairo/cairo/src/cairo-image-surface.c
+++ b/gfx/cairo/cairo/src/cairo-image-surface.c
@@ -1390,25 +1390,16 @@ static pixman_image_t *
 	cairo_image_surface_t *source = (cairo_image_surface_t *) pattern->surface;
 	cairo_surface_type_t type;
 
 	if (source->base.backend->type == CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT)
 	    source = (cairo_image_surface_t *) ((cairo_surface_snapshot_t *) pattern->surface)->target;
 
 	type = source->base.backend->type;
 	if (type == CAIRO_SURFACE_TYPE_IMAGE) {
-	    if (extend != CAIRO_EXTEND_NONE &&
-		sample.x >= 0 &&
-		sample.y >= 0 &&
-		sample.x + sample.width  <= source->width &&
-		sample.y + sample.height <= source->height)
-	    {
-		extend = CAIRO_EXTEND_NONE;
-	    }
-
 	    if (sample.width == 1 && sample.height == 1) {
 		if (sample.x < 0 ||
 		    sample.y < 0 ||
 		    sample.x >= source->width ||
 		    sample.y >= source->height)
 		{
 		    if (extend == CAIRO_EXTEND_NONE)
 			return _pixman_transparent_image ();