From ea3d877b99c32e3a9e00ab220440d4518430e5bc Mon Sep 17 00:00:00 2001 From: root Date: Mon, 16 Apr 2012 00:01:18 +0000 Subject: Mon Apr 16 00:01:18 UTC 2012 --- testing/cairo/git_fixes.patch | 512 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 512 insertions(+) (limited to 'testing/cairo/git_fixes.patch') diff --git a/testing/cairo/git_fixes.patch b/testing/cairo/git_fixes.patch index 84ee0ba17..6ad8979eb 100644 --- a/testing/cairo/git_fixes.patch +++ b/testing/cairo/git_fixes.patch @@ -572,3 +572,515 @@ index 27ba004..5b3e177 100644 cairo_box_t box; -- cgit v0.9.0.2-2-gbebe +From 6f28f0b33cb12f3b2dd48c87da0018bd00c17107 Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Sun, 08 Apr 2012 10:28:59 +0000 +Subject: stroke: Fix misuse of half_line_x for vertical caps on dashes + +A typo using half_line_x instead of half_line_y when emitting dashed +segments of the rectilinear stroke. + +Signed-off-by: Chris Wilson +--- +diff --git a/src/cairo-path-stroke-boxes.c b/src/cairo-path-stroke-boxes.c +index 3e8c5a4..cc9dd19 100644 +--- a/src/cairo-path-stroke-boxes.c ++++ b/src/cairo-path-stroke-boxes.c +@@ -342,15 +342,15 @@ _cairo_rectilinear_stroker_emit_segments_dashed (cairo_rectilinear_stroker_t *st + box.p1.x = box.p2.x - half_line_x; + } + if (out_slope.dy >= 0) +- box.p1.y -= half_line_x; ++ box.p1.y -= half_line_y; + if (out_slope.dy <= 0) +- box.p2.y += half_line_x; ++ box.p2.y += half_line_y; + } else { + if (box.p1.y <= box.p2.y) { + box.p1.y = box.p2.y; +- box.p2.y += half_line_x; ++ box.p2.y += half_line_y; + } else { +- box.p1.y = box.p2.y - half_line_x; ++ box.p1.y = box.p2.y - half_line_y; + } + if (out_slope.dx >= 0) + box.p1.x -= half_line_x; +-- +cgit v0.9.0.2-2-gbebe +From 113ec6bf0c8ed1ff12293d1ed2a2de9bd5b9904b Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Sun, 08 Apr 2012 16:58:13 +0000 +Subject: traps: Clip the trapezoid extents against the clip extents + +Just in case the clip polygon turns out to be much larger than the +operation extents (silly us for not reducing it correctly) and lead to +catastrophe, such as: + +Program received signal SIGSEGV, Segmentation fault. +pixman_fill_sse2 (bits=, stride=4, bpp=8, x=0, y=0, +width=3, height=-34811, data=0) at pixman-sse2.c:3369 +3369 *(uint16_t *)d = data; + +Signed-off-by: Chris Wilson +--- +diff --git a/src/cairo-traps-compositor.c b/src/cairo-traps-compositor.c +index 284a0be..c49e208 100644 +--- a/src/cairo-traps-compositor.c ++++ b/src/cairo-traps-compositor.c +@@ -218,8 +218,13 @@ combine_clip_as_traps (const cairo_traps_compositor_t *compositor, + _cairo_traps_fini (&traps); + cairo_surface_destroy (src); + +- if (status == CAIRO_INT_STATUS_SUCCESS && +- (fixup.width < extents->width || fixup.height < extents->height)) { ++ if (unlikely (status)) ++ return status; ++ ++ if (! _cairo_rectangle_intersect (&fixup, extents)) ++ return CAIRO_STATUS_SUCCESS; ++ ++ if (fixup.width < extents->width || fixup.height < extents->height) { + cairo_boxes_t clear; + + _cairo_boxes_init (&clear); +-- +cgit v0.9.0.2-2-gbebe +From de61681574eb7d6e0e497ea7f25797e3d9b20ac4 Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Mon, 09 Apr 2012 11:47:34 +0000 +Subject: build: Disable -Wset-but-unused-variable + +This is too noisy in the current build, and masking more important +warnings. + +Signed-off-by: Chris Wilson +--- +diff --git a/build/configure.ac.warnings b/build/configure.ac.warnings +index 3eb0104..f1b17f4 100644 +--- a/build/configure.ac.warnings ++++ b/build/configure.ac.warnings +@@ -21,6 +21,9 @@ MAYBE_WARN="-Wall -Wextra \ + -Wno-missing-field-initializers -Wno-unused-parameter \ + -Wno-attributes -Wno-long-long -Winline" + ++# -Wunused-but-set-variable is too noisy at present ++NO_WARN="-Wno-unused-but-set-variable" ++ + dnl Sun Studio 12 likes to rag at us for abusing enums like + dnl having cairo_status_t variables hold cairo_int_status_t + dnl values. It's bad, we know. Now please be quiet. +@@ -34,6 +37,8 @@ MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common -flto" + dnl Also to turn various gcc/glibc-specific preprocessor checks + MAYBE_WARN="$MAYBE_WARN -Wp,-D_FORTIFY_SOURCE=2" + ++MAYBE_WARN="$MAYBE_WARN $NO_WARN" ++ + # invalidate cached value if MAYBE_WARN has changed + if test "x$cairo_cv_warn_maybe" != "x$MAYBE_WARN"; then + unset cairo_cv_warn_cflags +-- +cgit v0.9.0.2-2-gbebe +From 7cb5053c0694992320b5f7ea3b91ea497431813b Mon Sep 17 00:00:00 2001 +From: Chris Wilson +Date: Mon, 09 Apr 2012 11:49:20 +0000 +Subject: analysis: Apply the integer translation to the bbox as well + +The bbox is used to compute the ink extents (and so the pattern extents +of a recording surface) and if given an integer translation we failed to +transform the bbox into the target space. + +Fixes mask (pdf). + +Signed-off-by: Chris Wilson +--- +diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c +index b8abe02..8878f62 100644 +--- a/src/cairo-analysis-surface.c ++++ b/src/cairo-analysis-surface.c +@@ -220,6 +220,14 @@ _add_operation (cairo_analysis_surface_t *surface, + if (_cairo_matrix_is_integer_translation (&surface->ctm, &tx, &ty)) { + rect->x += tx; + rect->y += ty; ++ ++ tx = _cairo_fixed_from_int (tx); ++ bbox.p1.x += tx; ++ bbox.p2.x += tx; ++ ++ ty = _cairo_fixed_from_int (ty); ++ bbox.p1.y += ty; ++ bbox.p2.y += ty; + } else { + _cairo_matrix_transform_bounding_box_fixed (&surface->ctm, + &bbox, NULL); +-- +cgit v0.9.0.2-2-gbebe +From 038e4991912656a3239ca82d60056ca129016ba6 Mon Sep 17 00:00:00 2001 +From: Adrian Johnson +Date: Mon, 09 Apr 2012 08:31:44 +0000 +Subject: pdf: avoid unnecessary use of patterns in mask groups + +--- +diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c +index 4930e72..78537ce 100644 +--- a/src/cairo-pdf-surface.c ++++ b/src/cairo-pdf-surface.c +@@ -5703,56 +5703,68 @@ _cairo_pdf_surface_write_mask_group (cairo_pdf_surface_t *surface, + if (unlikely (status)) + return status; + +- pattern_res.id = 0; +- gstate_res.id = 0; +- status = _cairo_pdf_surface_add_pdf_pattern (surface, group->mask, NULL, +- &pattern_res, &gstate_res); +- if (unlikely (status)) +- return status; +- +- if (gstate_res.id != 0) { +- smask_group = _cairo_pdf_surface_create_smask_group (surface, &group->extents); +- if (unlikely (smask_group == NULL)) +- return _cairo_error (CAIRO_STATUS_NO_MEMORY); +- +- smask_group->width = group->width; +- smask_group->height = group->height; +- smask_group->operation = PDF_PAINT; +- smask_group->source = cairo_pattern_reference (group->mask); +- smask_group->source_res = pattern_res; +- status = _cairo_pdf_surface_add_smask_group (surface, smask_group); +- if (unlikely (status)) { +- _cairo_pdf_smask_group_destroy (smask_group); +- return status; +- } +- +- status = _cairo_pdf_surface_add_smask (surface, gstate_res); +- if (unlikely (status)) +- return status; +- +- status = _cairo_pdf_surface_add_xobject (surface, smask_group->group_res); ++ if (_can_paint_pattern (group->mask)) { ++ _cairo_output_stream_printf (surface->output, "q\n"); ++ status = _cairo_pdf_surface_paint_pattern (surface, ++ group->mask, ++ &group->extents, ++ FALSE); + if (unlikely (status)) + return status; + +- _cairo_output_stream_printf (surface->output, +- "q /s%d gs /x%d Do Q\n", +- gstate_res.id, +- smask_group->group_res.id); ++ _cairo_output_stream_printf (surface->output, "Q\n"); + } else { +- status = _cairo_pdf_surface_select_pattern (surface, group->mask, pattern_res, FALSE); ++ pattern_res.id = 0; ++ gstate_res.id = 0; ++ status = _cairo_pdf_surface_add_pdf_pattern (surface, group->mask, NULL, ++ &pattern_res, &gstate_res); + if (unlikely (status)) + return status; + +- _cairo_output_stream_printf (surface->output, +- "%f %f %f %f re f\n", +- bbox.p1.x, +- bbox.p1.y, +- bbox.p2.x - bbox.p1.x, +- bbox.p2.y - bbox.p1.y); ++ if (gstate_res.id != 0) { ++ smask_group = _cairo_pdf_surface_create_smask_group (surface, &group->extents); ++ if (unlikely (smask_group == NULL)) ++ return _cairo_error (CAIRO_STATUS_NO_MEMORY); + +- status = _cairo_pdf_surface_unselect_pattern (surface); +- if (unlikely (status)) +- return status; ++ smask_group->width = group->width; ++ smask_group->height = group->height; ++ smask_group->operation = PDF_PAINT; ++ smask_group->source = cairo_pattern_reference (group->mask); ++ smask_group->source_res = pattern_res; ++ status = _cairo_pdf_surface_add_smask_group (surface, smask_group); ++ if (unlikely (status)) { ++ _cairo_pdf_smask_group_destroy (smask_group); ++ return status; ++ } ++ ++ status = _cairo_pdf_surface_add_smask (surface, gstate_res); ++ if (unlikely (status)) ++ return status; ++ ++ status = _cairo_pdf_surface_add_xobject (surface, smask_group->group_res); ++ if (unlikely (status)) ++ return status; ++ ++ _cairo_output_stream_printf (surface->output, ++ "q /s%d gs /x%d Do Q\n", ++ gstate_res.id, ++ smask_group->group_res.id); ++ } else { ++ status = _cairo_pdf_surface_select_pattern (surface, group->mask, pattern_res, FALSE); ++ if (unlikely (status)) ++ return status; ++ ++ _cairo_output_stream_printf (surface->output, ++ "%f %f %f %f re f\n", ++ bbox.p1.x, ++ bbox.p1.y, ++ bbox.p2.x - bbox.p1.x, ++ bbox.p2.y - bbox.p1.y); ++ ++ status = _cairo_pdf_surface_unselect_pattern (surface); ++ if (unlikely (status)) ++ return status; ++ } + } + + status = _cairo_pdf_surface_close_group (surface, &mask_group); +@@ -5764,54 +5776,66 @@ _cairo_pdf_surface_write_mask_group (cairo_pdf_surface_t *surface, + if (unlikely (status)) + return status; + +- pattern_res.id = 0; +- gstate_res.id = 0; +- status = _cairo_pdf_surface_add_pdf_pattern (surface, group->source, NULL, +- &pattern_res, &gstate_res); +- if (unlikely (status)) +- return status; +- +- if (gstate_res.id != 0) { +- smask_group = _cairo_pdf_surface_create_smask_group (surface, &group->extents); +- if (unlikely (smask_group == NULL)) +- return _cairo_error (CAIRO_STATUS_NO_MEMORY); +- +- smask_group->operation = PDF_PAINT; +- smask_group->source = cairo_pattern_reference (group->source); +- smask_group->source_res = pattern_res; +- status = _cairo_pdf_surface_add_smask_group (surface, smask_group); +- if (unlikely (status)) { +- _cairo_pdf_smask_group_destroy (smask_group); +- return status; +- } +- +- status = _cairo_pdf_surface_add_smask (surface, gstate_res); +- if (unlikely (status)) +- return status; +- +- status = _cairo_pdf_surface_add_xobject (surface, smask_group->group_res); ++ if (_can_paint_pattern (group->source)) { ++ _cairo_output_stream_printf (surface->output, "q\n"); ++ status = _cairo_pdf_surface_paint_pattern (surface, ++ group->source, ++ &group->extents, ++ FALSE); + if (unlikely (status)) + return status; + +- _cairo_output_stream_printf (surface->output, +- "q /s%d gs /x%d Do Q\n", +- gstate_res.id, +- smask_group->group_res.id); ++ _cairo_output_stream_printf (surface->output, "Q\n"); + } else { +- status = _cairo_pdf_surface_select_pattern (surface, group->source, pattern_res, FALSE); ++ pattern_res.id = 0; ++ gstate_res.id = 0; ++ status = _cairo_pdf_surface_add_pdf_pattern (surface, group->source, NULL, ++ &pattern_res, &gstate_res); + if (unlikely (status)) + return status; + +- _cairo_output_stream_printf (surface->output, +- "%f %f %f %f re f\n", +- bbox.p1.x, +- bbox.p1.y, +- bbox.p2.x - bbox.p1.x, +- bbox.p2.y - bbox.p1.y); ++ if (gstate_res.id != 0) { ++ smask_group = _cairo_pdf_surface_create_smask_group (surface, &group->extents); ++ if (unlikely (smask_group == NULL)) ++ return _cairo_error (CAIRO_STATUS_NO_MEMORY); + +- status = _cairo_pdf_surface_unselect_pattern (surface); +- if (unlikely (status)) +- return status; ++ smask_group->operation = PDF_PAINT; ++ smask_group->source = cairo_pattern_reference (group->source); ++ smask_group->source_res = pattern_res; ++ status = _cairo_pdf_surface_add_smask_group (surface, smask_group); ++ if (unlikely (status)) { ++ _cairo_pdf_smask_group_destroy (smask_group); ++ return status; ++ } ++ ++ status = _cairo_pdf_surface_add_smask (surface, gstate_res); ++ if (unlikely (status)) ++ return status; ++ ++ status = _cairo_pdf_surface_add_xobject (surface, smask_group->group_res); ++ if (unlikely (status)) ++ return status; ++ ++ _cairo_output_stream_printf (surface->output, ++ "q /s%d gs /x%d Do Q\n", ++ gstate_res.id, ++ smask_group->group_res.id); ++ } else { ++ status = _cairo_pdf_surface_select_pattern (surface, group->source, pattern_res, FALSE); ++ if (unlikely (status)) ++ return status; ++ ++ _cairo_output_stream_printf (surface->output, ++ "%f %f %f %f re f\n", ++ bbox.p1.x, ++ bbox.p1.y, ++ bbox.p2.x - bbox.p1.x, ++ bbox.p2.y - bbox.p1.y); ++ ++ status = _cairo_pdf_surface_unselect_pattern (surface); ++ if (unlikely (status)) ++ return status; ++ } + } + + status = _cairo_pdf_surface_close_group (surface, NULL); +-- +cgit v0.9.0.2-2-gbebe +From 9fcbe25c2dcf831783bb0fd20af9754c0b5c409b Mon Sep 17 00:00:00 2001 +From: Maarten Bosmans +Date: Mon, 09 Apr 2012 19:33:50 +0000 +Subject: Protect code using dlfcn.h with CAIRO_HAS_DLSYM + +--- +diff --git a/configure.ac b/configure.ac +index cedfebe..5d2e6ec 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -52,6 +52,7 @@ AM_CONDITIONAL(CAIRO_HAS_DL, test "x$have_dl" = "xyes") + if test "x$have_dlsym" = "xyes"; then + AC_DEFINE([CAIRO_HAS_DLSYM], 1, [Define to 1 if dlsym is available]) + fi ++AM_CONDITIONAL(CAIRO_HAS_DLSYM, test "x$have_dlsym" = "xyes") + + dnl =========================================================================== + +diff --git a/util/Makefile.am b/util/Makefile.am +index f202f35..82d0a80 100644 +--- a/util/Makefile.am ++++ b/util/Makefile.am +@@ -12,20 +12,24 @@ endif + + if CAIRO_HAS_TRACE + SUBDIRS += cairo-trace ++if CAIRO_HAS_DLSYM + if CAIRO_HAS_SCRIPT_SURFACE + if CAIRO_HAS_TEE_SURFACE + SUBDIRS += cairo-fdr + endif + endif + endif ++endif + + if BUILD_SPHINX ++if CAIRO_HAS_DLSYM + if CAIRO_HAS_SCRIPT_SURFACE + if CAIRO_HAS_TEE_SURFACE + SUBDIRS += cairo-sphinx + endif + endif + endif ++endif + + AM_CPPFLAGS = -I$(top_srcdir)/src \ + -I$(top_builddir)/src \ +-- +cgit v0.9.0.2-2-gbebe +From c7b86ab97be1d3d3ccf43b652832f148a2fcf290 Mon Sep 17 00:00:00 2001 +From: Adrian Johnson +Date: Tue, 10 Apr 2012 13:04:05 +0000 +Subject: any2ppm: fix missing enumeration warning + +--- +diff --git a/test/any2ppm.c b/test/any2ppm.c +index 6b61c47..2403347 100644 +--- a/test/any2ppm.c ++++ b/test/any2ppm.c +@@ -193,6 +193,7 @@ write_ppm (cairo_surface_t *surface, int fd) + break; + case CAIRO_FORMAT_A1: + case CAIRO_FORMAT_RGB16_565: ++ case CAIRO_FORMAT_RGB30: + case CAIRO_FORMAT_INVALID: + default: + return "unhandled image format"; +-- +cgit v0.9.0.2-2-gbebe +From 09de481ce5f6ed1c38c0d5bf3af7c60642c4c947 Mon Sep 17 00:00:00 2001 +From: Gilles Espinasse +Date: Sat, 07 Apr 2012 21:09:51 +0000 +Subject: Cosmetic configure fix + +'how to allow undefined symbols in shared libraries' test should use CAIRO_CC_TRY_FLAG_SILENT or configure display is a bit out of order like this + +checking how to allow undefined symbols in shared libraries used by test suite... checking whether gcc supports -Wl,--allow-shlib-undefined... yes +-Wl,--allow-shlib-undefined + +Signed-off-by: Gilles Espinasse +Signed-off-by: Uli Schlachter +--- +diff --git a/build/configure.ac.warnings b/build/configure.ac.warnings +index f1b17f4..3b2c6f3 100644 +--- a/build/configure.ac.warnings ++++ b/build/configure.ac.warnings +@@ -89,7 +89,7 @@ AC_DEFINE_UNQUOTED([WARN_UNUSED_RESULT], [$cairo_cv_warn_unused_result], + + dnl check linker flags + AC_CACHE_CHECK([how to allow undefined symbols in shared libraries used by test suite], cairo_cv_test_undefined_ldflags, +- [CAIRO_CC_TRY_FLAG([-Wl,--allow-shlib-undefined], [], ++ [CAIRO_CC_TRY_FLAG_SILENT([-Wl,--allow-shlib-undefined], [], + [cairo_cv_test_undefined_ldflags="-Wl,--allow-shlib-undefined]")]) + CAIRO_TEST_UNDEFINED_LDFLAGS="$cairo_cv_test_undefined_ldflags" + AC_SUBST(CAIRO_TEST_UNDEFINED_LDFLAGS) +-- +cgit v0.9.0.2-2-gbebe +From 07fc63676dfdaa57ed919ad7be8f59c97c615473 Mon Sep 17 00:00:00 2001 +From: Uli Schlachter +Date: Wed, 11 Apr 2012 19:37:55 +0000 +Subject: xlib: Disable fallback compositor with xlib-xcb + +When xlib-xcb is enabled, this is just dead code which is never used. Thus, this +shouldn't hurt. However, this does include cairo-xlib-private.h. Shouldn't be a +problem? Well, that header contains static inline functions which some compiler +on Solaris will emit even when they are unused. + +This brings us to the real problem: That static inline function refers to a +function which isn't compiled with xlib-xcb and thus linking fails with +undefined symbols. + +This can be reproduced with GCC by adding a call to +_cairo_xlib_screen_put_gc(NULL, NULL, 0, 0); to +_cairo_xlib_fallback_compositor_get. + +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48489 +Signed-off-by: Uli Schlachter +--- +diff --git a/src/cairo-xlib-fallback-compositor.c b/src/cairo-xlib-fallback-compositor.c +index 5391926..7d45cd1 100644 +--- a/src/cairo-xlib-fallback-compositor.c ++++ b/src/cairo-xlib-fallback-compositor.c +@@ -42,6 +42,8 @@ + + #include "cairoint.h" + ++#if !CAIRO_HAS_XLIB_XCB_FUNCTIONS ++ + #include "cairo-xlib-private.h" + + #include "cairo-compositor-private.h" +@@ -52,3 +54,5 @@ _cairo_xlib_fallback_compositor_get (void) + /* XXX Do something interesting here to mitigate fallbacks ala xcb */ + return &_cairo_fallback_compositor; + } ++ ++#endif /* !CAIRO_HAS_XLIB_XCB_FUNCTIONS */ +-- +cgit v0.9.0.2-2-gbebe -- cgit v1.2.3-54-g00ecf