https://bugzilla.mozilla.org/show_bug.cgi?id=623797 work around new features that are not avaliable in system-cairo on linux (romaxa's original patch with modifications to use cairo-tee) 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; @@ -430,28 +432,34 @@ gfxASurface::FormatFromContent(gfxASurfa default: return ImageFormatRGB24; } } void gfxASurface::SetSubpixelAntialiasingEnabled(PRBool aEnabled) { +#ifdef MOZ_TREE_CAIRO if (!mSurfaceValid) return; 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,24 @@ * 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" +/* Once cairo in tree is update ensure we remove the ifdef + and just include cairo-tee.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