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 75577 427f162c761c195d919f3a593c82bea0e4851ccf
parent 75576 bd9dd7e4c7ff976e31ddbd14be211219573aa2a8
child 75578 77704e4f395bc71b92bb0cc4a1a45e42d208e9ee
push id21040
push userbmo@edmorley.co.uk
push dateSun, 21 Aug 2011 18:16:59 +0000
treeherdermozilla-central@482742e6fff7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersickle
bugs668921
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
@@ -163,16 +163,17 @@ pattern_get_surface-no-error.patch: Don'
 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.
 
 fix-cairo-surface-wrapper-flush-build-warning.patch: Ensures that _cairo_surface_wrapper_flush always returns a status, to silence the build warning
 
+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);