[xulrunner] Work around new features that are not available in system cairo

Christopher Aillon caillon at fedoraproject.org
Fri Jan 14 20:55:24 UTC 2011


commit eb1423694664e1c51b34866f6276616d23eef5dd
Author: Christopher Aillon <caillon at redhat.com>
Date:   Fri Jan 14 12:54:13 2011 -0800

    Work around new features that are not available in system cairo
    
    Patch from upstream bug https://bugzilla.mozilla.org/show_bug.cgi?id=623797

 xulrunner-2.0-system-cairo.patch |  132 ++++++++++++++++++++++++++++++++++++++
 xulrunner.spec                   |    2 +
 2 files changed, 134 insertions(+), 0 deletions(-)
---
diff --git a/xulrunner-2.0-system-cairo.patch b/xulrunner-2.0-system-cairo.patch
new file mode 100644
index 0000000..0cc9b0d
--- /dev/null
+++ b/xulrunner-2.0-system-cairo.patch
@@ -0,0 +1,132 @@
+https://bugzilla.mozilla.org/show_bug.cgi?id=623797
+
+work around new features that are not avaliable in system-cairo on linux
+(romaxa's patch with modification for return failure with <gcc-4.5)
+
+diff --git a/config/system-headers b/config/system-headers
+--- a/config/system-headers
++++ b/config/system-headers
+@@ -81,16 +81,17 @@ pixman.h
+ cairo.h
+ cairo-atsui.h
+ cairo-beos.h
+ cairo-ft.h
+ cairo-glitz.h
+ cairo-os2.h
+ cairo-pdf.h
+ cairo-ps.h
++cairo-tee.h
+ cairo-quartz.h
+ cairo-win32.h
+ cairo-xlib.h
+ cairo-xlib-xrender.h
+ cairo-directfb.h
+ cairo-qpainter.h
+ #endif
+ dfiff.h
+diff --git a/gfx/thebes/gfxASurface.cpp b/gfx/thebes/gfxASurface.cpp
+--- a/gfx/thebes/gfxASurface.cpp
++++ b/gfx/thebes/gfxASurface.cpp
+@@ -216,19 +216,21 @@ gfxASurface::Init(cairo_surface_t* surfa
+ 
+     mSurface = surface;
+     mSurfaceValid = PR_TRUE;
+ 
+     if (existingSurface) {
+         mFloatingRefs = 0;
+     } else {
+         mFloatingRefs = 1;
++#ifdef MOZ_TREE_CAIRO
+         if (cairo_surface_get_content(surface) != CAIRO_CONTENT_COLOR) {
+             cairo_surface_set_subpixel_antialiasing(surface, CAIRO_SUBPIXEL_ANTIALIASING_DISABLED);
+         }
++#endif
+     }
+ }
+ 
+ gfxASurface::gfxSurfaceType
+ gfxASurface::GetType() const
+ {
+     if (!mSurfaceValid)
+         return (gfxSurfaceType)-1;
+@@ -432,26 +434,32 @@ gfxASurface::FormatFromContent(gfxASurfa
+     }
+ }
+ 
+ void
+ gfxASurface::SetSubpixelAntialiasingEnabled(PRBool aEnabled)
+ {
+     if (!mSurfaceValid)
+         return;
++#ifdef MOZ_TREE_CAIRO
+     cairo_surface_set_subpixel_antialiasing(mSurface,
+         aEnabled ? CAIRO_SUBPIXEL_ANTIALIASING_ENABLED : CAIRO_SUBPIXEL_ANTIALIASING_DISABLED);
++#endif
+ }
+ 
+ PRBool
+ gfxASurface::GetSubpixelAntialiasingEnabled()
+ {
+     if (!mSurfaceValid)
+       return PR_FALSE;
++#ifdef MOZ_TREE_CAIRO
+     return cairo_surface_get_subpixel_antialiasing(mSurface) == CAIRO_SUBPIXEL_ANTIALIASING_ENABLED;
++#else
++    return PR_TRUE;
++#endif
+ }
+ 
+ PRInt32
+ gfxASurface::BytePerPixelFromFormat(gfxImageFormat format)
+ {
+     switch (format) {
+         case ImageFormatARGB32:
+         case ImageFormatRGB24:
+diff --git a/gfx/thebes/gfxTeeSurface.cpp b/gfx/thebes/gfxTeeSurface.cpp
+--- a/gfx/thebes/gfxTeeSurface.cpp
++++ b/gfx/thebes/gfxTeeSurface.cpp
+@@ -32,17 +32,21 @@
+  * and other provisions required by the GPL or the LGPL. If you do not delete
+  * the provisions above, a recipient may use your version of this file under
+  * the terms of any one of the MPL, the GPL or the LGPL.
+  *
+  * ***** END LICENSE BLOCK ***** */
+ 
+ #include "gfxTeeSurface.h"
+ 
++#ifdef MOZ_TREE_CAIRO
+ #include "cairo.h"
++#else
++#include "cairo-tee.h"
++#endif
+ 
+ gfxTeeSurface::gfxTeeSurface(cairo_surface_t *csurf)
+ {
+     Init(csurf, PR_TRUE);
+ }
+ 
+ gfxTeeSurface::gfxTeeSurface(gfxASurface **aSurfaces, PRInt32 aSurfaceCount)
+ {
+diff --git a/js/src/config/system-headers b/js/src/config/system-headers
+--- a/js/src/config/system-headers
++++ b/js/src/config/system-headers
+@@ -82,16 +82,17 @@ cairo.h
+ cairo-atsui.h
+ cairo-beos.h
+ cairo-ft.h
+ cairo-glitz.h
+ cairo-os2.h
+ cairo-pdf.h
+ cairo-ps.h
+ cairo-quartz.h
++cairo-tee.h
+ cairo-win32.h
+ cairo-xlib.h
+ cairo-xlib-xrender.h
+ cairo-directfb.h
+ cairo-qpainter.h
+ #endif
+ dfiff.h
+ exception
+
+
diff --git a/xulrunner.spec b/xulrunner.spec
index 82a25f1..4645f40 100644
--- a/xulrunner.spec
+++ b/xulrunner.spec
@@ -51,6 +51,7 @@ Patch11:        mozilla-malloc.patch
 Patch12:        xulrunner-2.0-64bit-big-endian.patch
 Patch13:        xulrunner-2.0-secondary-jit.patch
 Patch14:        xulrunner-2.0-chromium-types.patch
+Patch15:        xulrunner-2.0-system-cairo.patch
 
 # Fedora specific patches
 Patch20:        mozilla-193-pkgconfig.patch
@@ -155,6 +156,7 @@ sed -e 's/__RPM_VERSION_INTERNAL__/%{version_internal}/' %{P:%%PATCH0} \
 %patch12 -p2 -b .64bit-big-endian
 %patch13 -p2 -b .secondary-jit
 %patch14 -p2 -b .chromium-types
+%patch15 -p1 -b .system-cairo
 
 %patch20 -p2 -b .pk
 %patch21 -p2 -b .jpeg-turbo


More information about the scm-commits mailing list