Bug 668921. cairo: Fix fixup_unbounded_boxes() to work even if the box is smaller than the extents. r=ickle
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Fri, 19 Aug 2011 11:26:23 -0400
changeset 73050 a5ba68d400dab6661feb071e1b12f8210001bfbd
parent 73049 2347184b3d963258e07f5eb17d1347344e39d046
child 73051 c133ee57ff479d19cc9a1d23a3b6f950635a4d8e
push id169
push userjmuizelaar@mozilla.com
push dateTue, 23 Aug 2011 22:40:45 +0000
treeherdermozilla-beta@a5ba68d400da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersickle
bugs668921
milestone7.0
Bug 668921. cairo: Fix fixup_unbounded_boxes() to work even if the box is smaller than the extents. r=ickle Currently fixup_unbounded_boxes assumes that the extents are tight when we only have one box. This is not always true. e.g. when we tesselate boxes we can end up with only one box which is smaller than the extents and the extents are not updated.
gfx/cairo/README
gfx/cairo/cairo/src/cairo-image-surface.c
gfx/cairo/fixup-unbounded.patch
--- a/gfx/cairo/README
+++ b/gfx/cairo/README
@@ -161,16 +161,17 @@ tee-surfaces-pointwise.patch: Composite 
 pattern_get_surface-no-error.patch: Don't put a pattern into error if cairo_pattern_get_surface fails
 
 missing-cairo-clip-init.diff: Missing cairo_clip_init call in cairo_gstate_show_text_glyphs lead to crash
 
 fix-cairo-win32-print-gdi-error.diff: Don't use fwprintf with char* format.  Flush stderr so that all error messages appears before exit.
 
 pixman-image-transform.patch: Reset the transform on pixman images when using them as destinations.
 
+fixup-unbounded.patch: Hack to work around bad assumption.
 ==== 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
 
--- a/gfx/cairo/cairo/src/cairo-image-surface.c
+++ b/gfx/cairo/cairo/src/cairo-image-surface.c
@@ -1797,17 +1797,17 @@ static cairo_status_t
 					    cairo_boxes_t *boxes)
 {
     cairo_boxes_t clear;
     cairo_box_t box;
     cairo_status_t status;
     struct _cairo_boxes_chunk *chunk;
     int i;
 
-    if (boxes->num_boxes <= 1 && clip_region == NULL)
+    if (boxes->num_boxes < 1 && clip_region == NULL)
 	return _cairo_image_surface_fixup_unbounded (dst, extents, NULL);
 
     _cairo_boxes_init (&clear);
 
     box.p1.x = _cairo_fixed_from_int (extents->unbounded.x + extents->unbounded.width);
     box.p1.y = _cairo_fixed_from_int (extents->unbounded.y);
     box.p2.x = _cairo_fixed_from_int (extents->unbounded.x);
     box.p2.y = _cairo_fixed_from_int (extents->unbounded.y + extents->unbounded.height);
new file mode 100644
--- /dev/null
+++ b/gfx/cairo/fixup-unbounded.patch
@@ -0,0 +1,22 @@
+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
+@@ -1797,17 +1797,17 @@ _cairo_image_surface_fixup_unbounded_box
+ 					    cairo_boxes_t *boxes)
+ {
+     cairo_boxes_t clear;
+     cairo_box_t box;
+     cairo_status_t status;
+     struct _cairo_boxes_chunk *chunk;
+     int i;
+ 
+-    if (boxes->num_boxes <= 1 && clip_region == NULL)
++    if (boxes->num_boxes < 1 && clip_region == NULL)
+ 	return _cairo_image_surface_fixup_unbounded (dst, extents, NULL);
+ 
+     _cairo_boxes_init (&clear);
+ 
+     box.p1.x = _cairo_fixed_from_int (extents->unbounded.x + extents->unbounded.width);
+     box.p1.y = _cairo_fixed_from_int (extents->unbounded.y);
+     box.p2.x = _cairo_fixed_from_int (extents->unbounded.x);
+     box.p2.y = _cairo_fixed_from_int (extents->unbounded.y + extents->unbounded.height);