add patched cairo

This commit is contained in:
Mario Fetka
2013-10-31 04:36:15 +01:00
parent 8751dafd50
commit 3d57eb3cd6
16 changed files with 2059 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
http://repos.archlinux.org/wsvn/packages/cairo/trunk/cairo-1.10.0-buggy_gradients.patch
http://bugs.gentoo.org/336696
--- src/cairo-xlib-display.c
+++ src/cairo-xlib-display.c
@@ -353,11 +353,7 @@
/* Prior to Render 0.10, there is no protocol support for gradients and
* we call function stubs instead, which would silently consume the drawing.
*/
-#if RENDER_MAJOR == 0 && RENDER_MINOR < 10
display->buggy_gradients = TRUE;
-#else
- display->buggy_gradients = FALSE;
-#endif
display->buggy_pad_reflect = FALSE;
display->buggy_repeat = FALSE;

View File

@@ -0,0 +1,38 @@
Index: cairo/src/Makefile.am
===================================================================
--- cairo.orig/src/Makefile.am 2011-02-08 10:11:46.879538772 +0100
+++ cairo/src/Makefile.am 2011-02-08 10:12:36.381915666 +0100
@@ -46,7 +46,7 @@
$(enabled_cairo_private) \
$(enabled_cairo_sources) \
$(NULL)
-libcairo_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols)
+libcairo_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols) -export-symbols-regex \^cairo_.*
libcairo_la_LIBADD = $(CAIRO_LIBS) \
$(cairo_cxx_lib)
libcairo_la_DEPENDENCIES = $(cairo_def_dependency) $(cairo_cxx_lib)
diff --git a/util/cairo-gobject/Makefile.am b/util/cairo-gobject/Makefile.am
index 22c1a27..5a15950 100644
--- a/util/cairo-gobject/Makefile.am
+++ b/util/cairo-gobject/Makefile.am
@@ -10,6 +10,6 @@ libcairo_gobject_la_SOURCES = \
$(NULL)
libcairo_gobject_la_CFLAGS = $(CAIRO_CFLAGS) $(GOBJECT_CFLAGS)
-libcairo_gobject_la_LDFLAGS = -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols)
+libcairo_gobject_la_LDFLAGS = -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols) -export-symbols-regex \^cairo_.*
libcairo_gobject_la_LIBADD = $(top_builddir)/src/libcairo.la $(CAIRO_LIBS) $(GOBJECT_LIBS)
diff --git a/util/cairo-script/Makefile.am b/util/cairo-script/Makefile.am
index d7e4427..8d4181b 100644
--- a/util/cairo-script/Makefile.am
+++ b/util/cairo-script/Makefile.am
@@ -18,7 +18,7 @@ libcairo_script_interpreter_la_SOURCES = \
cairo-script-stack.c \
$(NULL)
libcairo_script_interpreter_la_CFLAGS = $(CAIRO_CFLAGS)
-libcairo_script_interpreter_la_LDFLAGS = -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols)
+libcairo_script_interpreter_la_LDFLAGS = -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols) -export-symbols-regex \^cairo_.*
libcairo_script_interpreter_la_LIBADD = $(top_builddir)/src/libcairo.la $(CAIRO_LIBS) -lz
csi_replay_SOURCES = csi-replay.c

View File

@@ -0,0 +1,36 @@
commit 95f6f7a174ca096a3d3dbe84ff220d166d1e2baa
Author: Uli Schlachter <psychon@znc.in>
Date: Fri Oct 22 11:54:57 2010 +0200
Make both versions of _cairo_lround consistent again
Commit c0008242b0f made cairo use libm's lround instead of its own _cairo_lround
by default. However, since commit ce58f874 from 2006, _cairo_lround does
arithmetic rounding instead of away-from-zero rounding (before said commit, it
was using baker's rounding).
So to make the rounding of _cairo_lround be independent from
DISABLE_SOME_FLOATING_POINT, we have to use another function. Turns out that
_cairo_round already does the same thing that _cairo_lround does. Their only
difference is the return type.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/src/cairoint.h b/src/cairoint.h
index 53c87e5..539d92e 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -968,7 +968,11 @@ _cairo_round (double r)
cairo_private int
_cairo_lround (double d) cairo_const;
#else
-#define _cairo_lround lround
+static inline int cairo_const
+_cairo_lround (double r)
+{
+ return _cairo_round (r);
+}
#endif
cairo_private uint16_t

View File

@@ -0,0 +1,55 @@
diff -ruN cairo-1.10.2-0-vanilla/src/cairo-qt-surface.cpp cairo-1.10.2/src/cairo-qt-surface.cpp
--- cairo-1.10.2-0-vanilla/src/cairo-qt-surface.cpp 2010-12-25 15:21:34.000000000 +0100
+++ cairo-1.10.2/src/cairo-qt-surface.cpp 2011-12-20 22:59:30.000000000 +0100
@@ -61,7 +61,9 @@
#include <QtGui/QX11Info>
#include <QtCore/QVarLengthArray>
-#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) || defined(QT_GLYPHS_API_BACKPORT)
+#if (QT_VERSION >= QT_VERSION_CHECK(4, 8, 0))
+#include <QtGui/QGlyphRun>
+#elif (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) || defined(QT_GLYPHS_API_BACKPORT)
extern void qt_draw_glyphs(QPainter *, const quint32 *glyphs, const QPointF *positions, int count);
#endif
@@ -1370,7 +1372,39 @@
cairo_clip_t *clip,
int *remaining_glyphs)
{
-#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) || defined(QT_GLYPHS_API_BACKPORT)
+#if (QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && !defined(QT_NO_RAWFONT)
+ cairo_qt_surface_t *qs = (cairo_qt_surface_t *) abstract_surface;
+
+ // pick out the colour to use from the cairo source
+ cairo_solid_pattern_t *solid = (cairo_solid_pattern_t*) source;
+ // documentation says you have to freeze the cache, but I don't believe it
+ _cairo_scaled_font_freeze_cache(scaled_font);
+
+ QColor tempColour(solid->color.red * 255, solid->color.green * 255, solid->color.blue * 255);
+ QVector<QPointF> positions(num_glyphs);
+ QVector<unsigned int> glyphss(num_glyphs);
+ FT_Face face = cairo_ft_scaled_font_lock_face (scaled_font);
+ const FT_Size_Metrics& ftMetrics = face->size->metrics;
+ QFont font(face->family_name);
+ font.setStyleStrategy(QFont::NoFontMerging);
+ font.setBold(face->style_flags & FT_STYLE_FLAG_BOLD);
+ font.setItalic(face->style_flags & FT_STYLE_FLAG_ITALIC);
+ font.setKerning(face->face_flags & FT_FACE_FLAG_KERNING);
+ font.setPixelSize(ftMetrics.y_ppem);
+ cairo_ft_scaled_font_unlock_face(scaled_font);
+ qs->p->setFont(font);
+ qs->p->setPen(tempColour);
+ for (int currentGlyph = 0; currentGlyph < num_glyphs; currentGlyph++) {
+ positions.append(QPointF(glyphs[currentGlyph].x, glyphs[currentGlyph].y));
+ glyphss.append(glyphs[currentGlyph].index);
+ }
+ QGlyphRun qglyphs;
+ qglyphs.setGlyphIndexes(glyphss);
+ qglyphs.setPositions(positions);
+ qs->p->drawGlyphRun(QPointF(), qglyphs);
+ _cairo_scaled_font_thaw_cache(scaled_font);
+ return CAIRO_INT_STATUS_SUCCESS;
+#elif (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) || defined(QT_GLYPHS_API_BACKPORT)
cairo_qt_surface_t *qs = (cairo_qt_surface_t *) abstract_surface;
// pick out the colour to use from the cairo source

View File

@@ -0,0 +1,53 @@
--- cairo.orig/build/configure.ac.features 2010-12-28 14:41:21.487225155 +0100
+++ cairo/build/configure.ac.features 2010-12-28 14:42:06.166239606 +0100
@@ -407,6 +407,7 @@
echo "The following features and utilities:"
echo " cairo-trace: $use_trace"
echo " cairo-script-interpreter: $use_interpreter"
+ echo " cairo-perf-utils: $use_perf_utils"
echo ""
echo "And the following internal features:"
echo " pthread: $use_pthread"
--- cairo.orig/configure.ac 2010-12-28 14:43:02.291226995 +0100
+++ cairo/configure.ac 2010-12-28 14:43:18.191141863 +0100
@@ -10,6 +10,7 @@
AC_CONFIG_SRCDIR(src/cairo.h)
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE([1.9.6 gnu -Wall no-define])
+AM_MAINTAINER_MODE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_LIBTOOL_WIN32_DLL dnl Must be called before AC_PROG_LIBTOOL
AC_PROG_LIBTOOL dnl ([1.4]) Don't remove!
@@ -796,6 +796,11 @@
PKG_CHECK_MODULES(gtk, "gtk+-2.0",have_gtk=yes, have_gtk=no)
AM_CONDITIONAL(HAVE_GTK, test "x$have_gtk" = "xyes")
+dnl ===========================================================================
+
+CAIRO_ENABLE(perf_utils, cairo-perf-utils, no, [use_perf_utils=yes])
+
+
AC_CONFIG_FILES([
Makefile
boilerplate/Makefile
--- cairo.orig/perf/Makefile.am 2010-06-18 13:47:11.000000000 +0200
+++ cairo/perf/Makefile.am 2010-12-28 14:42:06.162226875 +0100
@@ -10,6 +10,18 @@
AM_LDFLAGS = $(CAIRO_LDFLAGS)
+if CAIRO_HAS_PERF_UTILS
+bin_PROGRAMS = cairo-perf-micro \
+ cairo-perf-trace \
+ cairo-perf-diff-files \
+ cairo-perf-print \
+ cairo-perf-chart \
+ cairo-perf-compare-backends
+if HAVE_GTK
+bin_PROGRAMS += cairo-perf-graph-files
+endif
+endif
+
EXTRA_PROGRAMS += cairo-perf-micro \
cairo-perf-trace \
cairo-perf-diff-files \

View File

@@ -0,0 +1,90 @@
From fa4f48cccb6c7f4e1afb2ff4b98b906b7d8d4afc Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris@chris-wilson.co.uk>
Date: Wed, 23 Jan 2013 15:04:26 +0000
Subject: xlib: Do not upload the whole image just because we want an entire row
Fixes regression exposed by
commit a73e7ff0186176bc82cd3ae1432c054c1fd3aebd
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sun Jan 6 11:29:27 2013 +0000
xlib: Simplify source creation by use of map-to-image
but ultimately from
commit 74941f822015cc50cd8477d0cf97f1a70dbff60b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Wed Jan 2 22:27:55 2013 +0000
xlib: Use SHM transport for ordinary image uploads
Reported-by: Gökçen Eraslan <gokcen.eraslan@gmail.com>
Reported-by: Guillaume Ayoub <guillaume.ayoub@kozea.fr>
Reported-by: Emmanuel Benisty <benisty.e@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59635
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
diff --git a/src/cairo-xlib-source.c b/src/cairo-xlib-source.c
index 24290f7..ca55278 100644
--- a/src/cairo-xlib-source.c
+++ b/src/cairo-xlib-source.c
@@ -1035,7 +1035,13 @@ surface_source (cairo_xlib_surface_t *dst,
status = _cairo_surface_unmap_image (&xsrc->base, image);
if (unlikely (status)) {
- cairo_surface_destroy (src);
+ cairo_surface_destroy (&xsrc->base);
+ return _cairo_surface_create_in_error (status);
+ }
+
+ status = _cairo_xlib_surface_put_shm (xsrc);
+ if (unlikely (status)) {
+ cairo_surface_destroy (&xsrc->base);
return _cairo_surface_create_in_error (status);
}
}
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index dbc677e..ee69b66 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -1139,26 +1139,24 @@ _cairo_xlib_surface_draw_image (cairo_xlib_surface_t *surface,
max_request_size = XMaxRequestSize (display->display);
if (max_request_size > 8192)
max_request_size = 8192;
- if (image->stride * image->height > max_request_size) {
+ if (width * height * 4 > max_request_size) {
shm_image = _cairo_xlib_surface_create_shm__image (surface,
image->pixman_format,
- image->width,
- image->height);
+ width, height);
if (shm_image && shm_image->status == CAIRO_STATUS_SUCCESS) {
cairo_image_surface_t *clone = (cairo_image_surface_t *) shm_image;
- if (clone->stride == image->stride) {
- memcpy (clone->data, image->data, clone->stride * clone->height);
- } else {
- pixman_image_composite32 (PIXMAN_OP_SRC,
- image->pixman_image, NULL, clone->pixman_image,
- 0, 0,
- 0, 0,
- 0, 0,
- image->width, image->height);
- }
+ pixman_image_composite32 (PIXMAN_OP_SRC,
+ image->pixman_image, NULL, clone->pixman_image,
+ src_x, src_y,
+ 0, 0,
+ 0, 0,
+ width, height);
ximage.obdata = _cairo_xlib_shm_surface_get_obdata (shm_image);
ximage.data = (char *)clone->data;
ximage.bytes_per_line = clone->stride;
+ ximage.width = width;
+ ximage.height = height;
+ src_x = src_y = 0;
}
}
} else
--
cgit v0.9.0.2-2-gbebe

View File

@@ -0,0 +1,28 @@
From c006b886d28a772d7a62cec52ab7e0c8196c36f6 Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue, 29 Jan 2013 03:01:31 +0000
Subject: xlib/shm: Force synchronisation for scratch SHM image buffers
The scratch image buffers are used for uploads to the xserver and so we
must be careful not to overwrite active SHM segments. Unfortunately we
told the core SHM allocator that we would sync before using the images,
which was a lie.
Reported-by: Michael Natterer <mitch@gimp.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
diff --git a/src/cairo-xlib-surface-shm.c b/src/cairo-xlib-surface-shm.c
index 43cecdf..32c7033 100644
--- a/src/cairo-xlib-surface-shm.c
+++ b/src/cairo-xlib-surface-shm.c
@@ -1155,7 +1155,7 @@ _cairo_xlib_surface_create_shm__image (cairo_xlib_surface_t *surface,
return NULL;
return &_cairo_xlib_shm_surface_create (surface, format, width, height,
- TRUE, 0)->image.base;
+ FALSE, 0)->image.base;
}
cairo_surface_t *
--
cgit v0.9.0.2-2-gbebe

View File

@@ -0,0 +1,12 @@
diff -ruN cairo-1.12.10.orig/test/Makefile.am cairo-1.12.10/test/Makefile.am
--- cairo-1.12.10.orig/test/Makefile.am 2013-01-27 14:56:03.345178612 -0800
+++ cairo-1.12.10/test/Makefile.am 2013-01-27 14:56:15.371177856 -0800
@@ -71,8 +71,6 @@
endif
test_sources += $(test)
-noinst_PROGRAMS = cairo-test-suite$(EXEEXT) # always build
-
TESTS += cairo-test-suite$(EXEEXT)
cairo-test-constructors.c: Makefile $(test_sources) make-cairo-test-constructors.sh

View File

@@ -0,0 +1,40 @@
From 2dd2c826a5b367d32cf2d48ed69754795990c5db Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue, 16 Apr 2013 09:58:56 +0000
Subject: png: Avoid marking the surface as in error after a png warning
It turns out that libpng will continue to load an image after throwing a
warning, and that libpng16 now throws warnings for images that libpng15
and earlier loaded without error. As we were happily loading those
images into cairo surfaces before, we are therefore being overzealous
in throwing an error now - so just squelch the warning.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
diff --git a/src/cairo-png.c b/src/cairo-png.c
index e74a4a8..068617d 100644
--- a/src/cairo-png.c
+++ b/src/cairo-png.c
@@ -149,13 +149,13 @@ static void
png_simple_warning_callback (png_structp png,
png_const_charp error_msg)
{
- cairo_status_t *error = png_get_error_ptr (png);
-
- /* default to the most likely error */
- if (*error == CAIRO_STATUS_SUCCESS)
- *error = _cairo_error (CAIRO_STATUS_NO_MEMORY);
-
- /* png does not expect to abort and will try to tidy up after a warning */
+ /* png does not expect to abort and will try to tidy up and continue
+ * loading the image after a warning. So we also want to return the
+ * (incorrect?) surface.
+ *
+ * We use our own warning callback to squelch any attempts by libpng
+ * to write to stderr as we may not be in control of that output.
+ */
}
--
cgit v0.9.0.2-2-gbebe

View File

@@ -0,0 +1,16 @@
diff -ru cairo-1.8.8.orig/build/configure.ac.tools cairo-1.8.8/build/configure.ac.tools
--- cairo-1.8.8.orig/build/configure.ac.tools 2009-09-30 13:36:42 +0200
+++ cairo-1.8.8/build/configure.ac.tools 2009-09-30 13:50:50 +0200
@@ -21,5 +21,12 @@
*) PKGCONFIG_REQUIRES="Requires.private"; ;;
esac
+dnl hmm... on interix, things go really bad with Requires.private, since libpng12
+dnl is missing on the final link commands, so gtk+'s configure checks for cairo
+dnl fail miserably with unresolved symbols to it.
+case "$host_os" in
+interix*) PKGCONFIG_REQUIRES="Requires" ;;
+esac
+
AC_SUBST(PKGCONFIG_REQUIRES)

View File

@@ -0,0 +1,13 @@
--- cairo-1.7.6-orig/src/cairo-ft-font.c 2008-09-29 21:43:13.000000000 +0100
+++ cairo-1.7.6/src/cairo-ft-font.c 2008-09-29 21:52:19.000000000 +0100
@@ -1705,7 +1705,9 @@
options->base.subpixel_order = other->base.subpixel_order;
}
- if (options->base.hint_style == CAIRO_HINT_STYLE_DEFAULT)
+ options->base.hint_style = CAIRO_HINT_STYLE_DEFAULT;
+
+ if (other->base.hint_style != CAIRO_HINT_STYLE_DEFAULT)
options->base.hint_style = other->base.hint_style;
if (other->base.hint_style == CAIRO_HINT_STYLE_NONE)