Bug 1028996 - Remove patches directory in Skia and clarify commit procedure r=snorp
authorGeorge Wright <george@mozilla.com>
Mon, 23 Jun 2014 13:28:12 -0400
changeset 190892 ce071553b95048a99cb42055d7606c1db493bb54
parent 190891 1fd65e3c2f4af65ec50a68443d4650907245fa62
child 190893 11ce0e5823f49b19d847aaa760fd330fe0cc6172
push id27018
push usercbook@mozilla.com
push dateThu, 26 Jun 2014 12:15:07 +0000
treeherdermozilla-central@bd03647cca20 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1028996
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1028996 - Remove patches directory in Skia and clarify commit procedure r=snorp
gfx/skia/README_COMMITTING
gfx/skia/patches/0001-Bug-895086-Remove-unused-find_from_uniqueID-function.patch
gfx/skia/patches/0002-Bug-848491-Re-apply-Bug-795549-Move-TileProc-functio.patch
gfx/skia/patches/0005-Bug-736276-Add-a-new-SkFontHost-that-takes-a-cairo_s.patch
gfx/skia/patches/0006-Bug-848491-Re-apply-Bug-777614-Add-our-SkUserConfig..patch
gfx/skia/patches/0007-Bug-848491-Re-apply-bug-687188-Expand-the-gradient-c.patch
gfx/skia/patches/0008-Bug-848491-Re-apply-759683-Handle-compilers-that-don.patch
gfx/skia/patches/0009-Bug-848491-Re-apply-bug-751418-Add-our-own-GrUserCon.patch
gfx/skia/patches/0010-Bug-848491-Re-apply-bug-817356-Patch-Skia-to-recogni.patch
gfx/skia/patches/0022-Bug-848491-Re-apply-bug-795538-Ensure-we-use-the-cor.patch
gfx/skia/patches/0023-Bug-890539-Fix-SK_COMPILE_ASSERT-build-warning.patch
gfx/skia/patches/0024-Bug-887318-fix-bgra-readback.patch
gfx/skia/patches/0025-Bug-896049-Add-default-Value-SK_OVERRIDE.patch
gfx/skia/patches/0026-Bug-901208-Fix-ARM-v4t.patch
gfx/skia/patches/0030-Bug-939629-Add-missing-include-guards.patch
gfx/skia/patches/0031-Bug-945588-Add-include-guard.patch
gfx/skia/patches/0032-Bug-974900-More-missing-include-guards.patch
gfx/skia/patches/0033-Bug-974900-undef-interface-windows.patch
gfx/skia/patches/README
gfx/skia/patches/archive/0001-Bug-895086-Remove-unused-find_from_uniqueID-function.patch
gfx/skia/patches/archive/0002-Bug-848491-Re-apply-Bug-795549-Move-TileProc-functio.patch
gfx/skia/patches/archive/0005-Bug-736276-Add-a-new-SkFontHost-that-takes-a-cairo_s.patch
gfx/skia/patches/archive/0006-Bug-848491-Re-apply-Bug-777614-Add-our-SkUserConfig..patch
gfx/skia/patches/archive/0007-Bug-848491-Re-apply-bug-687188-Expand-the-gradient-c.patch
gfx/skia/patches/archive/0008-Bug-848491-Re-apply-759683-Handle-compilers-that-don.patch
gfx/skia/patches/archive/0009-Bug-848491-Re-apply-bug-751418-Add-our-own-GrUserCon.patch
gfx/skia/patches/archive/0010-Bug-848491-Re-apply-bug-817356-Patch-Skia-to-recogni.patch
gfx/skia/patches/archive/0022-Bug-848491-Re-apply-bug-795538-Ensure-we-use-the-cor.patch
gfx/skia/patches/archive/0023-Bug-890539-Fix-SK_COMPILE_ASSERT-build-warning.patch
gfx/skia/patches/archive/0024-Bug-887318-fix-bgra-readback.patch
gfx/skia/patches/archive/0025-Bug-896049-Add-default-Value-SK_OVERRIDE.patch
gfx/skia/patches/archive/0026-Bug-901208-Fix-ARM-v4t.patch
gfx/skia/patches/archive/0030-Bug-939629-Add-missing-include-guards.patch
gfx/skia/patches/archive/0031-Bug-945588-Add-include-guard.patch
gfx/skia/patches/archive/0032-Bug-974900-More-missing-include-guards.patch
gfx/skia/patches/archive/0033-Bug-974900-undef-interface-windows.patch
new file mode 100644
--- /dev/null
+++ b/gfx/skia/README_COMMITTING
@@ -0,0 +1,10 @@
+Any changes to Skia should have at a minimum both a Mozilla bug tagged with the [skia-upstream]
+whiteboard tag, and also an upstream bug and review request. Any patches that do ultimately land
+in mozilla-central must be reviewed by a Skia submodule peer.
+
+See https://wiki.mozilla.org/Modules/Core#Graphics for current peers.
+
+In most cases the patch will need to have an r+ from upstream before it is eligible to land here.
+
+For information on submitting upstream, see:
+https://sites.google.com/site/skiadocs/developer-documentation/contributing-code/how-to-submit-a-patch
deleted file mode 100644
--- a/gfx/skia/patches/0001-Bug-895086-Remove-unused-find_from_uniqueID-function.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 58861c38751adf1f4ef3f67f8e85f5c36f1c43a5 Mon Sep 17 00:00:00 2001
-From: George Wright <gw@gwright.org.uk>
-Date: Wed, 17 Jul 2013 16:28:07 -0400
-Subject: [PATCH] Bug 895086 - Remove unused find_from_uniqueID() function from
- SkFontHost_linux
-
----
- gfx/skia/src/ports/SkFontHost_linux.cpp | 14 --------------
- 1 file changed, 14 deletions(-)
-
-diff --git a/gfx/skia/src/ports/SkFontHost_linux.cpp b/gfx/skia/src/ports/SkFontHost_linux.cpp
-index df21014..05b73dc 100644
---- a/gfx/skia/src/ports/SkFontHost_linux.cpp
-+++ b/gfx/skia/src/ports/SkFontHost_linux.cpp
-@@ -117,20 +117,6 @@ static FamilyRec* find_family(const SkTypeface* member) {
-     return NULL;
- }
- 
--static SkTypeface* find_from_uniqueID(uint32_t uniqueID) {
--    FamilyRec* curr = gFamilyHead;
--    while (curr != NULL) {
--        for (int i = 0; i < 4; i++) {
--            SkTypeface* face = curr->fFaces[i];
--            if (face != NULL && face->uniqueID() == uniqueID) {
--                return face;
--            }
--        }
--        curr = curr->fNext;
--    }
--    return NULL;
--}
--
- /*  Remove reference to this face from its family. If the resulting family
-  is empty (has no faces), return that family, otherwise return NULL
-  */
--- 
-1.8.3.1
-
deleted file mode 100644
--- a/gfx/skia/patches/0002-Bug-848491-Re-apply-Bug-795549-Move-TileProc-functio.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From: George Wright <george@mozilla.com>
-Date: Mon, 14 Jan 2013 17:59:09 -0500
-Subject: Bug 848491 - Re-apply Bug 795549 - Move TileProc functions into their own file to ensure they only exist once in a library
-
-
-diff --git a/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h b/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h
-index b9dbf1b..729ce4e 100644
---- a/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h
-+++ b/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h
-@@ -37,34 +37,9 @@ static inline void sk_memset32_dither(uint32_t dst[], uint32_t v0, uint32_t v1,
-     }
- }
- 
--//  Clamp
--
--static inline SkFixed clamp_tileproc(SkFixed x) {
--    return SkClampMax(x, 0xFFFF);
--}
--
--// Repeat
--
--static inline SkFixed repeat_tileproc(SkFixed x) {
--    return x & 0xFFFF;
--}
--
--// Mirror
--
--// Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly.
--// See http://code.google.com/p/skia/issues/detail?id=472
--#if defined(_MSC_VER) && (_MSC_VER >= 1600)
--#pragma optimize("", off)
--#endif
--
--static inline SkFixed mirror_tileproc(SkFixed x) {
--    int s = x << 15 >> 31;
--    return (x ^ s) & 0xFFFF;
--}
--
--#if defined(_MSC_VER) && (_MSC_VER >= 1600)
--#pragma optimize("", on)
--#endif
-+SkFixed clamp_tileproc(SkFixed x);
-+SkFixed repeat_tileproc(SkFixed x);
-+SkFixed mirror_tileproc(SkFixed x);
- 
- ///////////////////////////////////////////////////////////////////////////////
- 
--- 
-1.7.11.7
-
deleted file mode 100644
--- a/gfx/skia/patches/0005-Bug-736276-Add-a-new-SkFontHost-that-takes-a-cairo_s.patch
+++ /dev/null
@@ -1,472 +0,0 @@
-From: George Wright <george@mozilla.com>
-Date: Wed, 1 Aug 2012 16:43:15 -0400
-Subject: Bug 736276 - Add a new SkFontHost that takes a cairo_scaled_font_t r=karl
-
-
-diff --git a/gfx/skia/Makefile.in b/gfx/skia/Makefile.in
-index 5ebbd2e..7c8cdbf 100644
---- a/gfx/skia/Makefile.in
-+++ b/gfx/skia/Makefile.in
-@@ -60,15 +60,15 @@ VPATH += \
- 	$(NULL)
- 
- ifeq (android,$(MOZ_WIDGET_TOOLKIT))
--OS_CXXFLAGS += $(CAIRO_FT_CFLAGS)
-+OS_CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(CAIRO_FT_CFLAGS)
- endif
- 
- ifeq (gtk2,$(MOZ_WIDGET_TOOLKIT))
--OS_CXXFLAGS += $(MOZ_PANGO_CFLAGS)
-+OS_CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(MOZ_PANGO_CFLAGS) $(CAIRO_FT_CFLAGS)
- endif
- 
- ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
--OS_CXXFLAGS += $(MOZ_PANGO_CFLAGS)
-+OS_CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(MOZ_PANGO_CFLAGS) $(CAIRO_FT_CFLAGS)
- ifeq (Linux,$(OS_TARGET))
- DEFINES += -DSK_USE_POSIX_THREADS=1
- endif
-diff --git a/gfx/skia/include/ports/SkTypeface_cairo.h b/gfx/skia/include/ports/SkTypeface_cairo.h
-new file mode 100644
-index 0000000..7e44f04
---- /dev/null
-+++ b/gfx/skia/include/ports/SkTypeface_cairo.h
-@@ -0,0 +1,11 @@
-+#ifndef SkTypeface_cairo_DEFINED
-+#define SkTypeface_cairo_DEFINED
-+
-+#include <cairo.h>
-+
-+#include "SkTypeface.h"
-+
-+SK_API extern SkTypeface* SkCreateTypefaceFromCairoFont(cairo_font_face_t* fontFace, SkTypeface::Style style, bool isFixedWidth);
-+
-+#endif
-+
-diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build
-index 9ceba59..66efd52 100644
---- a/gfx/skia/moz.build
-+++ b/gfx/skia/moz.build
-@@ -171,10 +171,12 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
-         'SkTime_win.cpp',
-     ]
- elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk2':
-+    EXPORTS.skia += [
-+        'include/ports/SkTypeface_cairo.h',
-+    ]
-     CPP_SOURCES += [
--        'SkFontHost_FreeType.cpp',
-+        'SkFontHost_cairo.cpp',
-         'SkFontHost_FreeType_common.cpp',
--        'SkFontHost_linux.cpp',
-         'SkThread_pthread.cpp',
-         'SkThreadUtils_pthread.cpp',
-         'SkThreadUtils_pthread_linux.cpp',
-@@ -183,14 +185,15 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk2':
-     ]
- elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
-     CPP_SOURCES += [
--        'SkFontHost_FreeType.cpp',
-+        'SkFontHost_cairo.cpp',
-         'SkFontHost_FreeType_common.cpp',
-         'SkOSFile.cpp',
-     ]
-     if CONFIG['OS_TARGET'] == 'Linux':
-+        EXPORTS.skia += [
-+            'include/ports/SkTypeface_cairo.h',
-+        ]
-         CPP_SOURCES += [
--            'SkFontHost_linux.cpp',
--            'SkFontHost_tables.cpp',
-             'SkThread_pthread.cpp',
-             'SkThreadUtils_pthread.cpp',
-             'SkThreadUtils_pthread_linux.cpp',
-@@ -204,11 +207,13 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
- # Separate 'if' from above, since the else below applies to all != 'android'
- # toolkits.
- if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
-+    EXPORTS.skia += [
-+        'include/ports/SkTypeface_cairo.h',
-+    ]
-     CPP_SOURCES += [
-         'ashmem.cpp',
-         'SkDebug_android.cpp',
--        'SkFontHost_android_old.cpp',
--        'SkFontHost_FreeType.cpp',
-+        'SkFontHost_cairo.cpp',
-         'SkFontHost_FreeType_common.cpp',
-         'SkImageRef_ashmem.cpp',
-         'SkTime_Unix.cpp',
-diff --git a/gfx/skia/src/ports/SkFontHost_cairo.cpp b/gfx/skia/src/ports/SkFontHost_cairo.cpp
-new file mode 100644
-index 0000000..bb5b778
---- /dev/null
-+++ b/gfx/skia/src/ports/SkFontHost_cairo.cpp
-@@ -0,0 +1,364 @@
-+
-+/*
-+ * Copyright 2012 Mozilla Foundation
-+ *
-+ * Use of this source code is governed by a BSD-style license that can be
-+ * found in the LICENSE file.
-+ */
-+
-+#include "cairo.h"
-+#include "cairo-ft.h"
-+
-+#include "SkFontHost_FreeType_common.h"
-+
-+#include "SkAdvancedTypefaceMetrics.h"
-+#include "SkFontHost.h"
-+#include "SkPath.h"
-+#include "SkScalerContext.h"
-+#include "SkTypefaceCache.h"
-+
-+#include <ft2build.h>
-+#include FT_FREETYPE_H
-+
-+static cairo_user_data_key_t kSkTypefaceKey;
-+
-+class SkScalerContext_CairoFT : public SkScalerContext_FreeType_Base {
-+public:
-+    SkScalerContext_CairoFT(SkTypeface* typeface, const SkDescriptor* desc);
-+    virtual ~SkScalerContext_CairoFT();
-+
-+protected:
-+    virtual unsigned generateGlyphCount() SK_OVERRIDE;
-+    virtual uint16_t generateCharToGlyph(SkUnichar uniChar) SK_OVERRIDE;
-+    virtual void generateAdvance(SkGlyph* glyph) SK_OVERRIDE;
-+    virtual void generateMetrics(SkGlyph* glyph) SK_OVERRIDE;
-+    virtual void generateImage(const SkGlyph& glyph) SK_OVERRIDE;
-+    virtual void generatePath(const SkGlyph& glyph, SkPath* path) SK_OVERRIDE;
-+    virtual void generateFontMetrics(SkPaint::FontMetrics* mx,
-+                                     SkPaint::FontMetrics* my) SK_OVERRIDE;
-+    virtual SkUnichar generateGlyphToChar(uint16_t glyph) SK_OVERRIDE;
-+private:
-+    cairo_scaled_font_t* fScaledFont;
-+    uint32_t fLoadGlyphFlags;
-+};
-+
-+class CairoLockedFTFace {
-+public:
-+    CairoLockedFTFace(cairo_scaled_font_t* scaledFont)
-+        : fScaledFont(scaledFont)
-+        , fFace(cairo_ft_scaled_font_lock_face(scaledFont))
-+    {}
-+
-+    ~CairoLockedFTFace()
-+    {
-+        cairo_ft_scaled_font_unlock_face(fScaledFont);
-+    }
-+
-+    FT_Face getFace()
-+    {
-+        return fFace;
-+    }
-+
-+private:
-+    cairo_scaled_font_t* fScaledFont;
-+    FT_Face fFace;
-+};
-+
-+class SkCairoFTTypeface : public SkTypeface {
-+public:
-+    static SkTypeface* CreateTypeface(cairo_font_face_t* fontFace, SkTypeface::Style style, bool isFixedWidth) {
-+        SkASSERT(fontFace != NULL);
-+        SkASSERT(cairo_font_face_get_type(fontFace) == CAIRO_FONT_TYPE_FT);
-+
-+        SkFontID newId = SkTypefaceCache::NewFontID();
-+
-+        return SkNEW_ARGS(SkCairoFTTypeface, (fontFace, style, newId, isFixedWidth));
-+    }
-+
-+    cairo_font_face_t* getFontFace() {
-+        return fFontFace;
-+    }
-+
-+    virtual SkStream* onOpenStream(int*) const SK_OVERRIDE { return NULL; }
-+
-+    virtual SkAdvancedTypefaceMetrics*
-+        onGetAdvancedTypefaceMetrics(SkAdvancedTypefaceMetrics::PerGlyphInfo,
-+                                     const uint32_t*, uint32_t) const SK_OVERRIDE
-+    {
-+        SkDEBUGCODE(SkDebugf("SkCairoFTTypeface::onGetAdvancedTypefaceMetrics unimplemented\n"));
-+        return NULL;
-+    }
-+
-+    virtual SkScalerContext* onCreateScalerContext(const SkDescriptor* desc) const SK_OVERRIDE
-+    {
-+        return SkNEW_ARGS(SkScalerContext_CairoFT, (const_cast<SkCairoFTTypeface*>(this), desc));
-+    }
-+
-+    virtual void onFilterRec(SkScalerContextRec*) const SK_OVERRIDE
-+    {
-+        SkDEBUGCODE(SkDebugf("SkCairoFTTypeface::onFilterRec unimplemented\n"));
-+    }
-+
-+    virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE
-+    {
-+        SkDEBUGCODE(SkDebugf("SkCairoFTTypeface::onGetFontDescriptor unimplemented\n"));
-+    }
-+
-+
-+private:
-+
-+    SkCairoFTTypeface(cairo_font_face_t* fontFace, SkTypeface::Style style, SkFontID id, bool isFixedWidth)
-+        : SkTypeface(style, id, isFixedWidth)
-+        , fFontFace(fontFace)
-+    {
-+        cairo_font_face_set_user_data(fFontFace, &kSkTypefaceKey, this, NULL);
-+        cairo_font_face_reference(fFontFace);
-+    }
-+
-+    ~SkCairoFTTypeface()
-+    {
-+        cairo_font_face_set_user_data(fFontFace, &kSkTypefaceKey, NULL, NULL);
-+        cairo_font_face_destroy(fFontFace);
-+    }
-+
-+    cairo_font_face_t* fFontFace;
-+};
-+
-+SkTypeface* SkCreateTypefaceFromCairoFont(cairo_font_face_t* fontFace, SkTypeface::Style style, bool isFixedWidth)
-+{
-+    SkTypeface* typeface = reinterpret_cast<SkTypeface*>(cairo_font_face_get_user_data(fontFace, &kSkTypefaceKey));
-+
-+    if (typeface) {
-+        typeface->ref();
-+    } else {
-+        typeface = SkCairoFTTypeface::CreateTypeface(fontFace, style, isFixedWidth);
-+        SkTypefaceCache::Add(typeface, style);
-+    }
-+
-+    return typeface;
-+}
-+
-+SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
-+                                     const char famillyName[],
-+                                     SkTypeface::Style style)
-+{
-+    SkDEBUGFAIL("SkFontHost::FindTypeface unimplemented");
-+    return NULL;
-+}
-+
-+SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream*)
-+{
-+    SkDEBUGFAIL("SkFontHost::CreateTypeface unimplemented");
-+    return NULL;
-+}
-+
-+SkTypeface* SkFontHost::CreateTypefaceFromFile(char const*)
-+{
-+    SkDEBUGFAIL("SkFontHost::CreateTypefaceFromFile unimplemented");
-+    return NULL;
-+}
-+
-+///////////////////////////////////////////////////////////////////////////////
-+
-+static bool isLCD(const SkScalerContext::Rec& rec) {
-+    switch (rec.fMaskFormat) {
-+        case SkMask::kLCD16_Format:
-+        case SkMask::kLCD32_Format:
-+            return true;
-+        default:
-+            return false;
-+    }
-+}
-+
-+///////////////////////////////////////////////////////////////////////////////
-+SkScalerContext_CairoFT::SkScalerContext_CairoFT(SkTypeface* typeface, const SkDescriptor* desc)
-+    : SkScalerContext_FreeType_Base(typeface, desc)
-+{
-+    SkMatrix matrix;
-+    fRec.getSingleMatrix(&matrix);
-+
-+    cairo_font_face_t* fontFace = static_cast<SkCairoFTTypeface*>(typeface)->getFontFace();
-+
-+    cairo_matrix_t fontMatrix, ctMatrix;
-+    cairo_matrix_init(&fontMatrix, matrix.getScaleX(), matrix.getSkewY(), matrix.getSkewX(), matrix.getScaleY(), 0.0, 0.0);
-+    cairo_matrix_init_scale(&ctMatrix, 1.0, 1.0);
-+
-+    // We need to ensure that the font options match for hinting, as generateMetrics()
-+    // uses the fScaledFont which uses these font options
-+    cairo_font_options_t *fontOptions = cairo_font_options_create();
-+
-+    FT_Int32 loadFlags = FT_LOAD_DEFAULT;
-+
-+    if (SkMask::kBW_Format == fRec.fMaskFormat) {
-+        // See http://code.google.com/p/chromium/issues/detail?id=43252#c24
-+        loadFlags = FT_LOAD_TARGET_MONO;
-+        if (fRec.getHinting() == SkPaint::kNo_Hinting) {
-+            cairo_font_options_set_hint_style(fontOptions, CAIRO_HINT_STYLE_NONE);
-+            loadFlags = FT_LOAD_NO_HINTING;
-+        }
-+    } else {
-+        switch (fRec.getHinting()) {
-+        case SkPaint::kNo_Hinting:
-+            loadFlags = FT_LOAD_NO_HINTING;
-+            cairo_font_options_set_hint_style(fontOptions, CAIRO_HINT_STYLE_NONE);
-+            break;
-+        case SkPaint::kSlight_Hinting:
-+            loadFlags = FT_LOAD_TARGET_LIGHT;  // This implies FORCE_AUTOHINT
-+            cairo_font_options_set_hint_style(fontOptions, CAIRO_HINT_STYLE_SLIGHT);
-+            break;
-+        case SkPaint::kNormal_Hinting:
-+            cairo_font_options_set_hint_style(fontOptions, CAIRO_HINT_STYLE_MEDIUM);
-+            if (fRec.fFlags & SkScalerContext::kAutohinting_Flag) {
-+                loadFlags = FT_LOAD_FORCE_AUTOHINT;
-+            }
-+            break;
-+        case SkPaint::kFull_Hinting:
-+            cairo_font_options_set_hint_style(fontOptions, CAIRO_HINT_STYLE_FULL);
-+            if (fRec.fFlags & SkScalerContext::kAutohinting_Flag) {
-+                loadFlags = FT_LOAD_FORCE_AUTOHINT;
-+            }
-+            if (isLCD(fRec)) {
-+                if (SkToBool(fRec.fFlags & SkScalerContext::kLCD_Vertical_Flag)) {
-+                    loadFlags = FT_LOAD_TARGET_LCD_V;
-+                } else {
-+                    loadFlags = FT_LOAD_TARGET_LCD;
-+                }
-+            }
-+            break;
-+        default:
-+            SkDebugf("---------- UNKNOWN hinting %d\n", fRec.getHinting());
-+            break;
-+        }
-+    }
-+
-+    fScaledFont = cairo_scaled_font_create(fontFace, &fontMatrix, &ctMatrix, fontOptions);
-+
-+    if ((fRec.fFlags & SkScalerContext::kEmbeddedBitmapText_Flag) == 0) {
-+        loadFlags |= FT_LOAD_NO_BITMAP;
-+    }
-+
-+    // Always using FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH to get correct
-+    // advances, as fontconfig and cairo do.
-+    // See http://code.google.com/p/skia/issues/detail?id=222.
-+    loadFlags |= FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH;
-+
-+    fLoadGlyphFlags = loadFlags;
-+}
-+
-+SkScalerContext_CairoFT::~SkScalerContext_CairoFT()
-+{
-+    cairo_scaled_font_destroy(fScaledFont);
-+}
-+
-+unsigned SkScalerContext_CairoFT::generateGlyphCount()
-+{
-+    CairoLockedFTFace faceLock(fScaledFont);
-+    return faceLock.getFace()->num_glyphs;
-+}
-+
-+uint16_t SkScalerContext_CairoFT::generateCharToGlyph(SkUnichar uniChar)
-+{
-+    CairoLockedFTFace faceLock(fScaledFont);
-+    return SkToU16(FT_Get_Char_Index(faceLock.getFace(), uniChar));
-+}
-+
-+void SkScalerContext_CairoFT::generateAdvance(SkGlyph* glyph)
-+{
-+    generateMetrics(glyph);
-+}
-+
-+void SkScalerContext_CairoFT::generateMetrics(SkGlyph* glyph)
-+{
-+    SkASSERT(fScaledFont != NULL);
-+    cairo_text_extents_t extents;
-+    cairo_glyph_t cairoGlyph = { glyph->getGlyphID(fBaseGlyphCount), 0.0, 0.0 };
-+    cairo_scaled_font_glyph_extents(fScaledFont, &cairoGlyph, 1, &extents);
-+
-+    glyph->fAdvanceX = SkDoubleToFixed(extents.x_advance);
-+    glyph->fAdvanceY = SkDoubleToFixed(extents.y_advance);
-+    glyph->fWidth = SkToU16(SkScalarCeil(extents.width));
-+    glyph->fHeight = SkToU16(SkScalarCeil(extents.height));
-+    glyph->fLeft = SkToS16(SkScalarCeil(extents.x_bearing));
-+    glyph->fTop = SkToS16(SkScalarCeil(extents.y_bearing));
-+    glyph->fLsbDelta = 0;
-+    glyph->fRsbDelta = 0;
-+}
-+
-+void SkScalerContext_CairoFT::generateImage(const SkGlyph& glyph)
-+{
-+    SkASSERT(fScaledFont != NULL);
-+    CairoLockedFTFace faceLock(fScaledFont);
-+    FT_Face face = faceLock.getFace();
-+
-+    FT_Error err = FT_Load_Glyph(face, glyph.getGlyphID(fBaseGlyphCount), fLoadGlyphFlags);
-+
-+    if (err != 0) {
-+        memset(glyph.fImage, 0, glyph.rowBytes() * glyph.fHeight);
-+        return;
-+    }
-+
-+    generateGlyphImage(face, glyph);
-+}
-+
-+void SkScalerContext_CairoFT::generatePath(const SkGlyph& glyph, SkPath* path)
-+{
-+    SkASSERT(fScaledFont != NULL);
-+    CairoLockedFTFace faceLock(fScaledFont);
-+    FT_Face face = faceLock.getFace();
-+
-+    SkASSERT(&glyph && path);
-+
-+    uint32_t flags = fLoadGlyphFlags;
-+    flags |= FT_LOAD_NO_BITMAP; // ignore embedded bitmaps so we're sure to get the outline
-+    flags &= ~FT_LOAD_RENDER;   // don't scan convert (we just want the outline)
-+
-+    FT_Error err = FT_Load_Glyph(face, glyph.getGlyphID(fBaseGlyphCount), flags);
-+
-+    if (err != 0) {
-+        path->reset();
-+        return;
-+    }
-+
-+    generateGlyphPath(face, path);
-+}
-+
-+void SkScalerContext_CairoFT::generateFontMetrics(SkPaint::FontMetrics* mx,
-+                                                  SkPaint::FontMetrics* my)
-+{
-+    SkDEBUGCODE(SkDebugf("SkScalerContext_CairoFT::generateFontMetrics unimplemented\n"));
-+}
-+
-+SkUnichar SkScalerContext_CairoFT::generateGlyphToChar(uint16_t glyph)
-+{
-+    SkASSERT(fScaledFont != NULL);
-+    CairoLockedFTFace faceLock(fScaledFont);
-+    FT_Face face = faceLock.getFace();
-+
-+    FT_UInt glyphIndex;
-+    SkUnichar charCode = FT_Get_First_Char(face, &glyphIndex);
-+    while (glyphIndex != 0) {
-+        if (glyphIndex == glyph) {
-+            return charCode;
-+        }
-+        charCode = FT_Get_Next_Char(face, charCode, &glyphIndex);
-+    }
-+
-+    return 0;
-+}
-+
-+#ifdef SK_BUILD_FOR_ANDROID
-+SkTypeface* SkAndroidNextLogicalTypeface(SkFontID currFontID,
-+                                         SkFontID origFontID) {
-+    return NULL;
-+}
-+#endif
-+
-+///////////////////////////////////////////////////////////////////////////////
-+
-+#include "SkFontMgr.h"
-+
-+SkFontMgr* SkFontMgr::Factory() {
-+    // todo
-+    return NULL;
-+}
-+
--- 
-1.7.11.7
-
deleted file mode 100644
--- a/gfx/skia/patches/0006-Bug-848491-Re-apply-Bug-777614-Add-our-SkUserConfig..patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From: George Wright <gw@gwright.org.uk>
-Date: Thu, 25 Apr 2013 20:40:12 -0400
-Subject: Bug 848491 - Re-apply Bug 777614 - Add our SkUserConfig.h
-
-
-diff --git a/gfx/skia/include/config/SkUserConfig.h b/gfx/skia/include/config/SkUserConfig.h
-index 63fc90d..c965e91 100644
---- a/gfx/skia/include/config/SkUserConfig.h
-+++ b/gfx/skia/include/config/SkUserConfig.h
-@@ -201,4 +201,14 @@
-  */
- //#define SK_SUPPORT_GPU 1
- 
-+/*  Don't dither 32bit gradients, to match what the canvas test suite expects.
-+ */
-+#define SK_DISABLE_DITHER_32BIT_GRADIENT
-+
-+/*  Don't include stdint.h on windows as it conflicts with our build system.
-+ */
-+#ifdef SK_BUILD_FOR_WIN32 
-+    #define SK_IGNORE_STDINT_DOT_H 
-+#endif 
-+
- #endif
--- 
-1.7.11.7
-
deleted file mode 100644
--- a/gfx/skia/patches/0007-Bug-848491-Re-apply-bug-687188-Expand-the-gradient-c.patch
+++ /dev/null
@@ -1,168 +0,0 @@
-From: George Wright <gw@gwright.org.uk>
-Date: Thu, 25 Apr 2013 20:47:06 -0400
-Subject: Bug 848491 - Re-apply bug 687188 - Expand the gradient cache by 2 to store 0/1 colour stop values for clamping.
-
-
-diff --git a/gfx/skia/src/effects/gradients/SkGradientShader.cpp b/gfx/skia/src/effects/gradients/SkGradientShader.cpp
-index 684355d..27a9c46 100644
---- a/gfx/skia/src/effects/gradients/SkGradientShader.cpp
-+++ b/gfx/skia/src/effects/gradients/SkGradientShader.cpp
-@@ -453,15 +453,15 @@ const uint16_t* SkGradientShaderBase::getCache16() const {
- 
- const SkPMColor* SkGradientShaderBase::getCache32() const {
-     if (fCache32 == NULL) {
--        // double the count for dither entries
--        const int entryCount = kCache32Count * 4;
-+        // double the count for dither entries, and have an extra two entries for clamp values
-+        const int entryCount = kCache32Count * 4 + 2;
-         const size_t allocSize = sizeof(SkPMColor) * entryCount;
- 
-         if (NULL == fCache32PixelRef) {
-             fCache32PixelRef = SkNEW_ARGS(SkMallocPixelRef,
-                                           (NULL, allocSize, NULL));
-         }
--        fCache32 = (SkPMColor*)fCache32PixelRef->getAddr();
-+        fCache32 = (SkPMColor*)fCache32PixelRef->getAddr() + 1;
-         if (fColorCount == 2) {
-             Build32bitCache(fCache32, fOrigColors[0], fOrigColors[1],
-                             kCache32Count, fCacheAlpha);
-@@ -484,7 +484,7 @@ const SkPMColor* SkGradientShaderBase::getCache32() const {
-             SkMallocPixelRef* newPR = SkNEW_ARGS(SkMallocPixelRef,
-                                                  (NULL, allocSize, NULL));
-             SkPMColor* linear = fCache32;           // just computed linear data
--            SkPMColor* mapped = (SkPMColor*)newPR->getAddr();    // storage for mapped data
-+            SkPMColor* mapped = (SkPMColor*)newPR->getAddr() + 1;    // storage for mapped data
-             SkUnitMapper* map = fMapper;
-             for (int i = 0; i < kCache32Count; i++) {
-                 int index = map->mapUnit16((i << 8) | i) >> 8;
-@@ -495,9 +495,21 @@ const SkPMColor* SkGradientShaderBase::getCache32() const {
-             }
-             fCache32PixelRef->unref();
-             fCache32PixelRef = newPR;
--            fCache32 = (SkPMColor*)newPR->getAddr();
-+            fCache32 = (SkPMColor*)newPR->getAddr() + 1;
-         }
-     }
-+
-+    // Write the clamp colours into the first and last entries of fCache32
-+    fCache32[kCache32ClampLower] = SkPackARGB32(fCacheAlpha,
-+                                                SkColorGetR(fOrigColors[0]),
-+                                                SkColorGetG(fOrigColors[0]),
-+                                                SkColorGetB(fOrigColors[0]));
-+
-+    fCache32[kCache32ClampUpper] = SkPackARGB32(fCacheAlpha,
-+                                                SkColorGetR(fOrigColors[fColorCount - 1]),
-+                                                SkColorGetG(fOrigColors[fColorCount - 1]),
-+                                                SkColorGetB(fOrigColors[fColorCount - 1]));
-+
-     return fCache32;
- }
- 
-diff --git a/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h b/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h
-index 729ce4e..2cb6a9d 100644
---- a/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h
-+++ b/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h
-@@ -86,6 +86,9 @@ public:
-         /// if dithering is disabled.
-         kDitherStride32 = kCache32Count,
-         kDitherStride16 = kCache16Count,
-+
-+        kCache32ClampLower = -1,
-+        kCache32ClampUpper = kCache32Count * 4
-     };
- 
- 
-diff --git a/gfx/skia/src/effects/gradients/SkLinearGradient.cpp b/gfx/skia/src/effects/gradients/SkLinearGradient.cpp
-index e0f216c..40ab918 100644
---- a/gfx/skia/src/effects/gradients/SkLinearGradient.cpp
-+++ b/gfx/skia/src/effects/gradients/SkLinearGradient.cpp
-@@ -127,6 +127,17 @@ void shadeSpan_linear_vertical_lerp(TileProc proc, SkFixed dx, SkFixed fx,
-                                     SkPMColor* SK_RESTRICT dstC,
-                                     const SkPMColor* SK_RESTRICT cache,
-                                     int toggle, int count) {
-+    if (proc == clamp_tileproc) {
-+        // No need to lerp or dither for clamp values
-+        if (fx < 0) {
-+            sk_memset32(dstC, cache[SkGradientShaderBase::kCache32ClampLower], count);
-+            return;
-+        } else if (fx > 0xffff) {
-+            sk_memset32(dstC, cache[SkGradientShaderBase::kCache32ClampUpper], count);
-+            return;
-+        }
-+    }
-+
-     // We're a vertical gradient, so no change in a span.
-     // If colors change sharply across the gradient, dithering is
-     // insufficient (it subsamples the color space) and we need to lerp.
-@@ -154,10 +165,7 @@ void shadeSpan_linear_clamp(TileProc proc, SkFixed dx, SkFixed fx,
-     range.init(fx, dx, count, 0, SkGradientShaderBase::kCache32Count - 1);
- 
-     if ((count = range.fCount0) > 0) {
--        sk_memset32_dither(dstC,
--            cache[toggle + range.fV0],
--            cache[next_dither_toggle(toggle) + range.fV0],
--            count);
-+        sk_memset32(dstC, cache[SkGradientShaderBase::kCache32ClampLower], count);
-         dstC += count;
-     }
-     if ((count = range.fCount1) > 0) {
-@@ -176,10 +184,7 @@ void shadeSpan_linear_clamp(TileProc proc, SkFixed dx, SkFixed fx,
-         }
-     }
-     if ((count = range.fCount2) > 0) {
--        sk_memset32_dither(dstC,
--            cache[toggle + range.fV1],
--            cache[next_dither_toggle(toggle) + range.fV1],
--            count);
-+        sk_memset32(dstC, cache[SkGradientShaderBase::kCache32ClampUpper], count);
-     }
- }
- 
-diff --git a/gfx/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp b/gfx/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp
-index abd974b..601fff4 100644
---- a/gfx/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp
-+++ b/gfx/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp
-@@ -124,10 +124,14 @@ static void twopoint_clamp(TwoPtRadial* rec, SkPMColor* SK_RESTRICT dstC,
-         if (TwoPtRadial::DontDrawT(t)) {
-             *dstC++ = 0;
-         } else {
--            SkFixed index = SkClampMax(t, 0xFFFF);
--            SkASSERT(index <= 0xFFFF);
--            *dstC++ = cache[toggle +
--                            (index >> SkGradientShaderBase::kCache32Shift)];
-+            if (t < 0) {
-+                *dstC++ = cache[SkGradientShaderBase::kCache32ClampLower];
-+            } else if (t > 0xFFFF) {
-+                *dstC++ = cache[SkGradientShaderBase::kCache32ClampUpper];
-+            } else {
-+                SkASSERT(t <= 0xFFFF);
-+                *dstC++ = cache[t >> SkGradientShaderBase::kCache32Shift];
-+            }
-         }
-         toggle = next_dither_toggle(toggle);
-     }
-diff --git a/gfx/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp b/gfx/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp
-index f70b67d..ec2ae75 100644
---- a/gfx/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp
-+++ b/gfx/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp
-@@ -120,9 +120,14 @@ void shadeSpan_twopoint_clamp(SkScalar fx, SkScalar dx,
-     for (; count > 0; --count) {
-         SkFixed t = two_point_radial(b, fx, fy, fSr2D2, foura,
-                                      fOneOverTwoA, posRoot);
--        SkFixed index = SkClampMax(t, 0xFFFF);
--        SkASSERT(index <= 0xFFFF);
--        *dstC++ = cache[index >> SkGradientShaderBase::kCache32Shift];
-+        if (t < 0) {
-+            *dstC++ = cache[SkGradientShaderBase::kCache32ClampLower];
-+        } else if (t > 0xFFFF) {
-+            *dstC++ = cache[SkGradientShaderBase::kCache32ClampUpper];
-+        } else {
-+            SkASSERT(t <= 0xFFFF);
-+            *dstC++ = cache[t >> SkGradientShaderBase::kCache32Shift];
-+        }
-         fx += dx;
-         fy += dy;
-         b += db;
--- 
-1.7.11.7
-
deleted file mode 100644
--- a/gfx/skia/patches/0008-Bug-848491-Re-apply-759683-Handle-compilers-that-don.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From: George Wright <gw@gwright.org.uk>
-Date: Thu, 25 Apr 2013 20:49:45 -0400
-Subject: Bug 848491 - Re-apply 759683 - Handle compilers that don't support SSSE3 intrinsics
-
-
-diff --git a/gfx/skia/src/opts/opts_check_SSE2.cpp b/gfx/skia/src/opts/opts_check_SSE2.cpp
-index 6370058..18f68d6 100644
---- a/gfx/skia/src/opts/opts_check_SSE2.cpp
-+++ b/gfx/skia/src/opts/opts_check_SSE2.cpp
-@@ -86,9 +86,13 @@ static inline bool hasSSSE3() {
- #else
- 
- static inline bool hasSSSE3() {
-+#if defined(SK_BUILD_SSSE3)
-     int cpu_info[4] = { 0 };
-     getcpuid(1, cpu_info);
-     return (cpu_info[2] & 0x200) != 0;
-+#else
-+    return false;
-+#endif
- }
- #endif
- 
-@@ -104,7 +108,7 @@ static bool cachedHasSSSE3() {
- 
- void SkBitmapProcState::platformProcs() {
-     if (cachedHasSSSE3()) {
--#if !defined(SK_BUILD_FOR_ANDROID)
-+#if !defined(SK_BUILD_FOR_ANDROID) && defined(SK_BUILD_SSSE3)
-         // Disable SSSE3 optimization for Android x86
-         if (fSampleProc32 == S32_opaque_D32_filter_DX) {
-             fSampleProc32 = S32_opaque_D32_filter_DX_SSSE3;
--- 
-1.7.11.7
-
deleted file mode 100644
--- a/gfx/skia/patches/0009-Bug-848491-Re-apply-bug-751418-Add-our-own-GrUserCon.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: George Wright <gw@gwright.org.uk>
-Date: Thu, 25 Apr 2013 20:52:32 -0400
-Subject: Bug 848491 - Re-apply bug 751418 - Add our own GrUserConfig
-
-
-diff --git a/gfx/skia/include/gpu/GrUserConfig.h b/gfx/skia/include/gpu/GrUserConfig.h
-index 11d4feb..77ab850 100644
---- a/gfx/skia/include/gpu/GrUserConfig.h
-+++ b/gfx/skia/include/gpu/GrUserConfig.h
-@@ -43,6 +43,10 @@
-  */
- //#define GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT 96
- 
-+/*
-+ * This allows us to set a callback to be called before each GL call to ensure
-+ * that our context is set correctly
-+ */
- #define GR_GL_PER_GL_FUNC_CALLBACK  1
- 
- #endif
--- 
-1.7.11.7
-
deleted file mode 100644
--- a/gfx/skia/patches/0010-Bug-848491-Re-apply-bug-817356-Patch-Skia-to-recogni.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: George Wright <gw@gwright.org.uk>
-Date: Thu, 25 Apr 2013 20:55:02 -0400
-Subject: Bug 848491 - Re-apply bug 817356 - Patch Skia to recognize uppercase PPC/PPC64.
-
-
-diff --git a/gfx/skia/include/core/SkPreConfig.h b/gfx/skia/include/core/SkPreConfig.h
-index 11cb223..7e95b99 100644
---- a/gfx/skia/include/core/SkPreConfig.h
-+++ b/gfx/skia/include/core/SkPreConfig.h
-@@ -99,7 +99,8 @@
- //////////////////////////////////////////////////////////////////////
- 
- #if !defined(SK_CPU_BENDIAN) && !defined(SK_CPU_LENDIAN)
--    #if defined (__ppc__) || defined(__ppc64__)
-+    #if defined (__ppc__) || defined(__PPC__) || defined(__ppc64__) \
-+        || defined(__PPC64__)
-         #define SK_CPU_BENDIAN
-     #else
-         #define SK_CPU_LENDIAN
--- 
-1.7.11.7
-
deleted file mode 100644
--- a/gfx/skia/patches/0022-Bug-848491-Re-apply-bug-795538-Ensure-we-use-the-cor.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From: George Wright <gwright@mozilla.com>
-Date: Thu, 20 Jun 2013 09:21:21 -0400
-Subject: Bug 848491 - Re-apply bug 795538 - Ensure we use the correct colour (and alpha) for the clamp values r=mattwoodrow
-
-
-diff --git a/gfx/skia/src/effects/gradients/SkGradientShader.cpp b/gfx/skia/src/effects/gradients/SkGradientShader.cpp
-index 27a9c46..ce077b5 100644
---- a/gfx/skia/src/effects/gradients/SkGradientShader.cpp
-+++ b/gfx/skia/src/effects/gradients/SkGradientShader.cpp
-@@ -500,15 +500,17 @@ const SkPMColor* SkGradientShaderBase::getCache32() const {
-     }
- 
-     // Write the clamp colours into the first and last entries of fCache32
--    fCache32[kCache32ClampLower] = SkPackARGB32(fCacheAlpha,
--                                                SkColorGetR(fOrigColors[0]),
--                                                SkColorGetG(fOrigColors[0]),
--                                                SkColorGetB(fOrigColors[0]));
--
--    fCache32[kCache32ClampUpper] = SkPackARGB32(fCacheAlpha,
--                                                SkColorGetR(fOrigColors[fColorCount - 1]),
--                                                SkColorGetG(fOrigColors[fColorCount - 1]),
--                                                SkColorGetB(fOrigColors[fColorCount - 1]));
-+    fCache32[kCache32ClampLower] = SkPremultiplyARGBInline(SkMulDiv255Round(SkColorGetA(fOrigColors[0]),
-+                                                                            fCacheAlpha),
-+                                                           SkColorGetR(fOrigColors[0]),
-+                                                           SkColorGetG(fOrigColors[0]),
-+                                                           SkColorGetB(fOrigColors[0]));
-+
-+    fCache32[kCache32ClampUpper] = SkPremultiplyARGBInline(SkMulDiv255Round(SkColorGetA(fOrigColors[fColorCount - 1]),
-+                                                                            fCacheAlpha),
-+                                                           SkColorGetR(fOrigColors[fColorCount - 1]),
-+                                                           SkColorGetG(fOrigColors[fColorCount - 1]),
-+                                                           SkColorGetB(fOrigColors[fColorCount - 1]));
- 
-     return fCache32;
- }
--- 
-1.7.11.7
-
deleted file mode 100644
--- a/gfx/skia/patches/0023-Bug-890539-Fix-SK_COMPILE_ASSERT-build-warning.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-# HG changeset patch
-# Parent e378875000890099fffcdb4cbc4ab12828ac34ee
-# User Daniel Holbert <dholbert@cs.stanford.edu>
-Bug 890539: Annotate SK_COMPILE_ASSERT's typedef as permissibly unused, to fix GCC 4.8 build warning. r=gw280
-
-diff --git a/gfx/skia/include/core/SkTypes.h b/gfx/skia/include/core/SkTypes.h
---- a/gfx/skia/include/core/SkTypes.h
-+++ b/gfx/skia/include/core/SkTypes.h
-@@ -121,18 +121,29 @@ inline void operator delete(void* p) {
-     #define SkDEVCODE(code)
-     #define SK_DEVELOPER_TO_STRING()
- #endif
- 
- template <bool>
- struct SkCompileAssert {
- };
- 
-+/*
-+ * The SK_COMPILE_ASSERT definition creates an otherwise-unused typedef.  This
-+ * triggers compiler warnings with some versions of gcc, so mark the typedef
-+ * as permissibly-unused to disable the warnings.
-+ */
-+#  if defined(__GNUC__)
-+#    define SK_COMPILE_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))
-+#  else
-+#    define SK_COMPILE_ASSERT_UNUSED_ATTRIBUTE /* nothing */
-+#  endif
-+
- #define SK_COMPILE_ASSERT(expr, msg) \
--    typedef SkCompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
-+    typedef SkCompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] SK_COMPILE_ASSERT_UNUSED_ATTRIBUTE
- 
- /*
-  *  Usage:  SK_MACRO_CONCAT(a, b)   to construct the symbol ab
-  *
-  *  SK_MACRO_CONCAT_IMPL_PRIV just exists to make this work. Do not use directly
-  *
-  */
- #define SK_MACRO_CONCAT(X, Y)           SK_MACRO_CONCAT_IMPL_PRIV(X, Y)
deleted file mode 100644
--- a/gfx/skia/patches/0024-Bug-887318-fix-bgra-readback.patch
+++ /dev/null
@@ -1,217 +0,0 @@
-diff --git a/gfx/gl/GLContextSkia.cpp b/gfx/gl/GLContextSkia.cpp
---- a/gfx/gl/GLContextSkia.cpp
-+++ b/gfx/gl/GLContextSkia.cpp
-@@ -303,39 +303,47 @@ const GLubyte* glGetString_mozilla(GrGLe
-     if (name == LOCAL_GL_VERSION) {
-         if (sGLContext.get()->IsGLES2()) {
-             return reinterpret_cast<const GLubyte*>("OpenGL ES 2.0");
-         } else {
-             return reinterpret_cast<const GLubyte*>("2.0");
-         }
-     } else if (name == LOCAL_GL_EXTENSIONS) {
-         // Only expose the bare minimum extensions we want to support to ensure a functional Ganesh
-         // as GLContext only exposes certain extensions
-         static bool extensionsStringBuilt = false;
--        static char extensionsString[120];
-+        static char extensionsString[256];
- 
-         if (!extensionsStringBuilt) {
-             if (sGLContext.get()->IsExtensionSupported(GLContext::EXT_texture_format_BGRA8888)) {
-                 strcpy(extensionsString, "GL_EXT_texture_format_BGRA8888 ");
-             }
- 
-             if (sGLContext.get()->IsExtensionSupported(GLContext::OES_packed_depth_stencil)) {
-                 strcat(extensionsString, "GL_OES_packed_depth_stencil ");
-             }
- 
-             if (sGLContext.get()->IsExtensionSupported(GLContext::EXT_packed_depth_stencil)) {
-                 strcat(extensionsString, "GL_EXT_packed_depth_stencil ");
-             }
- 
-             if (sGLContext.get()->IsExtensionSupported(GLContext::OES_rgb8_rgba8)) {
-                 strcat(extensionsString, "GL_OES_rgb8_rgba8 ");
-             }
- 
-+            if (sGLContext.get()->IsExtensionSupported(GLContext::EXT_bgra)) {
-+                strcat(extensionsString, "GL_EXT_bgra ");
-+            }
-+
-+            if (sGLContext.get()->IsExtensionSupported(GLContext::EXT_read_format_bgra)) {
-+                strcat(extensionsString, "GL_EXT_read_format_bgra ");
-+            }
-+
-             extensionsStringBuilt = true;
-         }
- 
-         return reinterpret_cast<const GLubyte*>(extensionsString);
- 
-     } else if (name == LOCAL_GL_SHADING_LANGUAGE_VERSION) {
-         if (sGLContext.get()->IsGLES2()) {
-             return reinterpret_cast<const GLubyte*>("OpenGL ES GLSL ES 1.0");
-         } else {
-             return reinterpret_cast<const GLubyte*>("1.10");
-diff --git a/gfx/skia/src/gpu/gl/GrGpuGL.cpp b/gfx/skia/src/gpu/gl/GrGpuGL.cpp
---- a/gfx/skia/src/gpu/gl/GrGpuGL.cpp
-+++ b/gfx/skia/src/gpu/gl/GrGpuGL.cpp
-@@ -1,18 +1,18 @@
- /*
-  * Copyright 2011 Google Inc.
-  *
-  * Use of this source code is governed by a BSD-style license that can be
-  * found in the LICENSE file.
-  */
- 
--
-+#include <algorithm>
- #include "GrGpuGL.h"
- #include "GrGLStencilBuffer.h"
- #include "GrGLPath.h"
- #include "GrGLShaderBuilder.h"
- #include "GrTemplates.h"
- #include "GrTypes.h"
- #include "SkTemplates.h"
- 
- static const GrGLuint GR_MAX_GLUINT = ~0U;
- static const GrGLint  GR_INVAL_GLINT = ~0;
-@@ -1381,29 +1381,67 @@ bool GrGpuGL::readPixelsWillPayForYFlip(
-     // Note the rowBytes might be tight to the passed in data, but if data
-     // gets clipped in x to the target the rowBytes will no longer be tight.
-     if (left >= 0 && (left + width) < renderTarget->width()) {
-            return 0 == rowBytes ||
-                   GrBytesPerPixel(config) * width == rowBytes;
-     } else {
-         return false;
-     }
- }
- 
-+static void swizzleRow(void* buffer, int byteLen) {
-+    uint8_t* src = (uint8_t*)buffer;
-+    uint8_t* end = src + byteLen;
-+
-+    GrAssert((end - src) % 4 == 0);
-+
-+    for (; src != end; src += 4) {
-+        std::swap(src[0], src[2]);
-+    }
-+}
-+
-+bool GrGpuGL::canReadBGRA() const
-+{
-+    if (kDesktop_GrGLBinding == this->glBinding() ||
-+        this->hasExtension("GL_EXT_bgra"))
-+        return true;
-+
-+    if (this->hasExtension("GL_EXT_read_format_bgra")) {
-+        GrGLint readFormat = 0;
-+        GrGLint readType = 0;
-+
-+        GL_CALL(GetIntegerv(GR_GL_IMPLEMENTATION_COLOR_READ_FORMAT, &readFormat));
-+        GL_CALL(GetIntegerv(GR_GL_IMPLEMENTATION_COLOR_READ_TYPE, &readType));
-+
-+        return readFormat == GR_GL_BGRA && readType == GR_GL_UNSIGNED_BYTE;
-+    }
-+
-+    return false;
-+}
-+
- bool GrGpuGL::onReadPixels(GrRenderTarget* target,
-                            int left, int top,
-                            int width, int height,
-                            GrPixelConfig config,
-                            void* buffer,
-                            size_t rowBytes) {
-     GrGLenum format;
-     GrGLenum type;
-     bool flipY = kBottomLeft_GrSurfaceOrigin == target->origin();
-+    bool needSwizzle = false;
-+
-+    if (kBGRA_8888_GrPixelConfig == config && !this->canReadBGRA()) {
-+        // Read RGBA and swizzle after
-+        config = kRGBA_8888_GrPixelConfig;
-+        needSwizzle = true;
-+    }
-+
-     if (!this->configToGLFormats(config, false, NULL, &format, &type)) {
-         return false;
-     }
-     size_t bpp = GrBytesPerPixel(config);
-     if (!adjust_pixel_ops_params(target->width(), target->height(), bpp,
-                                  &left, &top, &width, &height,
-                                  const_cast<const void**>(&buffer),
-                                  &rowBytes)) {
-         return false;
-     }
-@@ -1478,35 +1516,46 @@ bool GrGpuGL::onReadPixels(GrRenderTarge
-             scratch.reset(tightRowBytes);
-             void* tmpRow = scratch.get();
-             // flip y in-place by rows
-             const int halfY = height >> 1;
-             char* top = reinterpret_cast<char*>(buffer);
-             char* bottom = top + (height - 1) * rowBytes;
-             for (int y = 0; y < halfY; y++) {
-                 memcpy(tmpRow, top, tightRowBytes);
-                 memcpy(top, bottom, tightRowBytes);
-                 memcpy(bottom, tmpRow, tightRowBytes);
-+
-+                if (needSwizzle) {
-+                    swizzleRow(top, tightRowBytes);
-+                    swizzleRow(bottom, tightRowBytes);
-+                }
-+
-                 top += rowBytes;
-                 bottom -= rowBytes;
-             }
-         }
-     } else {
--        GrAssert(readDst != buffer);        GrAssert(rowBytes != tightRowBytes);
-+        GrAssert(readDst != buffer);
-+        GrAssert(rowBytes != tightRowBytes);
-         // copy from readDst to buffer while flipping y
-         // const int halfY = height >> 1;
-         const char* src = reinterpret_cast<const char*>(readDst);
-         char* dst = reinterpret_cast<char*>(buffer);
-         if (flipY) {
-             dst += (height-1) * rowBytes;
-         }
-         for (int y = 0; y < height; y++) {
-             memcpy(dst, src, tightRowBytes);
-+            if (needSwizzle) {
-+                swizzleRow(dst, tightRowBytes);
-+            }
-+
-             src += readDstRowBytes;
-             if (!flipY) {
-                 dst += rowBytes;
-             } else {
-                 dst -= rowBytes;
-             }
-         }
-     }
-     return true;
- }
-diff --git a/gfx/skia/src/gpu/gl/GrGpuGL.h b/gfx/skia/src/gpu/gl/GrGpuGL.h
---- a/gfx/skia/src/gpu/gl/GrGpuGL.h
-+++ b/gfx/skia/src/gpu/gl/GrGpuGL.h
-@@ -243,20 +243,22 @@ private:
-                        GrPixelConfig dataConfig,
-                        const void* data,
-                        size_t rowBytes);
- 
-     bool createRenderTargetObjects(int width, int height,
-                                    GrGLuint texID,
-                                    GrGLRenderTarget::Desc* desc);
- 
-     void fillInConfigRenderableTable();
- 
-+    bool canReadBGRA() const;
-+
-     GrGLContext fGLContext;
- 
-     // GL program-related state
-     ProgramCache*               fProgramCache;
-     SkAutoTUnref<GrGLProgram>   fCurrentProgram;
- 
-     ///////////////////////////////////////////////////////////////////////////
-     ///@name Caching of GL State
-     ///@{
-     int                         fHWActiveTextureUnitIdx;
deleted file mode 100644
--- a/gfx/skia/patches/0025-Bug-896049-Add-default-Value-SK_OVERRIDE.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/gfx/skia/include/core/SkPostConfig.h b/gfx/skia/include/core/SkPostConfig.h
---- a/gfx/skia/include/core/SkPostConfig.h
-+++ b/gfx/skia/include/core/SkPostConfig.h
-@@ -325,19 +325,19 @@
-             // Some documentation suggests we should be using __attribute__((override)),
-             // but it doesn't work.
-             #define SK_OVERRIDE override
-         #elif defined(__has_extension)
-             #if __has_extension(cxx_override_control)
-                 #define SK_OVERRIDE override
-             #endif
-         #endif
--    #else
--        // Linux GCC ignores "__attribute__((override))" and rejects "override".
--        #define SK_OVERRIDE
-+    #endif
-+    #ifndef SK_OVERRIDE
-+	#define SK_OVERRIDE
-     #endif
- #endif
- 
- //////////////////////////////////////////////////////////////////////
- 
- #ifndef SK_PRINTF_LIKE
- #if defined(__clang__) || defined(__GNUC__)
- #define SK_PRINTF_LIKE(A, B) __attribute__((format(printf, (A), (B))))
deleted file mode 100644
--- a/gfx/skia/patches/0026-Bug-901208-Fix-ARM-v4t.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-diff --git a/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp b/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp
---- a/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp
-+++ b/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp
-@@ -26,66 +26,78 @@ static void S32A_D565_Opaque(uint16_t* S
-     asm volatile (
-                   "1:                                   \n\t"
-                   "ldr     r3, [%[src]], #4             \n\t"
-                   "cmp     r3, #0xff000000              \n\t"
-                   "blo     2f                           \n\t"
-                   "and     r4, r3, #0x0000f8            \n\t"
-                   "and     r5, r3, #0x00fc00            \n\t"
-                   "and     r6, r3, #0xf80000            \n\t"
-+#ifdef SK_ARM_HAS_EDSP
-                   "pld     [r1, #32]                    \n\t"
-+#endif
-                   "lsl     r3, r4, #8                   \n\t"
-                   "orr     r3, r3, r5, lsr #5           \n\t"
-                   "orr     r3, r3, r6, lsr #19          \n\t"
-                   "subs    %[count], %[count], #1       \n\t"
-                   "strh    r3, [%[dst]], #2             \n\t"
-                   "bne     1b                           \n\t"
-                   "b       4f                           \n\t"
-                   "2:                                   \n\t"
-                   "lsrs    r7, r3, #24                  \n\t"
-                   "beq     3f                           \n\t"
-                   "ldrh    r4, [%[dst]]                 \n\t"
-                   "rsb     r7, r7, #255                 \n\t"
-                   "and     r6, r4, #0x001f              \n\t"
--#if SK_ARM_ARCH == 6
-+#if SK_ARM_ARCH <= 6
-                   "lsl     r5, r4, #21                  \n\t"
-                   "lsr     r5, r5, #26                  \n\t"
- #else
-                   "ubfx    r5, r4, #5, #6               \n\t"
- #endif
-+#ifdef SK_ARM_HAS_EDSP
-                   "pld     [r0, #16]                    \n\t"
-+#endif
-                   "lsr     r4, r4, #11                  \n\t"
- #ifdef SK_ARM_HAS_EDSP
-                   "smulbb  r6, r6, r7                   \n\t"
-                   "smulbb  r5, r5, r7                   \n\t"
-                   "smulbb  r4, r4, r7                   \n\t"
- #else
-                   "mul     r6, r6, r7                   \n\t"
-                   "mul     r5, r5, r7                   \n\t"
-                   "mul     r4, r4, r7                   \n\t"
- #endif
-+#if SK_ARM_ARCH >= 6
-                   "uxtb    r7, r3, ROR #16              \n\t"
-                   "uxtb    ip, r3, ROR #8               \n\t"
-+#else
-+                  "mov     ip, #0xff                    \n\t"
-+                  "and     r7, ip, r3, ROR #16          \n\t"
-+                  "and     ip, ip, r3, ROR #8           \n\t"
-+#endif
-                   "and     r3, r3, #0xff                \n\t"
-                   "add     r6, r6, #16                  \n\t"
-                   "add     r5, r5, #32                  \n\t"
-                   "add     r4, r4, #16                  \n\t"
-                   "add     r6, r6, r6, lsr #5           \n\t"
-                   "add     r5, r5, r5, lsr #6           \n\t"
-                   "add     r4, r4, r4, lsr #5           \n\t"
-                   "add     r6, r7, r6, lsr #5           \n\t"
-                   "add     r5, ip, r5, lsr #6           \n\t"
-                   "add     r4, r3, r4, lsr #5           \n\t"
-                   "lsr     r6, r6, #3                   \n\t"
-                   "and     r5, r5, #0xfc                \n\t"
-                   "and     r4, r4, #0xf8                \n\t"
-                   "orr     r6, r6, r5, lsl #3           \n\t"
-                   "orr     r4, r6, r4, lsl #8           \n\t"
-                   "strh    r4, [%[dst]], #2             \n\t"
-+#ifdef SK_ARM_HAS_EDSP
-                   "pld     [r1, #32]                    \n\t"
-+#endif
-                   "subs    %[count], %[count], #1       \n\t"
-                   "bne     1b                           \n\t"
-                   "b       4f                           \n\t"
-                   "3:                                   \n\t"
-                   "subs    %[count], %[count], #1       \n\t"
-                   "add     %[dst], %[dst], #2           \n\t"
-                   "bne     1b                           \n\t"
-                   "4:                                   \n\t"
deleted file mode 100644
--- a/gfx/skia/patches/0030-Bug-939629-Add-missing-include-guards.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-# HG changeset patch
-# Parent 979e60d9c09f22eb139643da6de7568b603e1aa1
-
-diff --git a/gfx/skia/include/images/SkImages.h b/gfx/skia/include/images/SkImages.h
---- a/gfx/skia/include/images/SkImages.h
-+++ b/gfx/skia/include/images/SkImages.h
-@@ -1,14 +1,19 @@
- /*
-  * Copyright 2012 Google Inc.
-  *
-  * Use of this source code is governed by a BSD-style license that can be
-  * found in the LICENSE file.
-  */
- 
-+#ifndef SkImages_DEFINED
-+#define SkImages_DEFINED
-+
- class SkImages {
- public:
-     /**
-      * Initializes flattenables in the images project.
-      */
-     static void InitializeFlattenables();
- };
-+
-+#endif
-diff --git a/gfx/skia/src/gpu/GrAAConvexPathRenderer.h b/gfx/skia/src/gpu/GrAAConvexPathRenderer.h
---- a/gfx/skia/src/gpu/GrAAConvexPathRenderer.h
-+++ b/gfx/skia/src/gpu/GrAAConvexPathRenderer.h
-@@ -1,16 +1,19 @@
- 
- /*
-  * Copyright 2012 Google Inc.
-  *
-  * Use of this source code is governed by a BSD-style license that can be
-  * found in the LICENSE file.
-  */
- 
-+#ifndef GrAAConvexPathRenderer_DEFINED
-+#define GrAAConvexPathRenderer_DEFINED
-+
- #include "GrPathRenderer.h"
- 
- 
- class GrAAConvexPathRenderer : public GrPathRenderer {
- public:
-     GrAAConvexPathRenderer();
- 
-     virtual bool canDrawPath(const SkPath& path,
-@@ -19,8 +22,10 @@ public:
-                              bool antiAlias) const SK_OVERRIDE;
- 
- protected:
-     virtual bool onDrawPath(const SkPath& path,
-                             const SkStrokeRec& stroke,
-                             GrDrawTarget* target,
-                             bool antiAlias) SK_OVERRIDE;
- };
-+
-+#endif
-diff --git a/gfx/skia/src/gpu/GrReducedClip.h b/gfx/skia/src/gpu/GrReducedClip.h
---- a/gfx/skia/src/gpu/GrReducedClip.h
-+++ b/gfx/skia/src/gpu/GrReducedClip.h
-@@ -1,16 +1,19 @@
- 
- /*
-  * Copyright 2012 Google Inc.
-  *
-  * Use of this source code is governed by a BSD-style license that can be
-  * found in the LICENSE file.
-  */
- 
-+#ifndef GrReducedClip_DEFINED
-+#define GrReducedClip_DEFINED
-+
- #include "SkClipStack.h"
- #include "SkTLList.h"
- 
- namespace GrReducedClip {
- 
- typedef SkTLList<SkClipStack::Element> ElementList;
- 
- enum InitialState {
-@@ -33,8 +36,10 @@ enum InitialState {
- void ReduceClipStack(const SkClipStack& stack,
-                      const SkIRect& queryBounds,
-                      ElementList* result,
-                      InitialState* initialState,
-                      SkIRect* tighterBounds = NULL,
-                      bool* requiresAA = NULL);
- 
- } // namespace GrReducedClip
-+
-+#endif
deleted file mode 100644
--- a/gfx/skia/patches/0031-Bug-945588-Add-include-guard.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-# HG changeset patch
-# User Ehsan Akhgari <ehsan@mozilla.com>
-
-Bug 945588 - Add include guards to SkConfig8888.h
-
-diff --git a/gfx/skia/src/core/SkConfig8888.h b/gfx/skia/src/core/SkConfig8888.h
-index 96eaef2..36bc9b4 100644
---- a/gfx/skia/src/core/SkConfig8888.h
-+++ b/gfx/skia/src/core/SkConfig8888.h
-@@ -1,16 +1,18 @@
- 
- /*
-  * Copyright 2011 Google Inc.
-  *
-  * Use of this source code is governed by a BSD-style license that can be
-  * found in the LICENSE file.
-  */
- 
-+#ifndef SkConfig8888_DEFINED
-+#define SkConfig8888_DEFINED
- 
- #include "SkCanvas.h"
- #include "SkColorPriv.h"
- 
- /**
-  * Converts pixels from one Config8888 to another Config8888
-  */
- void SkConvertConfig8888Pixels(uint32_t* dstPixels,
-@@ -69,8 +71,10 @@ static inline void SkCopyConfig8888ToBitmap(const SkBitmap& dstBmp,
-     int h = dstBmp.height();
-     size_t dstRowBytes = dstBmp.rowBytes();
-     uint32_t* dstPixels = reinterpret_cast<uint32_t*>(dstBmp.getPixels());
- 
-     SkConvertConfig8888Pixels(dstPixels, dstRowBytes, SkCanvas::kNative_Premul_Config8888, srcPixels, srcRowBytes, srcConfig8888, w, h);
- }
- 
- }
-+
-+#endif
deleted file mode 100644
--- a/gfx/skia/patches/0032-Bug-974900-More-missing-include-guards.patch
+++ /dev/null
@@ -1,148 +0,0 @@
-# HG changeset patch
-# Parent c8288d0c7a1544a590a0cac9c39397ac10c8a45b
-Bug 974900 - Add missing include guards to Skia headers - r=gw280
-
-diff --git a/gfx/skia/trunk/include/images/SkImages.h b/gfx/skia/trunk/include/images/SkImages.h
---- a/gfx/skia/trunk/include/images/SkImages.h
-+++ b/gfx/skia/trunk/include/images/SkImages.h
-@@ -1,14 +1,19 @@
- /*
-  * Copyright 2012 Google Inc.
-  *
-  * Use of this source code is governed by a BSD-style license that can be
-  * found in the LICENSE file.
-  */
- 
-+#ifndef SkImages_DEFINED
-+#define SkImages_DEFINED
-+
- class SkImages {
- public:
-     /**
-      * Initializes flattenables in the images project.
-      */
-     static void InitializeFlattenables();
- };
-+
-+#endif
-diff --git a/gfx/skia/trunk/src/core/SkConvolver.h b/gfx/skia/trunk/src/core/SkConvolver.h
---- a/gfx/skia/trunk/src/core/SkConvolver.h
-+++ b/gfx/skia/trunk/src/core/SkConvolver.h
-@@ -8,16 +8,18 @@
- #include "SkSize.h"
- #include "SkTypes.h"
- #include "SkTArray.h"
- 
- // avoid confusion with Mac OS X's math library (Carbon)
- #if defined(__APPLE__)
- #undef FloatToConvolutionFixed
- #undef ConvolutionFixedToFloat
-+#undef FloatToFixed
-+#undef FixedToFloat
- #endif
- 
- // Represents a filter in one dimension. Each output pixel has one entry in this
- // object for the filter values contributing to it. You build up the filter
- // list by calling AddFilter for each output pixel (in order).
- //
- // We do 2-dimensional convolution by first convolving each row by one
- // SkConvolutionFilter1D, then convolving each column by another one.
-diff --git a/gfx/skia/trunk/src/gpu/GrAAConvexPathRenderer.h b/gfx/skia/trunk/src/gpu/GrAAConvexPathRenderer.h
---- a/gfx/skia/trunk/src/gpu/GrAAConvexPathRenderer.h
-+++ b/gfx/skia/trunk/src/gpu/GrAAConvexPathRenderer.h
-@@ -3,24 +3,28 @@
-  * Copyright 2012 Google Inc.
-  *
-  * Use of this source code is governed by a BSD-style license that can be
-  * found in the LICENSE file.
-  */
- 
- #include "GrPathRenderer.h"
- 
-+#ifndef GrAAConvexPathRenderer_DEFINED
-+#define GrAAConvexPathRenderer_DEFINED
- 
- class GrAAConvexPathRenderer : public GrPathRenderer {
- public:
-     GrAAConvexPathRenderer();
- 
-     virtual bool canDrawPath(const SkPath& path,
-                              const SkStrokeRec& stroke,
-                              const GrDrawTarget* target,
-                              bool antiAlias) const SK_OVERRIDE;
- 
- protected:
-     virtual bool onDrawPath(const SkPath& path,
-                             const SkStrokeRec& stroke,
-                             GrDrawTarget* target,
-                             bool antiAlias) SK_OVERRIDE;
- };
-+
-+#endif
-diff --git a/gfx/skia/trunk/src/gpu/GrReducedClip.h b/gfx/skia/trunk/src/gpu/GrReducedClip.h
---- a/gfx/skia/trunk/src/gpu/GrReducedClip.h
-+++ b/gfx/skia/trunk/src/gpu/GrReducedClip.h
-@@ -1,16 +1,19 @@
- 
- /*
-  * Copyright 2012 Google Inc.
-  *
-  * Use of this source code is governed by a BSD-style license that can be
-  * found in the LICENSE file.
-  */
- 
-+#ifndef GrReducedClip_DEFINED
-+#define GrReducedClip_DEFINED
-+
- #include "SkClipStack.h"
- #include "SkTLList.h"
- 
- namespace GrReducedClip {
- 
- typedef SkTLList<SkClipStack::Element> ElementList;
- 
- enum InitialState {
-@@ -36,8 +39,10 @@ SK_API void ReduceClipStack(const SkClip
-                             const SkIRect& queryBounds,
-                             ElementList* result,
-                             int32_t* resultGenID,
-                             InitialState* initialState,
-                             SkIRect* tighterBounds = NULL,
-                             bool* requiresAA = NULL);
- 
- } // namespace GrReducedClip
-+
-+#endif
-diff --git a/gfx/skia/trunk/src/pathops/SkLineParameters.h b/gfx/skia/trunk/src/pathops/SkLineParameters.h
---- a/gfx/skia/trunk/src/pathops/SkLineParameters.h
-+++ b/gfx/skia/trunk/src/pathops/SkLineParameters.h
-@@ -1,14 +1,18 @@
- /*
-  * Copyright 2012 Google Inc.
-  *
-  * Use of this source code is governed by a BSD-style license that can be
-  * found in the LICENSE file.
-  */
-+
-+#ifndef SkLineParameters_DEFINED
-+#define SkLineParameters_DEFINED
-+
- #include "SkPathOpsCubic.h"
- #include "SkPathOpsLine.h"
- #include "SkPathOpsQuad.h"
- 
- // Sources
- // computer-aided design - volume 22 number 9 november 1990 pp 538 - 549
- // online at http://cagd.cs.byu.edu/~tom/papers/bezclip.pdf
- 
-@@ -164,8 +168,10 @@ public:
-         return -a;
-     }
- 
- private:
-     double a;
-     double b;
-     double c;
- };
-+
-+#endif
deleted file mode 100644
--- a/gfx/skia/patches/0033-Bug-974900-undef-interface-windows.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-# HG changeset patch
-# Parent b12f9a408740aa5fd93c296a7d41e1b5f54c1b20
-Bug 974900 - #undef interface defined by windows headers - r=gw280
-
-diff --git a/gfx/skia/trunk/src/gpu/gl/GrGLCaps.h b/gfx/skia/trunk/src/gpu/gl/GrGLCaps.h
---- a/gfx/skia/trunk/src/gpu/gl/GrGLCaps.h
-+++ b/gfx/skia/trunk/src/gpu/gl/GrGLCaps.h
-@@ -9,16 +9,19 @@
- #ifndef GrGLCaps_DEFINED
- #define GrGLCaps_DEFINED
- 
- #include "GrDrawTargetCaps.h"
- #include "GrGLStencilBuffer.h"
- #include "SkTArray.h"
- #include "SkTDArray.h"
- 
-+// defined in Windows headers
-+#undef interface
-+
- class GrGLContextInfo;
- 
- /**
-  * Stores some capabilities of a GL context. Most are determined by the GL
-  * version and the extensions string. It also tracks formats that have passed
-  * the FBO completeness test.
-  */
- class GrGLCaps : public GrDrawTargetCaps {
--- a/gfx/skia/patches/README
+++ b/gfx/skia/patches/README
@@ -1,15 +1,2 @@
-This directory contains the patches currently applied against upstream Skia.
-The original patches are archived in archive/
-
-See the relevant bugs in bugzilla for information on these patches:
-
-0001-Bug-777614-Re-add-our-SkUserConfig.h-r-nrc.patch
-0004-Bug-777614-Re-apply-bug-719872-Fix-crash-on-Android-.patch
-0005-Bug-777614-Re-apply-bug-687188-Expand-the-gradient-c.patch
-0009-Bug-777614-Re-apply-759683-Handle-compilers-that-don.patch
-0018-Bug-817356-PPC-defines.patch
-0010-Bug-836892-Add-new-blending-modes-to-SkXfermode.patch
-0011-Bug-839347-no-anon-namespace-around-SkNO_RETURN_HINT.patch
-0012-Bug-751418-Add-our-own-GrUserConfig-r-mattwoodrow.patch
-0013-Bug-751418-Fix-compile-error-on-gcc-in-Skia-GL-r-mat.patch
-0031-Bug-945588-Add-include-guard.patch
+We no longer keep a local patch queue of patches against upstream. The protocol now
+is to upstream all patches before they are landed in mozilla-central.
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0001-Bug-895086-Remove-unused-find_from_uniqueID-function.patch
@@ -0,0 +1,38 @@
+From 58861c38751adf1f4ef3f67f8e85f5c36f1c43a5 Mon Sep 17 00:00:00 2001
+From: George Wright <gw@gwright.org.uk>
+Date: Wed, 17 Jul 2013 16:28:07 -0400
+Subject: [PATCH] Bug 895086 - Remove unused find_from_uniqueID() function from
+ SkFontHost_linux
+
+---
+ gfx/skia/src/ports/SkFontHost_linux.cpp | 14 --------------
+ 1 file changed, 14 deletions(-)
+
+diff --git a/gfx/skia/src/ports/SkFontHost_linux.cpp b/gfx/skia/src/ports/SkFontHost_linux.cpp
+index df21014..05b73dc 100644
+--- a/gfx/skia/src/ports/SkFontHost_linux.cpp
++++ b/gfx/skia/src/ports/SkFontHost_linux.cpp
+@@ -117,20 +117,6 @@ static FamilyRec* find_family(const SkTypeface* member) {
+     return NULL;
+ }
+ 
+-static SkTypeface* find_from_uniqueID(uint32_t uniqueID) {
+-    FamilyRec* curr = gFamilyHead;
+-    while (curr != NULL) {
+-        for (int i = 0; i < 4; i++) {
+-            SkTypeface* face = curr->fFaces[i];
+-            if (face != NULL && face->uniqueID() == uniqueID) {
+-                return face;
+-            }
+-        }
+-        curr = curr->fNext;
+-    }
+-    return NULL;
+-}
+-
+ /*  Remove reference to this face from its family. If the resulting family
+  is empty (has no faces), return that family, otherwise return NULL
+  */
+-- 
+1.8.3.1
+
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0002-Bug-848491-Re-apply-Bug-795549-Move-TileProc-functio.patch
@@ -0,0 +1,50 @@
+From: George Wright <george@mozilla.com>
+Date: Mon, 14 Jan 2013 17:59:09 -0500
+Subject: Bug 848491 - Re-apply Bug 795549 - Move TileProc functions into their own file to ensure they only exist once in a library
+
+
+diff --git a/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h b/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h
+index b9dbf1b..729ce4e 100644
+--- a/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h
++++ b/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h
+@@ -37,34 +37,9 @@ static inline void sk_memset32_dither(uint32_t dst[], uint32_t v0, uint32_t v1,
+     }
+ }
+ 
+-//  Clamp
+-
+-static inline SkFixed clamp_tileproc(SkFixed x) {
+-    return SkClampMax(x, 0xFFFF);
+-}
+-
+-// Repeat
+-
+-static inline SkFixed repeat_tileproc(SkFixed x) {
+-    return x & 0xFFFF;
+-}
+-
+-// Mirror
+-
+-// Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly.
+-// See http://code.google.com/p/skia/issues/detail?id=472
+-#if defined(_MSC_VER) && (_MSC_VER >= 1600)
+-#pragma optimize("", off)
+-#endif
+-
+-static inline SkFixed mirror_tileproc(SkFixed x) {
+-    int s = x << 15 >> 31;
+-    return (x ^ s) & 0xFFFF;
+-}
+-
+-#if defined(_MSC_VER) && (_MSC_VER >= 1600)
+-#pragma optimize("", on)
+-#endif
++SkFixed clamp_tileproc(SkFixed x);
++SkFixed repeat_tileproc(SkFixed x);
++SkFixed mirror_tileproc(SkFixed x);
+ 
+ ///////////////////////////////////////////////////////////////////////////////
+ 
+-- 
+1.7.11.7
+
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0005-Bug-736276-Add-a-new-SkFontHost-that-takes-a-cairo_s.patch
@@ -0,0 +1,472 @@
+From: George Wright <george@mozilla.com>
+Date: Wed, 1 Aug 2012 16:43:15 -0400
+Subject: Bug 736276 - Add a new SkFontHost that takes a cairo_scaled_font_t r=karl
+
+
+diff --git a/gfx/skia/Makefile.in b/gfx/skia/Makefile.in
+index 5ebbd2e..7c8cdbf 100644
+--- a/gfx/skia/Makefile.in
++++ b/gfx/skia/Makefile.in
+@@ -60,15 +60,15 @@ VPATH += \
+ 	$(NULL)
+ 
+ ifeq (android,$(MOZ_WIDGET_TOOLKIT))
+-OS_CXXFLAGS += $(CAIRO_FT_CFLAGS)
++OS_CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(CAIRO_FT_CFLAGS)
+ endif
+ 
+ ifeq (gtk2,$(MOZ_WIDGET_TOOLKIT))
+-OS_CXXFLAGS += $(MOZ_PANGO_CFLAGS)
++OS_CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(MOZ_PANGO_CFLAGS) $(CAIRO_FT_CFLAGS)
+ endif
+ 
+ ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
+-OS_CXXFLAGS += $(MOZ_PANGO_CFLAGS)
++OS_CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(MOZ_PANGO_CFLAGS) $(CAIRO_FT_CFLAGS)
+ ifeq (Linux,$(OS_TARGET))
+ DEFINES += -DSK_USE_POSIX_THREADS=1
+ endif
+diff --git a/gfx/skia/include/ports/SkTypeface_cairo.h b/gfx/skia/include/ports/SkTypeface_cairo.h
+new file mode 100644
+index 0000000..7e44f04
+--- /dev/null
++++ b/gfx/skia/include/ports/SkTypeface_cairo.h
+@@ -0,0 +1,11 @@
++#ifndef SkTypeface_cairo_DEFINED
++#define SkTypeface_cairo_DEFINED
++
++#include <cairo.h>
++
++#include "SkTypeface.h"
++
++SK_API extern SkTypeface* SkCreateTypefaceFromCairoFont(cairo_font_face_t* fontFace, SkTypeface::Style style, bool isFixedWidth);
++
++#endif
++
+diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build
+index 9ceba59..66efd52 100644
+--- a/gfx/skia/moz.build
++++ b/gfx/skia/moz.build
+@@ -171,10 +171,12 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+         'SkTime_win.cpp',
+     ]
+ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk2':
++    EXPORTS.skia += [
++        'include/ports/SkTypeface_cairo.h',
++    ]
+     CPP_SOURCES += [
+-        'SkFontHost_FreeType.cpp',
++        'SkFontHost_cairo.cpp',
+         'SkFontHost_FreeType_common.cpp',
+-        'SkFontHost_linux.cpp',
+         'SkThread_pthread.cpp',
+         'SkThreadUtils_pthread.cpp',
+         'SkThreadUtils_pthread_linux.cpp',
+@@ -183,14 +185,15 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk2':
+     ]
+ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
+     CPP_SOURCES += [
+-        'SkFontHost_FreeType.cpp',
++        'SkFontHost_cairo.cpp',
+         'SkFontHost_FreeType_common.cpp',
+         'SkOSFile.cpp',
+     ]
+     if CONFIG['OS_TARGET'] == 'Linux':
++        EXPORTS.skia += [
++            'include/ports/SkTypeface_cairo.h',
++        ]
+         CPP_SOURCES += [
+-            'SkFontHost_linux.cpp',
+-            'SkFontHost_tables.cpp',
+             'SkThread_pthread.cpp',
+             'SkThreadUtils_pthread.cpp',
+             'SkThreadUtils_pthread_linux.cpp',
+@@ -204,11 +207,13 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
+ # Separate 'if' from above, since the else below applies to all != 'android'
+ # toolkits.
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
++    EXPORTS.skia += [
++        'include/ports/SkTypeface_cairo.h',
++    ]
+     CPP_SOURCES += [
+         'ashmem.cpp',
+         'SkDebug_android.cpp',
+-        'SkFontHost_android_old.cpp',
+-        'SkFontHost_FreeType.cpp',
++        'SkFontHost_cairo.cpp',
+         'SkFontHost_FreeType_common.cpp',
+         'SkImageRef_ashmem.cpp',
+         'SkTime_Unix.cpp',
+diff --git a/gfx/skia/src/ports/SkFontHost_cairo.cpp b/gfx/skia/src/ports/SkFontHost_cairo.cpp
+new file mode 100644
+index 0000000..bb5b778
+--- /dev/null
++++ b/gfx/skia/src/ports/SkFontHost_cairo.cpp
+@@ -0,0 +1,364 @@
++
++/*
++ * Copyright 2012 Mozilla Foundation
++ *
++ * Use of this source code is governed by a BSD-style license that can be
++ * found in the LICENSE file.
++ */
++
++#include "cairo.h"
++#include "cairo-ft.h"
++
++#include "SkFontHost_FreeType_common.h"
++
++#include "SkAdvancedTypefaceMetrics.h"
++#include "SkFontHost.h"
++#include "SkPath.h"
++#include "SkScalerContext.h"
++#include "SkTypefaceCache.h"
++
++#include <ft2build.h>
++#include FT_FREETYPE_H
++
++static cairo_user_data_key_t kSkTypefaceKey;
++
++class SkScalerContext_CairoFT : public SkScalerContext_FreeType_Base {
++public:
++    SkScalerContext_CairoFT(SkTypeface* typeface, const SkDescriptor* desc);
++    virtual ~SkScalerContext_CairoFT();
++
++protected:
++    virtual unsigned generateGlyphCount() SK_OVERRIDE;
++    virtual uint16_t generateCharToGlyph(SkUnichar uniChar) SK_OVERRIDE;
++    virtual void generateAdvance(SkGlyph* glyph) SK_OVERRIDE;
++    virtual void generateMetrics(SkGlyph* glyph) SK_OVERRIDE;
++    virtual void generateImage(const SkGlyph& glyph) SK_OVERRIDE;
++    virtual void generatePath(const SkGlyph& glyph, SkPath* path) SK_OVERRIDE;
++    virtual void generateFontMetrics(SkPaint::FontMetrics* mx,
++                                     SkPaint::FontMetrics* my) SK_OVERRIDE;
++    virtual SkUnichar generateGlyphToChar(uint16_t glyph) SK_OVERRIDE;
++private:
++    cairo_scaled_font_t* fScaledFont;
++    uint32_t fLoadGlyphFlags;
++};
++
++class CairoLockedFTFace {
++public:
++    CairoLockedFTFace(cairo_scaled_font_t* scaledFont)
++        : fScaledFont(scaledFont)
++        , fFace(cairo_ft_scaled_font_lock_face(scaledFont))
++    {}
++
++    ~CairoLockedFTFace()
++    {
++        cairo_ft_scaled_font_unlock_face(fScaledFont);
++    }
++
++    FT_Face getFace()
++    {
++        return fFace;
++    }
++
++private:
++    cairo_scaled_font_t* fScaledFont;
++    FT_Face fFace;
++};
++
++class SkCairoFTTypeface : public SkTypeface {
++public:
++    static SkTypeface* CreateTypeface(cairo_font_face_t* fontFace, SkTypeface::Style style, bool isFixedWidth) {
++        SkASSERT(fontFace != NULL);
++        SkASSERT(cairo_font_face_get_type(fontFace) == CAIRO_FONT_TYPE_FT);
++
++        SkFontID newId = SkTypefaceCache::NewFontID();
++
++        return SkNEW_ARGS(SkCairoFTTypeface, (fontFace, style, newId, isFixedWidth));
++    }
++
++    cairo_font_face_t* getFontFace() {
++        return fFontFace;
++    }
++
++    virtual SkStream* onOpenStream(int*) const SK_OVERRIDE { return NULL; }
++
++    virtual SkAdvancedTypefaceMetrics*
++        onGetAdvancedTypefaceMetrics(SkAdvancedTypefaceMetrics::PerGlyphInfo,
++                                     const uint32_t*, uint32_t) const SK_OVERRIDE
++    {
++        SkDEBUGCODE(SkDebugf("SkCairoFTTypeface::onGetAdvancedTypefaceMetrics unimplemented\n"));
++        return NULL;
++    }
++
++    virtual SkScalerContext* onCreateScalerContext(const SkDescriptor* desc) const SK_OVERRIDE
++    {
++        return SkNEW_ARGS(SkScalerContext_CairoFT, (const_cast<SkCairoFTTypeface*>(this), desc));
++    }
++
++    virtual void onFilterRec(SkScalerContextRec*) const SK_OVERRIDE
++    {
++        SkDEBUGCODE(SkDebugf("SkCairoFTTypeface::onFilterRec unimplemented\n"));
++    }
++
++    virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE
++    {
++        SkDEBUGCODE(SkDebugf("SkCairoFTTypeface::onGetFontDescriptor unimplemented\n"));
++    }
++
++
++private:
++
++    SkCairoFTTypeface(cairo_font_face_t* fontFace, SkTypeface::Style style, SkFontID id, bool isFixedWidth)
++        : SkTypeface(style, id, isFixedWidth)
++        , fFontFace(fontFace)
++    {
++        cairo_font_face_set_user_data(fFontFace, &kSkTypefaceKey, this, NULL);
++        cairo_font_face_reference(fFontFace);
++    }
++
++    ~SkCairoFTTypeface()
++    {
++        cairo_font_face_set_user_data(fFontFace, &kSkTypefaceKey, NULL, NULL);
++        cairo_font_face_destroy(fFontFace);
++    }
++
++    cairo_font_face_t* fFontFace;
++};
++
++SkTypeface* SkCreateTypefaceFromCairoFont(cairo_font_face_t* fontFace, SkTypeface::Style style, bool isFixedWidth)
++{
++    SkTypeface* typeface = reinterpret_cast<SkTypeface*>(cairo_font_face_get_user_data(fontFace, &kSkTypefaceKey));
++
++    if (typeface) {
++        typeface->ref();
++    } else {
++        typeface = SkCairoFTTypeface::CreateTypeface(fontFace, style, isFixedWidth);
++        SkTypefaceCache::Add(typeface, style);
++    }
++
++    return typeface;
++}
++
++SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
++                                     const char famillyName[],
++                                     SkTypeface::Style style)
++{
++    SkDEBUGFAIL("SkFontHost::FindTypeface unimplemented");
++    return NULL;
++}
++
++SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream*)
++{
++    SkDEBUGFAIL("SkFontHost::CreateTypeface unimplemented");
++    return NULL;
++}
++
++SkTypeface* SkFontHost::CreateTypefaceFromFile(char const*)
++{
++    SkDEBUGFAIL("SkFontHost::CreateTypefaceFromFile unimplemented");
++    return NULL;
++}
++
++///////////////////////////////////////////////////////////////////////////////
++
++static bool isLCD(const SkScalerContext::Rec& rec) {
++    switch (rec.fMaskFormat) {
++        case SkMask::kLCD16_Format:
++        case SkMask::kLCD32_Format:
++            return true;
++        default:
++            return false;
++    }
++}
++
++///////////////////////////////////////////////////////////////////////////////
++SkScalerContext_CairoFT::SkScalerContext_CairoFT(SkTypeface* typeface, const SkDescriptor* desc)
++    : SkScalerContext_FreeType_Base(typeface, desc)
++{
++    SkMatrix matrix;
++    fRec.getSingleMatrix(&matrix);
++
++    cairo_font_face_t* fontFace = static_cast<SkCairoFTTypeface*>(typeface)->getFontFace();
++
++    cairo_matrix_t fontMatrix, ctMatrix;
++    cairo_matrix_init(&fontMatrix, matrix.getScaleX(), matrix.getSkewY(), matrix.getSkewX(), matrix.getScaleY(), 0.0, 0.0);
++    cairo_matrix_init_scale(&ctMatrix, 1.0, 1.0);
++
++    // We need to ensure that the font options match for hinting, as generateMetrics()
++    // uses the fScaledFont which uses these font options
++    cairo_font_options_t *fontOptions = cairo_font_options_create();
++
++    FT_Int32 loadFlags = FT_LOAD_DEFAULT;
++
++    if (SkMask::kBW_Format == fRec.fMaskFormat) {
++        // See http://code.google.com/p/chromium/issues/detail?id=43252#c24
++        loadFlags = FT_LOAD_TARGET_MONO;
++        if (fRec.getHinting() == SkPaint::kNo_Hinting) {
++            cairo_font_options_set_hint_style(fontOptions, CAIRO_HINT_STYLE_NONE);
++            loadFlags = FT_LOAD_NO_HINTING;
++        }
++    } else {
++        switch (fRec.getHinting()) {
++        case SkPaint::kNo_Hinting:
++            loadFlags = FT_LOAD_NO_HINTING;
++            cairo_font_options_set_hint_style(fontOptions, CAIRO_HINT_STYLE_NONE);
++            break;
++        case SkPaint::kSlight_Hinting:
++            loadFlags = FT_LOAD_TARGET_LIGHT;  // This implies FORCE_AUTOHINT
++            cairo_font_options_set_hint_style(fontOptions, CAIRO_HINT_STYLE_SLIGHT);
++            break;
++        case SkPaint::kNormal_Hinting:
++            cairo_font_options_set_hint_style(fontOptions, CAIRO_HINT_STYLE_MEDIUM);
++            if (fRec.fFlags & SkScalerContext::kAutohinting_Flag) {
++                loadFlags = FT_LOAD_FORCE_AUTOHINT;
++            }
++            break;
++        case SkPaint::kFull_Hinting:
++            cairo_font_options_set_hint_style(fontOptions, CAIRO_HINT_STYLE_FULL);
++            if (fRec.fFlags & SkScalerContext::kAutohinting_Flag) {
++                loadFlags = FT_LOAD_FORCE_AUTOHINT;
++            }
++            if (isLCD(fRec)) {
++                if (SkToBool(fRec.fFlags & SkScalerContext::kLCD_Vertical_Flag)) {
++                    loadFlags = FT_LOAD_TARGET_LCD_V;
++                } else {
++                    loadFlags = FT_LOAD_TARGET_LCD;
++                }
++            }
++            break;
++        default:
++            SkDebugf("---------- UNKNOWN hinting %d\n", fRec.getHinting());
++            break;
++        }
++    }
++
++    fScaledFont = cairo_scaled_font_create(fontFace, &fontMatrix, &ctMatrix, fontOptions);
++
++    if ((fRec.fFlags & SkScalerContext::kEmbeddedBitmapText_Flag) == 0) {
++        loadFlags |= FT_LOAD_NO_BITMAP;
++    }
++
++    // Always using FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH to get correct
++    // advances, as fontconfig and cairo do.
++    // See http://code.google.com/p/skia/issues/detail?id=222.
++    loadFlags |= FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH;
++
++    fLoadGlyphFlags = loadFlags;
++}
++
++SkScalerContext_CairoFT::~SkScalerContext_CairoFT()
++{
++    cairo_scaled_font_destroy(fScaledFont);
++}
++
++unsigned SkScalerContext_CairoFT::generateGlyphCount()
++{
++    CairoLockedFTFace faceLock(fScaledFont);
++    return faceLock.getFace()->num_glyphs;
++}
++
++uint16_t SkScalerContext_CairoFT::generateCharToGlyph(SkUnichar uniChar)
++{
++    CairoLockedFTFace faceLock(fScaledFont);
++    return SkToU16(FT_Get_Char_Index(faceLock.getFace(), uniChar));
++}
++
++void SkScalerContext_CairoFT::generateAdvance(SkGlyph* glyph)
++{
++    generateMetrics(glyph);
++}
++
++void SkScalerContext_CairoFT::generateMetrics(SkGlyph* glyph)
++{
++    SkASSERT(fScaledFont != NULL);
++    cairo_text_extents_t extents;
++    cairo_glyph_t cairoGlyph = { glyph->getGlyphID(fBaseGlyphCount), 0.0, 0.0 };
++    cairo_scaled_font_glyph_extents(fScaledFont, &cairoGlyph, 1, &extents);
++
++    glyph->fAdvanceX = SkDoubleToFixed(extents.x_advance);
++    glyph->fAdvanceY = SkDoubleToFixed(extents.y_advance);
++    glyph->fWidth = SkToU16(SkScalarCeil(extents.width));
++    glyph->fHeight = SkToU16(SkScalarCeil(extents.height));
++    glyph->fLeft = SkToS16(SkScalarCeil(extents.x_bearing));
++    glyph->fTop = SkToS16(SkScalarCeil(extents.y_bearing));
++    glyph->fLsbDelta = 0;
++    glyph->fRsbDelta = 0;
++}
++
++void SkScalerContext_CairoFT::generateImage(const SkGlyph& glyph)
++{
++    SkASSERT(fScaledFont != NULL);
++    CairoLockedFTFace faceLock(fScaledFont);
++    FT_Face face = faceLock.getFace();
++
++    FT_Error err = FT_Load_Glyph(face, glyph.getGlyphID(fBaseGlyphCount), fLoadGlyphFlags);
++
++    if (err != 0) {
++        memset(glyph.fImage, 0, glyph.rowBytes() * glyph.fHeight);
++        return;
++    }
++
++    generateGlyphImage(face, glyph);
++}
++
++void SkScalerContext_CairoFT::generatePath(const SkGlyph& glyph, SkPath* path)
++{
++    SkASSERT(fScaledFont != NULL);
++    CairoLockedFTFace faceLock(fScaledFont);
++    FT_Face face = faceLock.getFace();
++
++    SkASSERT(&glyph && path);
++
++    uint32_t flags = fLoadGlyphFlags;
++    flags |= FT_LOAD_NO_BITMAP; // ignore embedded bitmaps so we're sure to get the outline
++    flags &= ~FT_LOAD_RENDER;   // don't scan convert (we just want the outline)
++
++    FT_Error err = FT_Load_Glyph(face, glyph.getGlyphID(fBaseGlyphCount), flags);
++
++    if (err != 0) {
++        path->reset();
++        return;
++    }
++
++    generateGlyphPath(face, path);
++}
++
++void SkScalerContext_CairoFT::generateFontMetrics(SkPaint::FontMetrics* mx,
++                                                  SkPaint::FontMetrics* my)
++{
++    SkDEBUGCODE(SkDebugf("SkScalerContext_CairoFT::generateFontMetrics unimplemented\n"));
++}
++
++SkUnichar SkScalerContext_CairoFT::generateGlyphToChar(uint16_t glyph)
++{
++    SkASSERT(fScaledFont != NULL);
++    CairoLockedFTFace faceLock(fScaledFont);
++    FT_Face face = faceLock.getFace();
++
++    FT_UInt glyphIndex;
++    SkUnichar charCode = FT_Get_First_Char(face, &glyphIndex);
++    while (glyphIndex != 0) {
++        if (glyphIndex == glyph) {
++            return charCode;
++        }
++        charCode = FT_Get_Next_Char(face, charCode, &glyphIndex);
++    }
++
++    return 0;
++}
++
++#ifdef SK_BUILD_FOR_ANDROID
++SkTypeface* SkAndroidNextLogicalTypeface(SkFontID currFontID,
++                                         SkFontID origFontID) {
++    return NULL;
++}
++#endif
++
++///////////////////////////////////////////////////////////////////////////////
++
++#include "SkFontMgr.h"
++
++SkFontMgr* SkFontMgr::Factory() {
++    // todo
++    return NULL;
++}
++
+-- 
+1.7.11.7
+
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0006-Bug-848491-Re-apply-Bug-777614-Add-our-SkUserConfig..patch
@@ -0,0 +1,27 @@
+From: George Wright <gw@gwright.org.uk>
+Date: Thu, 25 Apr 2013 20:40:12 -0400
+Subject: Bug 848491 - Re-apply Bug 777614 - Add our SkUserConfig.h
+
+
+diff --git a/gfx/skia/include/config/SkUserConfig.h b/gfx/skia/include/config/SkUserConfig.h
+index 63fc90d..c965e91 100644
+--- a/gfx/skia/include/config/SkUserConfig.h
++++ b/gfx/skia/include/config/SkUserConfig.h
+@@ -201,4 +201,14 @@
+  */
+ //#define SK_SUPPORT_GPU 1
+ 
++/*  Don't dither 32bit gradients, to match what the canvas test suite expects.
++ */
++#define SK_DISABLE_DITHER_32BIT_GRADIENT
++
++/*  Don't include stdint.h on windows as it conflicts with our build system.
++ */
++#ifdef SK_BUILD_FOR_WIN32 
++    #define SK_IGNORE_STDINT_DOT_H 
++#endif 
++
+ #endif
+-- 
+1.7.11.7
+
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0007-Bug-848491-Re-apply-bug-687188-Expand-the-gradient-c.patch
@@ -0,0 +1,168 @@
+From: George Wright <gw@gwright.org.uk>
+Date: Thu, 25 Apr 2013 20:47:06 -0400
+Subject: Bug 848491 - Re-apply bug 687188 - Expand the gradient cache by 2 to store 0/1 colour stop values for clamping.
+
+
+diff --git a/gfx/skia/src/effects/gradients/SkGradientShader.cpp b/gfx/skia/src/effects/gradients/SkGradientShader.cpp
+index 684355d..27a9c46 100644
+--- a/gfx/skia/src/effects/gradients/SkGradientShader.cpp
++++ b/gfx/skia/src/effects/gradients/SkGradientShader.cpp
+@@ -453,15 +453,15 @@ const uint16_t* SkGradientShaderBase::getCache16() const {
+ 
+ const SkPMColor* SkGradientShaderBase::getCache32() const {
+     if (fCache32 == NULL) {
+-        // double the count for dither entries
+-        const int entryCount = kCache32Count * 4;
++        // double the count for dither entries, and have an extra two entries for clamp values
++        const int entryCount = kCache32Count * 4 + 2;
+         const size_t allocSize = sizeof(SkPMColor) * entryCount;
+ 
+         if (NULL == fCache32PixelRef) {
+             fCache32PixelRef = SkNEW_ARGS(SkMallocPixelRef,
+                                           (NULL, allocSize, NULL));
+         }
+-        fCache32 = (SkPMColor*)fCache32PixelRef->getAddr();
++        fCache32 = (SkPMColor*)fCache32PixelRef->getAddr() + 1;
+         if (fColorCount == 2) {
+             Build32bitCache(fCache32, fOrigColors[0], fOrigColors[1],
+                             kCache32Count, fCacheAlpha);
+@@ -484,7 +484,7 @@ const SkPMColor* SkGradientShaderBase::getCache32() const {
+             SkMallocPixelRef* newPR = SkNEW_ARGS(SkMallocPixelRef,
+                                                  (NULL, allocSize, NULL));
+             SkPMColor* linear = fCache32;           // just computed linear data
+-            SkPMColor* mapped = (SkPMColor*)newPR->getAddr();    // storage for mapped data
++            SkPMColor* mapped = (SkPMColor*)newPR->getAddr() + 1;    // storage for mapped data
+             SkUnitMapper* map = fMapper;
+             for (int i = 0; i < kCache32Count; i++) {
+                 int index = map->mapUnit16((i << 8) | i) >> 8;
+@@ -495,9 +495,21 @@ const SkPMColor* SkGradientShaderBase::getCache32() const {
+             }
+             fCache32PixelRef->unref();
+             fCache32PixelRef = newPR;
+-            fCache32 = (SkPMColor*)newPR->getAddr();
++            fCache32 = (SkPMColor*)newPR->getAddr() + 1;
+         }
+     }
++
++    // Write the clamp colours into the first and last entries of fCache32
++    fCache32[kCache32ClampLower] = SkPackARGB32(fCacheAlpha,
++                                                SkColorGetR(fOrigColors[0]),
++                                                SkColorGetG(fOrigColors[0]),
++                                                SkColorGetB(fOrigColors[0]));
++
++    fCache32[kCache32ClampUpper] = SkPackARGB32(fCacheAlpha,
++                                                SkColorGetR(fOrigColors[fColorCount - 1]),
++                                                SkColorGetG(fOrigColors[fColorCount - 1]),
++                                                SkColorGetB(fOrigColors[fColorCount - 1]));
++
+     return fCache32;
+ }
+ 
+diff --git a/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h b/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h
+index 729ce4e..2cb6a9d 100644
+--- a/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h
++++ b/gfx/skia/src/effects/gradients/SkGradientShaderPriv.h
+@@ -86,6 +86,9 @@ public:
+         /// if dithering is disabled.
+         kDitherStride32 = kCache32Count,
+         kDitherStride16 = kCache16Count,
++
++        kCache32ClampLower = -1,
++        kCache32ClampUpper = kCache32Count * 4
+     };
+ 
+ 
+diff --git a/gfx/skia/src/effects/gradients/SkLinearGradient.cpp b/gfx/skia/src/effects/gradients/SkLinearGradient.cpp
+index e0f216c..40ab918 100644
+--- a/gfx/skia/src/effects/gradients/SkLinearGradient.cpp
++++ b/gfx/skia/src/effects/gradients/SkLinearGradient.cpp
+@@ -127,6 +127,17 @@ void shadeSpan_linear_vertical_lerp(TileProc proc, SkFixed dx, SkFixed fx,
+                                     SkPMColor* SK_RESTRICT dstC,
+                                     const SkPMColor* SK_RESTRICT cache,
+                                     int toggle, int count) {
++    if (proc == clamp_tileproc) {
++        // No need to lerp or dither for clamp values
++        if (fx < 0) {
++            sk_memset32(dstC, cache[SkGradientShaderBase::kCache32ClampLower], count);
++            return;
++        } else if (fx > 0xffff) {
++            sk_memset32(dstC, cache[SkGradientShaderBase::kCache32ClampUpper], count);
++            return;
++        }
++    }
++
+     // We're a vertical gradient, so no change in a span.
+     // If colors change sharply across the gradient, dithering is
+     // insufficient (it subsamples the color space) and we need to lerp.
+@@ -154,10 +165,7 @@ void shadeSpan_linear_clamp(TileProc proc, SkFixed dx, SkFixed fx,
+     range.init(fx, dx, count, 0, SkGradientShaderBase::kCache32Count - 1);
+ 
+     if ((count = range.fCount0) > 0) {
+-        sk_memset32_dither(dstC,
+-            cache[toggle + range.fV0],
+-            cache[next_dither_toggle(toggle) + range.fV0],
+-            count);
++        sk_memset32(dstC, cache[SkGradientShaderBase::kCache32ClampLower], count);
+         dstC += count;
+     }
+     if ((count = range.fCount1) > 0) {
+@@ -176,10 +184,7 @@ void shadeSpan_linear_clamp(TileProc proc, SkFixed dx, SkFixed fx,
+         }
+     }
+     if ((count = range.fCount2) > 0) {
+-        sk_memset32_dither(dstC,
+-            cache[toggle + range.fV1],
+-            cache[next_dither_toggle(toggle) + range.fV1],
+-            count);
++        sk_memset32(dstC, cache[SkGradientShaderBase::kCache32ClampUpper], count);
+     }
+ }
+ 
+diff --git a/gfx/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp b/gfx/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp
+index abd974b..601fff4 100644
+--- a/gfx/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp
++++ b/gfx/skia/src/effects/gradients/SkTwoPointConicalGradient.cpp
+@@ -124,10 +124,14 @@ static void twopoint_clamp(TwoPtRadial* rec, SkPMColor* SK_RESTRICT dstC,
+         if (TwoPtRadial::DontDrawT(t)) {
+             *dstC++ = 0;
+         } else {
+-            SkFixed index = SkClampMax(t, 0xFFFF);
+-            SkASSERT(index <= 0xFFFF);
+-            *dstC++ = cache[toggle +
+-                            (index >> SkGradientShaderBase::kCache32Shift)];
++            if (t < 0) {
++                *dstC++ = cache[SkGradientShaderBase::kCache32ClampLower];
++            } else if (t > 0xFFFF) {
++                *dstC++ = cache[SkGradientShaderBase::kCache32ClampUpper];
++            } else {
++                SkASSERT(t <= 0xFFFF);
++                *dstC++ = cache[t >> SkGradientShaderBase::kCache32Shift];
++            }
+         }
+         toggle = next_dither_toggle(toggle);
+     }
+diff --git a/gfx/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp b/gfx/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp
+index f70b67d..ec2ae75 100644
+--- a/gfx/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp
++++ b/gfx/skia/src/effects/gradients/SkTwoPointRadialGradient.cpp
+@@ -120,9 +120,14 @@ void shadeSpan_twopoint_clamp(SkScalar fx, SkScalar dx,
+     for (; count > 0; --count) {
+         SkFixed t = two_point_radial(b, fx, fy, fSr2D2, foura,
+                                      fOneOverTwoA, posRoot);
+-        SkFixed index = SkClampMax(t, 0xFFFF);
+-        SkASSERT(index <= 0xFFFF);
+-        *dstC++ = cache[index >> SkGradientShaderBase::kCache32Shift];
++        if (t < 0) {
++            *dstC++ = cache[SkGradientShaderBase::kCache32ClampLower];
++        } else if (t > 0xFFFF) {
++            *dstC++ = cache[SkGradientShaderBase::kCache32ClampUpper];
++        } else {
++            SkASSERT(t <= 0xFFFF);
++            *dstC++ = cache[t >> SkGradientShaderBase::kCache32Shift];
++        }
+         fx += dx;
+         fy += dy;
+         b += db;
+-- 
+1.7.11.7
+
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0008-Bug-848491-Re-apply-759683-Handle-compilers-that-don.patch
@@ -0,0 +1,35 @@
+From: George Wright <gw@gwright.org.uk>
+Date: Thu, 25 Apr 2013 20:49:45 -0400
+Subject: Bug 848491 - Re-apply 759683 - Handle compilers that don't support SSSE3 intrinsics
+
+
+diff --git a/gfx/skia/src/opts/opts_check_SSE2.cpp b/gfx/skia/src/opts/opts_check_SSE2.cpp
+index 6370058..18f68d6 100644
+--- a/gfx/skia/src/opts/opts_check_SSE2.cpp
++++ b/gfx/skia/src/opts/opts_check_SSE2.cpp
+@@ -86,9 +86,13 @@ static inline bool hasSSSE3() {
+ #else
+ 
+ static inline bool hasSSSE3() {
++#if defined(SK_BUILD_SSSE3)
+     int cpu_info[4] = { 0 };
+     getcpuid(1, cpu_info);
+     return (cpu_info[2] & 0x200) != 0;
++#else
++    return false;
++#endif
+ }
+ #endif
+ 
+@@ -104,7 +108,7 @@ static bool cachedHasSSSE3() {
+ 
+ void SkBitmapProcState::platformProcs() {
+     if (cachedHasSSSE3()) {
+-#if !defined(SK_BUILD_FOR_ANDROID)
++#if !defined(SK_BUILD_FOR_ANDROID) && defined(SK_BUILD_SSSE3)
+         // Disable SSSE3 optimization for Android x86
+         if (fSampleProc32 == S32_opaque_D32_filter_DX) {
+             fSampleProc32 = S32_opaque_D32_filter_DX_SSSE3;
+-- 
+1.7.11.7
+
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0009-Bug-848491-Re-apply-bug-751418-Add-our-own-GrUserCon.patch
@@ -0,0 +1,23 @@
+From: George Wright <gw@gwright.org.uk>
+Date: Thu, 25 Apr 2013 20:52:32 -0400
+Subject: Bug 848491 - Re-apply bug 751418 - Add our own GrUserConfig
+
+
+diff --git a/gfx/skia/include/gpu/GrUserConfig.h b/gfx/skia/include/gpu/GrUserConfig.h
+index 11d4feb..77ab850 100644
+--- a/gfx/skia/include/gpu/GrUserConfig.h
++++ b/gfx/skia/include/gpu/GrUserConfig.h
+@@ -43,6 +43,10 @@
+  */
+ //#define GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT 96
+ 
++/*
++ * This allows us to set a callback to be called before each GL call to ensure
++ * that our context is set correctly
++ */
+ #define GR_GL_PER_GL_FUNC_CALLBACK  1
+ 
+ #endif
+-- 
+1.7.11.7
+
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0010-Bug-848491-Re-apply-bug-817356-Patch-Skia-to-recogni.patch
@@ -0,0 +1,22 @@
+From: George Wright <gw@gwright.org.uk>
+Date: Thu, 25 Apr 2013 20:55:02 -0400
+Subject: Bug 848491 - Re-apply bug 817356 - Patch Skia to recognize uppercase PPC/PPC64.
+
+
+diff --git a/gfx/skia/include/core/SkPreConfig.h b/gfx/skia/include/core/SkPreConfig.h
+index 11cb223..7e95b99 100644
+--- a/gfx/skia/include/core/SkPreConfig.h
++++ b/gfx/skia/include/core/SkPreConfig.h
+@@ -99,7 +99,8 @@
+ //////////////////////////////////////////////////////////////////////
+ 
+ #if !defined(SK_CPU_BENDIAN) && !defined(SK_CPU_LENDIAN)
+-    #if defined (__ppc__) || defined(__ppc64__)
++    #if defined (__ppc__) || defined(__PPC__) || defined(__ppc64__) \
++        || defined(__PPC64__)
+         #define SK_CPU_BENDIAN
+     #else
+         #define SK_CPU_LENDIAN
+-- 
+1.7.11.7
+
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0022-Bug-848491-Re-apply-bug-795538-Ensure-we-use-the-cor.patch
@@ -0,0 +1,39 @@
+From: George Wright <gwright@mozilla.com>
+Date: Thu, 20 Jun 2013 09:21:21 -0400
+Subject: Bug 848491 - Re-apply bug 795538 - Ensure we use the correct colour (and alpha) for the clamp values r=mattwoodrow
+
+
+diff --git a/gfx/skia/src/effects/gradients/SkGradientShader.cpp b/gfx/skia/src/effects/gradients/SkGradientShader.cpp
+index 27a9c46..ce077b5 100644
+--- a/gfx/skia/src/effects/gradients/SkGradientShader.cpp
++++ b/gfx/skia/src/effects/gradients/SkGradientShader.cpp
+@@ -500,15 +500,17 @@ const SkPMColor* SkGradientShaderBase::getCache32() const {
+     }
+ 
+     // Write the clamp colours into the first and last entries of fCache32
+-    fCache32[kCache32ClampLower] = SkPackARGB32(fCacheAlpha,
+-                                                SkColorGetR(fOrigColors[0]),
+-                                                SkColorGetG(fOrigColors[0]),
+-                                                SkColorGetB(fOrigColors[0]));
+-
+-    fCache32[kCache32ClampUpper] = SkPackARGB32(fCacheAlpha,
+-                                                SkColorGetR(fOrigColors[fColorCount - 1]),
+-                                                SkColorGetG(fOrigColors[fColorCount - 1]),
+-                                                SkColorGetB(fOrigColors[fColorCount - 1]));
++    fCache32[kCache32ClampLower] = SkPremultiplyARGBInline(SkMulDiv255Round(SkColorGetA(fOrigColors[0]),
++                                                                            fCacheAlpha),
++                                                           SkColorGetR(fOrigColors[0]),
++                                                           SkColorGetG(fOrigColors[0]),
++                                                           SkColorGetB(fOrigColors[0]));
++
++    fCache32[kCache32ClampUpper] = SkPremultiplyARGBInline(SkMulDiv255Round(SkColorGetA(fOrigColors[fColorCount - 1]),
++                                                                            fCacheAlpha),
++                                                           SkColorGetR(fOrigColors[fColorCount - 1]),
++                                                           SkColorGetG(fOrigColors[fColorCount - 1]),
++                                                           SkColorGetB(fOrigColors[fColorCount - 1]));
+ 
+     return fCache32;
+ }
+-- 
+1.7.11.7
+
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0023-Bug-890539-Fix-SK_COMPILE_ASSERT-build-warning.patch
@@ -0,0 +1,39 @@
+# HG changeset patch
+# Parent e378875000890099fffcdb4cbc4ab12828ac34ee
+# User Daniel Holbert <dholbert@cs.stanford.edu>
+Bug 890539: Annotate SK_COMPILE_ASSERT's typedef as permissibly unused, to fix GCC 4.8 build warning. r=gw280
+
+diff --git a/gfx/skia/include/core/SkTypes.h b/gfx/skia/include/core/SkTypes.h
+--- a/gfx/skia/include/core/SkTypes.h
++++ b/gfx/skia/include/core/SkTypes.h
+@@ -121,18 +121,29 @@ inline void operator delete(void* p) {
+     #define SkDEVCODE(code)
+     #define SK_DEVELOPER_TO_STRING()
+ #endif
+ 
+ template <bool>
+ struct SkCompileAssert {
+ };
+ 
++/*
++ * The SK_COMPILE_ASSERT definition creates an otherwise-unused typedef.  This
++ * triggers compiler warnings with some versions of gcc, so mark the typedef
++ * as permissibly-unused to disable the warnings.
++ */
++#  if defined(__GNUC__)
++#    define SK_COMPILE_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))
++#  else
++#    define SK_COMPILE_ASSERT_UNUSED_ATTRIBUTE /* nothing */
++#  endif
++
+ #define SK_COMPILE_ASSERT(expr, msg) \
+-    typedef SkCompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
++    typedef SkCompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] SK_COMPILE_ASSERT_UNUSED_ATTRIBUTE
+ 
+ /*
+  *  Usage:  SK_MACRO_CONCAT(a, b)   to construct the symbol ab
+  *
+  *  SK_MACRO_CONCAT_IMPL_PRIV just exists to make this work. Do not use directly
+  *
+  */
+ #define SK_MACRO_CONCAT(X, Y)           SK_MACRO_CONCAT_IMPL_PRIV(X, Y)
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0024-Bug-887318-fix-bgra-readback.patch
@@ -0,0 +1,217 @@
+diff --git a/gfx/gl/GLContextSkia.cpp b/gfx/gl/GLContextSkia.cpp
+--- a/gfx/gl/GLContextSkia.cpp
++++ b/gfx/gl/GLContextSkia.cpp
+@@ -303,39 +303,47 @@ const GLubyte* glGetString_mozilla(GrGLe
+     if (name == LOCAL_GL_VERSION) {
+         if (sGLContext.get()->IsGLES2()) {
+             return reinterpret_cast<const GLubyte*>("OpenGL ES 2.0");
+         } else {
+             return reinterpret_cast<const GLubyte*>("2.0");
+         }
+     } else if (name == LOCAL_GL_EXTENSIONS) {
+         // Only expose the bare minimum extensions we want to support to ensure a functional Ganesh
+         // as GLContext only exposes certain extensions
+         static bool extensionsStringBuilt = false;
+-        static char extensionsString[120];
++        static char extensionsString[256];
+ 
+         if (!extensionsStringBuilt) {
+             if (sGLContext.get()->IsExtensionSupported(GLContext::EXT_texture_format_BGRA8888)) {
+                 strcpy(extensionsString, "GL_EXT_texture_format_BGRA8888 ");
+             }
+ 
+             if (sGLContext.get()->IsExtensionSupported(GLContext::OES_packed_depth_stencil)) {
+                 strcat(extensionsString, "GL_OES_packed_depth_stencil ");
+             }
+ 
+             if (sGLContext.get()->IsExtensionSupported(GLContext::EXT_packed_depth_stencil)) {
+                 strcat(extensionsString, "GL_EXT_packed_depth_stencil ");
+             }
+ 
+             if (sGLContext.get()->IsExtensionSupported(GLContext::OES_rgb8_rgba8)) {
+                 strcat(extensionsString, "GL_OES_rgb8_rgba8 ");
+             }
+ 
++            if (sGLContext.get()->IsExtensionSupported(GLContext::EXT_bgra)) {
++                strcat(extensionsString, "GL_EXT_bgra ");
++            }
++
++            if (sGLContext.get()->IsExtensionSupported(GLContext::EXT_read_format_bgra)) {
++                strcat(extensionsString, "GL_EXT_read_format_bgra ");
++            }
++
+             extensionsStringBuilt = true;
+         }
+ 
+         return reinterpret_cast<const GLubyte*>(extensionsString);
+ 
+     } else if (name == LOCAL_GL_SHADING_LANGUAGE_VERSION) {
+         if (sGLContext.get()->IsGLES2()) {
+             return reinterpret_cast<const GLubyte*>("OpenGL ES GLSL ES 1.0");
+         } else {
+             return reinterpret_cast<const GLubyte*>("1.10");
+diff --git a/gfx/skia/src/gpu/gl/GrGpuGL.cpp b/gfx/skia/src/gpu/gl/GrGpuGL.cpp
+--- a/gfx/skia/src/gpu/gl/GrGpuGL.cpp
++++ b/gfx/skia/src/gpu/gl/GrGpuGL.cpp
+@@ -1,18 +1,18 @@
+ /*
+  * Copyright 2011 Google Inc.
+  *
+  * Use of this source code is governed by a BSD-style license that can be
+  * found in the LICENSE file.
+  */
+ 
+-
++#include <algorithm>
+ #include "GrGpuGL.h"
+ #include "GrGLStencilBuffer.h"
+ #include "GrGLPath.h"
+ #include "GrGLShaderBuilder.h"
+ #include "GrTemplates.h"
+ #include "GrTypes.h"
+ #include "SkTemplates.h"
+ 
+ static const GrGLuint GR_MAX_GLUINT = ~0U;
+ static const GrGLint  GR_INVAL_GLINT = ~0;
+@@ -1381,29 +1381,67 @@ bool GrGpuGL::readPixelsWillPayForYFlip(
+     // Note the rowBytes might be tight to the passed in data, but if data
+     // gets clipped in x to the target the rowBytes will no longer be tight.
+     if (left >= 0 && (left + width) < renderTarget->width()) {
+            return 0 == rowBytes ||
+                   GrBytesPerPixel(config) * width == rowBytes;
+     } else {
+         return false;
+     }
+ }
+ 
++static void swizzleRow(void* buffer, int byteLen) {
++    uint8_t* src = (uint8_t*)buffer;
++    uint8_t* end = src + byteLen;
++
++    GrAssert((end - src) % 4 == 0);
++
++    for (; src != end; src += 4) {
++        std::swap(src[0], src[2]);
++    }
++}
++
++bool GrGpuGL::canReadBGRA() const
++{
++    if (kDesktop_GrGLBinding == this->glBinding() ||
++        this->hasExtension("GL_EXT_bgra"))
++        return true;
++
++    if (this->hasExtension("GL_EXT_read_format_bgra")) {
++        GrGLint readFormat = 0;
++        GrGLint readType = 0;
++
++        GL_CALL(GetIntegerv(GR_GL_IMPLEMENTATION_COLOR_READ_FORMAT, &readFormat));
++        GL_CALL(GetIntegerv(GR_GL_IMPLEMENTATION_COLOR_READ_TYPE, &readType));
++
++        return readFormat == GR_GL_BGRA && readType == GR_GL_UNSIGNED_BYTE;
++    }
++
++    return false;
++}
++
+ bool GrGpuGL::onReadPixels(GrRenderTarget* target,
+                            int left, int top,
+                            int width, int height,
+                            GrPixelConfig config,
+                            void* buffer,
+                            size_t rowBytes) {
+     GrGLenum format;
+     GrGLenum type;
+     bool flipY = kBottomLeft_GrSurfaceOrigin == target->origin();
++    bool needSwizzle = false;
++
++    if (kBGRA_8888_GrPixelConfig == config && !this->canReadBGRA()) {
++        // Read RGBA and swizzle after
++        config = kRGBA_8888_GrPixelConfig;
++        needSwizzle = true;
++    }
++
+     if (!this->configToGLFormats(config, false, NULL, &format, &type)) {
+         return false;
+     }
+     size_t bpp = GrBytesPerPixel(config);
+     if (!adjust_pixel_ops_params(target->width(), target->height(), bpp,
+                                  &left, &top, &width, &height,
+                                  const_cast<const void**>(&buffer),
+                                  &rowBytes)) {
+         return false;
+     }
+@@ -1478,35 +1516,46 @@ bool GrGpuGL::onReadPixels(GrRenderTarge
+             scratch.reset(tightRowBytes);
+             void* tmpRow = scratch.get();
+             // flip y in-place by rows
+             const int halfY = height >> 1;
+             char* top = reinterpret_cast<char*>(buffer);
+             char* bottom = top + (height - 1) * rowBytes;
+             for (int y = 0; y < halfY; y++) {
+                 memcpy(tmpRow, top, tightRowBytes);
+                 memcpy(top, bottom, tightRowBytes);
+                 memcpy(bottom, tmpRow, tightRowBytes);
++
++                if (needSwizzle) {
++                    swizzleRow(top, tightRowBytes);
++                    swizzleRow(bottom, tightRowBytes);
++                }
++
+                 top += rowBytes;
+                 bottom -= rowBytes;
+             }
+         }
+     } else {
+-        GrAssert(readDst != buffer);        GrAssert(rowBytes != tightRowBytes);
++        GrAssert(readDst != buffer);
++        GrAssert(rowBytes != tightRowBytes);
+         // copy from readDst to buffer while flipping y
+         // const int halfY = height >> 1;
+         const char* src = reinterpret_cast<const char*>(readDst);
+         char* dst = reinterpret_cast<char*>(buffer);
+         if (flipY) {
+             dst += (height-1) * rowBytes;
+         }
+         for (int y = 0; y < height; y++) {
+             memcpy(dst, src, tightRowBytes);
++            if (needSwizzle) {
++                swizzleRow(dst, tightRowBytes);
++            }
++
+             src += readDstRowBytes;
+             if (!flipY) {
+                 dst += rowBytes;
+             } else {
+                 dst -= rowBytes;
+             }
+         }
+     }
+     return true;
+ }
+diff --git a/gfx/skia/src/gpu/gl/GrGpuGL.h b/gfx/skia/src/gpu/gl/GrGpuGL.h
+--- a/gfx/skia/src/gpu/gl/GrGpuGL.h
++++ b/gfx/skia/src/gpu/gl/GrGpuGL.h
+@@ -243,20 +243,22 @@ private:
+                        GrPixelConfig dataConfig,
+                        const void* data,
+                        size_t rowBytes);
+ 
+     bool createRenderTargetObjects(int width, int height,
+                                    GrGLuint texID,
+                                    GrGLRenderTarget::Desc* desc);
+ 
+     void fillInConfigRenderableTable();
+ 
++    bool canReadBGRA() const;
++
+     GrGLContext fGLContext;
+ 
+     // GL program-related state
+     ProgramCache*               fProgramCache;
+     SkAutoTUnref<GrGLProgram>   fCurrentProgram;
+ 
+     ///////////////////////////////////////////////////////////////////////////
+     ///@name Caching of GL State
+     ///@{
+     int                         fHWActiveTextureUnitIdx;
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0025-Bug-896049-Add-default-Value-SK_OVERRIDE.patch
@@ -0,0 +1,26 @@
+diff --git a/gfx/skia/include/core/SkPostConfig.h b/gfx/skia/include/core/SkPostConfig.h
+--- a/gfx/skia/include/core/SkPostConfig.h
++++ b/gfx/skia/include/core/SkPostConfig.h
+@@ -325,19 +325,19 @@
+             // Some documentation suggests we should be using __attribute__((override)),
+             // but it doesn't work.
+             #define SK_OVERRIDE override
+         #elif defined(__has_extension)
+             #if __has_extension(cxx_override_control)
+                 #define SK_OVERRIDE override
+             #endif
+         #endif
+-    #else
+-        // Linux GCC ignores "__attribute__((override))" and rejects "override".
+-        #define SK_OVERRIDE
++    #endif
++    #ifndef SK_OVERRIDE
++	#define SK_OVERRIDE
+     #endif
+ #endif
+ 
+ //////////////////////////////////////////////////////////////////////
+ 
+ #ifndef SK_PRINTF_LIKE
+ #if defined(__clang__) || defined(__GNUC__)
+ #define SK_PRINTF_LIKE(A, B) __attribute__((format(printf, (A), (B))))
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0026-Bug-901208-Fix-ARM-v4t.patch
@@ -0,0 +1,83 @@
+diff --git a/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp b/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp
+--- a/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp
++++ b/gfx/skia/src/opts/SkBlitRow_opts_arm.cpp
+@@ -26,66 +26,78 @@ static void S32A_D565_Opaque(uint16_t* S
+     asm volatile (
+                   "1:                                   \n\t"
+                   "ldr     r3, [%[src]], #4             \n\t"
+                   "cmp     r3, #0xff000000              \n\t"
+                   "blo     2f                           \n\t"
+                   "and     r4, r3, #0x0000f8            \n\t"
+                   "and     r5, r3, #0x00fc00            \n\t"
+                   "and     r6, r3, #0xf80000            \n\t"
++#ifdef SK_ARM_HAS_EDSP
+                   "pld     [r1, #32]                    \n\t"
++#endif
+                   "lsl     r3, r4, #8                   \n\t"
+                   "orr     r3, r3, r5, lsr #5           \n\t"
+                   "orr     r3, r3, r6, lsr #19          \n\t"
+                   "subs    %[count], %[count], #1       \n\t"
+                   "strh    r3, [%[dst]], #2             \n\t"
+                   "bne     1b                           \n\t"
+                   "b       4f                           \n\t"
+                   "2:                                   \n\t"
+                   "lsrs    r7, r3, #24                  \n\t"
+                   "beq     3f                           \n\t"
+                   "ldrh    r4, [%[dst]]                 \n\t"
+                   "rsb     r7, r7, #255                 \n\t"
+                   "and     r6, r4, #0x001f              \n\t"
+-#if SK_ARM_ARCH == 6
++#if SK_ARM_ARCH <= 6
+                   "lsl     r5, r4, #21                  \n\t"
+                   "lsr     r5, r5, #26                  \n\t"
+ #else
+                   "ubfx    r5, r4, #5, #6               \n\t"
+ #endif
++#ifdef SK_ARM_HAS_EDSP
+                   "pld     [r0, #16]                    \n\t"
++#endif
+                   "lsr     r4, r4, #11                  \n\t"
+ #ifdef SK_ARM_HAS_EDSP
+                   "smulbb  r6, r6, r7                   \n\t"
+                   "smulbb  r5, r5, r7                   \n\t"
+                   "smulbb  r4, r4, r7                   \n\t"
+ #else
+                   "mul     r6, r6, r7                   \n\t"
+                   "mul     r5, r5, r7                   \n\t"
+                   "mul     r4, r4, r7                   \n\t"
+ #endif
++#if SK_ARM_ARCH >= 6
+                   "uxtb    r7, r3, ROR #16              \n\t"
+                   "uxtb    ip, r3, ROR #8               \n\t"
++#else
++                  "mov     ip, #0xff                    \n\t"
++                  "and     r7, ip, r3, ROR #16          \n\t"
++                  "and     ip, ip, r3, ROR #8           \n\t"
++#endif
+                   "and     r3, r3, #0xff                \n\t"
+                   "add     r6, r6, #16                  \n\t"
+                   "add     r5, r5, #32                  \n\t"
+                   "add     r4, r4, #16                  \n\t"
+                   "add     r6, r6, r6, lsr #5           \n\t"
+                   "add     r5, r5, r5, lsr #6           \n\t"
+                   "add     r4, r4, r4, lsr #5           \n\t"
+                   "add     r6, r7, r6, lsr #5           \n\t"
+                   "add     r5, ip, r5, lsr #6           \n\t"
+                   "add     r4, r3, r4, lsr #5           \n\t"
+                   "lsr     r6, r6, #3                   \n\t"
+                   "and     r5, r5, #0xfc                \n\t"
+                   "and     r4, r4, #0xf8                \n\t"
+                   "orr     r6, r6, r5, lsl #3           \n\t"
+                   "orr     r4, r6, r4, lsl #8           \n\t"
+                   "strh    r4, [%[dst]], #2             \n\t"
++#ifdef SK_ARM_HAS_EDSP
+                   "pld     [r1, #32]                    \n\t"
++#endif
+                   "subs    %[count], %[count], #1       \n\t"
+                   "bne     1b                           \n\t"
+                   "b       4f                           \n\t"
+                   "3:                                   \n\t"
+                   "subs    %[count], %[count], #1       \n\t"
+                   "add     %[dst], %[dst], #2           \n\t"
+                   "bne     1b                           \n\t"
+                   "4:                                   \n\t"
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0030-Bug-939629-Add-missing-include-guards.patch
@@ -0,0 +1,94 @@
+# HG changeset patch
+# Parent 979e60d9c09f22eb139643da6de7568b603e1aa1
+
+diff --git a/gfx/skia/include/images/SkImages.h b/gfx/skia/include/images/SkImages.h
+--- a/gfx/skia/include/images/SkImages.h
++++ b/gfx/skia/include/images/SkImages.h
+@@ -1,14 +1,19 @@
+ /*
+  * Copyright 2012 Google Inc.
+  *
+  * Use of this source code is governed by a BSD-style license that can be
+  * found in the LICENSE file.
+  */
+ 
++#ifndef SkImages_DEFINED
++#define SkImages_DEFINED
++
+ class SkImages {
+ public:
+     /**
+      * Initializes flattenables in the images project.
+      */
+     static void InitializeFlattenables();
+ };
++
++#endif
+diff --git a/gfx/skia/src/gpu/GrAAConvexPathRenderer.h b/gfx/skia/src/gpu/GrAAConvexPathRenderer.h
+--- a/gfx/skia/src/gpu/GrAAConvexPathRenderer.h
++++ b/gfx/skia/src/gpu/GrAAConvexPathRenderer.h
+@@ -1,16 +1,19 @@
+ 
+ /*
+  * Copyright 2012 Google Inc.
+  *
+  * Use of this source code is governed by a BSD-style license that can be
+  * found in the LICENSE file.
+  */
+ 
++#ifndef GrAAConvexPathRenderer_DEFINED
++#define GrAAConvexPathRenderer_DEFINED
++
+ #include "GrPathRenderer.h"
+ 
+ 
+ class GrAAConvexPathRenderer : public GrPathRenderer {
+ public:
+     GrAAConvexPathRenderer();
+ 
+     virtual bool canDrawPath(const SkPath& path,
+@@ -19,8 +22,10 @@ public:
+                              bool antiAlias) const SK_OVERRIDE;
+ 
+ protected:
+     virtual bool onDrawPath(const SkPath& path,
+                             const SkStrokeRec& stroke,
+                             GrDrawTarget* target,
+                             bool antiAlias) SK_OVERRIDE;
+ };
++
++#endif
+diff --git a/gfx/skia/src/gpu/GrReducedClip.h b/gfx/skia/src/gpu/GrReducedClip.h
+--- a/gfx/skia/src/gpu/GrReducedClip.h
++++ b/gfx/skia/src/gpu/GrReducedClip.h
+@@ -1,16 +1,19 @@
+ 
+ /*
+  * Copyright 2012 Google Inc.
+  *
+  * Use of this source code is governed by a BSD-style license that can be
+  * found in the LICENSE file.
+  */
+ 
++#ifndef GrReducedClip_DEFINED
++#define GrReducedClip_DEFINED
++
+ #include "SkClipStack.h"
+ #include "SkTLList.h"
+ 
+ namespace GrReducedClip {
+ 
+ typedef SkTLList<SkClipStack::Element> ElementList;
+ 
+ enum InitialState {
+@@ -33,8 +36,10 @@ enum InitialState {
+ void ReduceClipStack(const SkClipStack& stack,
+                      const SkIRect& queryBounds,
+                      ElementList* result,
+                      InitialState* initialState,
+                      SkIRect* tighterBounds = NULL,
+                      bool* requiresAA = NULL);
+ 
+ } // namespace GrReducedClip
++
++#endif
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0031-Bug-945588-Add-include-guard.patch
@@ -0,0 +1,39 @@
+# HG changeset patch
+# User Ehsan Akhgari <ehsan@mozilla.com>
+
+Bug 945588 - Add include guards to SkConfig8888.h
+
+diff --git a/gfx/skia/src/core/SkConfig8888.h b/gfx/skia/src/core/SkConfig8888.h
+index 96eaef2..36bc9b4 100644
+--- a/gfx/skia/src/core/SkConfig8888.h
++++ b/gfx/skia/src/core/SkConfig8888.h
+@@ -1,16 +1,18 @@
+ 
+ /*
+  * Copyright 2011 Google Inc.
+  *
+  * Use of this source code is governed by a BSD-style license that can be
+  * found in the LICENSE file.
+  */
+ 
++#ifndef SkConfig8888_DEFINED
++#define SkConfig8888_DEFINED
+ 
+ #include "SkCanvas.h"
+ #include "SkColorPriv.h"
+ 
+ /**
+  * Converts pixels from one Config8888 to another Config8888
+  */
+ void SkConvertConfig8888Pixels(uint32_t* dstPixels,
+@@ -69,8 +71,10 @@ static inline void SkCopyConfig8888ToBitmap(const SkBitmap& dstBmp,
+     int h = dstBmp.height();
+     size_t dstRowBytes = dstBmp.rowBytes();
+     uint32_t* dstPixels = reinterpret_cast<uint32_t*>(dstBmp.getPixels());
+ 
+     SkConvertConfig8888Pixels(dstPixels, dstRowBytes, SkCanvas::kNative_Premul_Config8888, srcPixels, srcRowBytes, srcConfig8888, w, h);
+ }
+ 
+ }
++
++#endif
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0032-Bug-974900-More-missing-include-guards.patch
@@ -0,0 +1,148 @@
+# HG changeset patch
+# Parent c8288d0c7a1544a590a0cac9c39397ac10c8a45b
+Bug 974900 - Add missing include guards to Skia headers - r=gw280
+
+diff --git a/gfx/skia/trunk/include/images/SkImages.h b/gfx/skia/trunk/include/images/SkImages.h
+--- a/gfx/skia/trunk/include/images/SkImages.h
++++ b/gfx/skia/trunk/include/images/SkImages.h
+@@ -1,14 +1,19 @@
+ /*
+  * Copyright 2012 Google Inc.
+  *
+  * Use of this source code is governed by a BSD-style license that can be
+  * found in the LICENSE file.
+  */
+ 
++#ifndef SkImages_DEFINED
++#define SkImages_DEFINED
++
+ class SkImages {
+ public:
+     /**
+      * Initializes flattenables in the images project.
+      */
+     static void InitializeFlattenables();
+ };
++
++#endif
+diff --git a/gfx/skia/trunk/src/core/SkConvolver.h b/gfx/skia/trunk/src/core/SkConvolver.h
+--- a/gfx/skia/trunk/src/core/SkConvolver.h
++++ b/gfx/skia/trunk/src/core/SkConvolver.h
+@@ -8,16 +8,18 @@
+ #include "SkSize.h"
+ #include "SkTypes.h"
+ #include "SkTArray.h"
+ 
+ // avoid confusion with Mac OS X's math library (Carbon)
+ #if defined(__APPLE__)
+ #undef FloatToConvolutionFixed
+ #undef ConvolutionFixedToFloat
++#undef FloatToFixed
++#undef FixedToFloat
+ #endif
+ 
+ // Represents a filter in one dimension. Each output pixel has one entry in this
+ // object for the filter values contributing to it. You build up the filter
+ // list by calling AddFilter for each output pixel (in order).
+ //
+ // We do 2-dimensional convolution by first convolving each row by one
+ // SkConvolutionFilter1D, then convolving each column by another one.
+diff --git a/gfx/skia/trunk/src/gpu/GrAAConvexPathRenderer.h b/gfx/skia/trunk/src/gpu/GrAAConvexPathRenderer.h
+--- a/gfx/skia/trunk/src/gpu/GrAAConvexPathRenderer.h
++++ b/gfx/skia/trunk/src/gpu/GrAAConvexPathRenderer.h
+@@ -3,24 +3,28 @@
+  * Copyright 2012 Google Inc.
+  *
+  * Use of this source code is governed by a BSD-style license that can be
+  * found in the LICENSE file.
+  */
+ 
+ #include "GrPathRenderer.h"
+ 
++#ifndef GrAAConvexPathRenderer_DEFINED
++#define GrAAConvexPathRenderer_DEFINED
+ 
+ class GrAAConvexPathRenderer : public GrPathRenderer {
+ public:
+     GrAAConvexPathRenderer();
+ 
+     virtual bool canDrawPath(const SkPath& path,
+                              const SkStrokeRec& stroke,
+                              const GrDrawTarget* target,
+                              bool antiAlias) const SK_OVERRIDE;
+ 
+ protected:
+     virtual bool onDrawPath(const SkPath& path,
+                             const SkStrokeRec& stroke,
+                             GrDrawTarget* target,
+                             bool antiAlias) SK_OVERRIDE;
+ };
++
++#endif
+diff --git a/gfx/skia/trunk/src/gpu/GrReducedClip.h b/gfx/skia/trunk/src/gpu/GrReducedClip.h
+--- a/gfx/skia/trunk/src/gpu/GrReducedClip.h
++++ b/gfx/skia/trunk/src/gpu/GrReducedClip.h
+@@ -1,16 +1,19 @@
+ 
+ /*
+  * Copyright 2012 Google Inc.
+  *
+  * Use of this source code is governed by a BSD-style license that can be
+  * found in the LICENSE file.
+  */
+ 
++#ifndef GrReducedClip_DEFINED
++#define GrReducedClip_DEFINED
++
+ #include "SkClipStack.h"
+ #include "SkTLList.h"
+ 
+ namespace GrReducedClip {
+ 
+ typedef SkTLList<SkClipStack::Element> ElementList;
+ 
+ enum InitialState {
+@@ -36,8 +39,10 @@ SK_API void ReduceClipStack(const SkClip
+                             const SkIRect& queryBounds,
+                             ElementList* result,
+                             int32_t* resultGenID,
+                             InitialState* initialState,
+                             SkIRect* tighterBounds = NULL,
+                             bool* requiresAA = NULL);
+ 
+ } // namespace GrReducedClip
++
++#endif
+diff --git a/gfx/skia/trunk/src/pathops/SkLineParameters.h b/gfx/skia/trunk/src/pathops/SkLineParameters.h
+--- a/gfx/skia/trunk/src/pathops/SkLineParameters.h
++++ b/gfx/skia/trunk/src/pathops/SkLineParameters.h
+@@ -1,14 +1,18 @@
+ /*
+  * Copyright 2012 Google Inc.
+  *
+  * Use of this source code is governed by a BSD-style license that can be
+  * found in the LICENSE file.
+  */
++
++#ifndef SkLineParameters_DEFINED
++#define SkLineParameters_DEFINED
++
+ #include "SkPathOpsCubic.h"
+ #include "SkPathOpsLine.h"
+ #include "SkPathOpsQuad.h"
+ 
+ // Sources
+ // computer-aided design - volume 22 number 9 november 1990 pp 538 - 549
+ // online at http://cagd.cs.byu.edu/~tom/papers/bezclip.pdf
+ 
+@@ -164,8 +168,10 @@ public:
+         return -a;
+     }
+ 
+ private:
+     double a;
+     double b;
+     double c;
+ };
++
++#endif
new file mode 100644
--- /dev/null
+++ b/gfx/skia/patches/archive/0033-Bug-974900-undef-interface-windows.patch
@@ -0,0 +1,27 @@
+# HG changeset patch
+# Parent b12f9a408740aa5fd93c296a7d41e1b5f54c1b20
+Bug 974900 - #undef interface defined by windows headers - r=gw280
+
+diff --git a/gfx/skia/trunk/src/gpu/gl/GrGLCaps.h b/gfx/skia/trunk/src/gpu/gl/GrGLCaps.h
+--- a/gfx/skia/trunk/src/gpu/gl/GrGLCaps.h
++++ b/gfx/skia/trunk/src/gpu/gl/GrGLCaps.h
+@@ -9,16 +9,19 @@
+ #ifndef GrGLCaps_DEFINED
+ #define GrGLCaps_DEFINED
+ 
+ #include "GrDrawTargetCaps.h"
+ #include "GrGLStencilBuffer.h"
+ #include "SkTArray.h"
+ #include "SkTDArray.h"
+ 
++// defined in Windows headers
++#undef interface
++
+ class GrGLContextInfo;
+ 
+ /**
+  * Stores some capabilities of a GL context. Most are determined by the GL
+  * version and the extensions string. It also tracks formats that have passed
+  * the FBO completeness test.
+  */
+ class GrGLCaps : public GrDrawTargetCaps {