b=383960, Upgrade cairo to 1.4.8, r=me -- moz cairo: avoid-region-extract.patch

This commit is contained in:
vladimir@pobox.com 2007-06-10 17:08:00 -07:00
Родитель 075cba9086
Коммит 7b197694a9
3 изменённых файлов: 27 добавлений и 0 удалений

Просмотреть файл

@ -32,3 +32,8 @@ win32-no-printer-bitblt.patch: If we need to BitBlt from a DC (to do
fallback), only bother trying if the IS_DISPLAY flag is set -- many
printers lie about their support for BitBlt, and we end up getting
black instead of what we want.
avoid-region-extract.patch: Bail from _cairo_traps_extract_region early
if we have over 200 traps (arbitrary); this avoids an O(N*N) perf hit
when the region is built up, because we call union_rect with each rect
individually instead of building the region up in one go.

Просмотреть файл

@ -0,0 +1,16 @@
diff -r 0e7cd985a7f0 gfx/cairo/cairo/src/cairo-traps.c
--- a/gfx/cairo/cairo/src/cairo-traps.c Fri Jun 08 18:09:53 2007 -0700
+++ b/gfx/cairo/cairo/src/cairo-traps.c Fri Jun 08 18:10:48 2007 -0700
@@ -599,6 +599,12 @@ _cairo_traps_extract_region (cairo_traps
{
int i;
+ /* Bail early if we have lots of traps, until we fix the code
+ * below to not use Union()
+ */
+ if (traps->num_traps > 200)
+ return CAIRO_INT_STATUS_UNSUPPORTED;
+
for (i = 0; i < traps->num_traps; i++)
if (!(traps->traps[i].left.p1.x == traps->traps[i].left.p2.x
&& traps->traps[i].right.p1.x == traps->traps[i].right.p2.x

Просмотреть файл

@ -599,6 +599,12 @@ _cairo_traps_extract_region (cairo_traps_t *traps,
{
int i;
/* Bail early if we have lots of traps, until we fix the code
* below to not use Union()
*/
if (traps->num_traps > 200)
return CAIRO_INT_STATUS_UNSUPPORTED;
for (i = 0; i < traps->num_traps; i++)
if (!(traps->traps[i].left.p1.x == traps->traps[i].left.p2.x
&& traps->traps[i].right.p1.x == traps->traps[i].right.p2.x