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.

--HG--
extra : rebase_source : 5e01da7d845c1cd34f9e87d5c7de22dafe9df7a4
This commit is contained in:
Jeff Muizelaar 2011-08-19 11:26:23 -04:00
parent 62abd6bacc
commit 037d7d743d
3 changed files with 24 additions and 1 deletions

View File

@ -168,6 +168,7 @@ pixman-image-transform.patch: Reset the transform on pixman images when using th
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.

View File

@ -1802,7 +1802,7 @@ _cairo_image_surface_fixup_unbounded_boxes (cairo_image_surface_t *dst,
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);

View File

@ -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);