Revert of Pass effects directly to fontcache (patchset #8 id:140001 of https://codere...
authorborenet <borenet@google.com>
Mon, 11 Apr 2016 17:25:28 +0000 (10:25 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 11 Apr 2016 17:25:28 +0000 (10:25 -0700)
Reason for revert:
Seems to have broken the DEPS roll.

Original issue's description:
> Pass effects directly to fontcache
>
> BUG=skia:5176
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1863013003
>
> Committed: https://skia.googlesource.com/skia/+/c79172857c3f69cc46837e1beeae0c1ead377bb2

TBR=djsollen@google.com,bungeman@google.com,mtklein@google.com,fmalita@chromium.org,msarett@google.com,reed@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:5176

Review URL: https://codereview.chromium.org/1872253004

32 files changed:
include/core/SkPaint.h
include/core/SkTypeface.h
src/core/SkGlyphCache.cpp
src/core/SkGlyphCache.h
src/core/SkPaint.cpp
src/core/SkScalerContext.cpp
src/core/SkScalerContext.h
src/core/SkTypeface.cpp
src/fonts/SkGScalerContext.cpp
src/fonts/SkGScalerContext.h
src/fonts/SkRandomScalerContext.cpp
src/fonts/SkRandomScalerContext.h
src/fonts/SkTestScalerContext.cpp
src/fonts/SkTestScalerContext.h
src/gpu/GrPathRendering.cpp
src/gpu/GrPathRendering.h
src/gpu/GrResourceProvider.cpp
src/gpu/GrResourceProvider.h
src/gpu/text/GrAtlasTextBlob.cpp
src/gpu/text/GrAtlasTextBlob.h
src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp
src/gpu/text/GrStencilAndCoverTextContext.cpp
src/gpu/text/GrTextUtils.cpp
src/ports/SkFontHost_FreeType.cpp
src/ports/SkFontHost_FreeType_common.h
src/ports/SkFontHost_mac.cpp
src/ports/SkFontHost_win.cpp
src/ports/SkScalerContext_win_dw.cpp
src/ports/SkScalerContext_win_dw.h
src/ports/SkTypeface_win_dw.cpp
src/ports/SkTypeface_win_dw.h
tests/FontMgrTest.cpp

index 7367fc642deb7bf3a5b4d4c315ba9fc635188830..b2be5041f7f6a9c9d656ac43b0dcddb7df723a10 100644 (file)
@@ -30,7 +30,6 @@ class SkPath;
 class SkPathEffect;
 struct SkPoint;
 class SkRasterizer;
-struct SkScalerContextEffects;
 class SkShader;
 class SkSurfaceProps;
 class SkTypeface;
@@ -1100,8 +1099,7 @@ private:
      * Allocs an SkDescriptor on the heap and return it to the caller as a refcnted
      * SkData.  Caller is responsible for managing the lifetime of this object.
      */
-    void getScalerContextDescriptor(SkScalerContextEffects*, SkAutoDescriptor*,
-                                    const SkSurfaceProps& surfaceProps,
+    void getScalerContextDescriptor(SkAutoDescriptor*, const SkSurfaceProps& surfaceProps,
                                     uint32_t scalerContextFlags, const SkMatrix*) const;
 
     SkGlyphCache* detachCache(const SkSurfaceProps* surfaceProps, uint32_t scalerContextFlags,
@@ -1109,8 +1107,7 @@ private:
 
     void descriptorProc(const SkSurfaceProps* surfaceProps, uint32_t scalerContextFlags,
                         const SkMatrix* deviceMatrix,
-                        void (*proc)(SkTypeface*, const SkScalerContextEffects&,
-                                     const SkDescriptor*, void*),
+                        void (*proc)(SkTypeface*, const SkDescriptor*, void*),
                         void* context) const;
 
     /*
index 0fbf6a3e0ad337395c66f513e73eb6a37f61e8f2..0b1ca6a4bdaf02c231fa61fe2e62a68f24b94672 100644 (file)
@@ -1,3 +1,4 @@
+
 /*
  * Copyright 2006 The Android Open Source Project
  *
@@ -5,6 +6,7 @@
  * found in the LICENSE file.
  */
 
+
 #ifndef SkTypeface_DEFINED
 #define SkTypeface_DEFINED
 
@@ -19,7 +21,6 @@ class SkFontData;
 class SkFontDescriptor;
 class SkScalerContext;
 struct SkScalerContextRec;
-struct SkScalerContextEffects;
 class SkStream;
 class SkStreamAsset;
 class SkAdvancedTypefaceMetrics;
@@ -294,7 +295,7 @@ public:
      *  if allowFailure is true, this returns NULL, else it returns a
      *  dummy scalercontext that will not crash, but will draw nothing.
      */
-    SkScalerContext* createScalerContext(const SkScalerContextEffects&, const SkDescriptor*,
+    SkScalerContext* createScalerContext(const SkDescriptor*,
                                          bool allowFailure = false) const;
 
     /**
@@ -335,8 +336,7 @@ protected:
     friend class SkScalerContext;
     static SkTypeface* GetDefaultTypeface(Style style = SkTypeface::kNormal);
 
-    virtual SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
-                                                   const SkDescriptor*) const = 0;
+    virtual SkScalerContext* onCreateScalerContext(const SkDescriptor*) const = 0;
     virtual void onFilterRec(SkScalerContextRec*) const = 0;
     virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
                         PerGlyphInfo,
index 309f494828231cd0697ec981f81afbde367f1c7f..241854eb5a6028fdf90894544e30ca52ceac1cb7 100644 (file)
@@ -508,10 +508,9 @@ void SkGlyphCache_Globals::purgeAll() {
     - call a fontscaler (which might call into the cache)
 */
 SkGlyphCache* SkGlyphCache::VisitCache(SkTypeface* typeface,
-                                       const SkScalerContextEffects& effects,
-                                       const SkDescriptor* desc,
-                                       bool (*proc)(const SkGlyphCache*, void*),
-                                       void* context) {
+                              const SkDescriptor* desc,
+                              bool (*proc)(const SkGlyphCache*, void*),
+                              void* context) {
     if (!typeface) {
         typeface = SkTypeface::GetDefaultTypeface();
     }
@@ -543,10 +542,10 @@ SkGlyphCache* SkGlyphCache::VisitCache(SkTypeface* typeface,
     {
         // pass true the first time, to notice if the scalercontext failed,
         // so we can try the purge.
-        SkScalerContext* ctx = typeface->createScalerContext(effects, desc, true);
+        SkScalerContext* ctx = typeface->createScalerContext(desc, true);
         if (!ctx) {
             get_globals().purgeAll();
-            ctx = typeface->createScalerContext(effects, desc, false);
+            ctx = typeface->createScalerContext(desc, false);
             SkASSERT(ctx);
         }
         cache = new SkGlyphCache(typeface, desc, ctx);
index fd3ef66028aba7500dc3c84cf1582d813d7eaecd..9ae47c6207f281ede60c78cb4049e89e9b47cec8 100644 (file)
@@ -129,7 +129,7 @@ public:
         If the proc() returns true, detach the cache and return it, otherwise leave it and return
         nullptr.
     */
-    static SkGlyphCache* VisitCache(SkTypeface*, const SkScalerContextEffects&, const SkDescriptor*,
+    static SkGlyphCache* VisitCache(SkTypeface*, const SkDescriptor* desc,
                                     bool (*proc)(const SkGlyphCache*, void*),
                                     void* context);
 
@@ -146,9 +146,8 @@ public:
         more than 1 strike for the same descriptor, but that will eventually get purged, and the
         win is that different thread will never block each other while a strike is being used.
     */
-    static SkGlyphCache* DetachCache(SkTypeface* typeface, const SkScalerContextEffects& effects,
-                                     const SkDescriptor* desc) {
-        return VisitCache(typeface, effects, desc, DetachProc, nullptr);
+    static SkGlyphCache* DetachCache(SkTypeface* typeface, const SkDescriptor* desc) {
+        return VisitCache(typeface, desc, DetachProc, nullptr);
     }
 
     static void Dump();
@@ -279,9 +278,8 @@ public:
     SkGlyphCache* getCache() const { return this->get(); }
 
     SkAutoGlyphCache(SkGlyphCache* cache) : INHERITED(cache) {}
-    SkAutoGlyphCache(SkTypeface* typeface, const SkScalerContextEffects& effects,
-                     const SkDescriptor* desc)
-        : INHERITED(SkGlyphCache::DetachCache(typeface, effects, desc))
+    SkAutoGlyphCache(SkTypeface* typeface, const SkDescriptor* desc)
+        : INHERITED(SkGlyphCache::DetachCache(typeface, desc))
     {}
     /** deprecated: always enables fake gamma */
     SkAutoGlyphCache(const SkPaint& paint,
index 123f20365e6ef2cf96a905e46681be48f684655d..c3bf1ba9ac78750ab15a7b5b204412d475a400c8 100644 (file)
@@ -430,12 +430,13 @@ bool SkPaint::TooBigToUseCache(const SkMatrix& ctm, const SkMatrix& textM) {
 #include "SkGlyphCache.h"
 #include "SkUtils.h"
 
-static void DetachDescProc(SkTypeface* typeface, const SkScalerContextEffects& effects,
-                           const SkDescriptor* desc, void* context) {
-    *((SkGlyphCache**)context) = SkGlyphCache::DetachCache(typeface, effects, desc);
+static void DetachDescProc(SkTypeface* typeface, const SkDescriptor* desc,
+                           void* context) {
+    *((SkGlyphCache**)context) = SkGlyphCache::DetachCache(typeface, desc);
 }
 
-int SkPaint::textToGlyphs(const void* textData, size_t byteLength, uint16_t glyphs[]) const {
+int SkPaint::textToGlyphs(const void* textData, size_t byteLength,
+                          uint16_t glyphs[]) const {
     if (byteLength == 0) {
         return 0;
     }
@@ -937,9 +938,9 @@ static bool FontMetricsCacheProc(const SkGlyphCache* cache, void* context) {
     return false;   // don't detach the cache
 }
 
-static void FontMetricsDescProc(SkTypeface* typeface, const SkScalerContextEffects& effects,
-                                const SkDescriptor* desc, void* context) {
-    SkGlyphCache::VisitCache(typeface, effects, desc, FontMetricsCacheProc, context);
+static void FontMetricsDescProc(SkTypeface* typeface, const SkDescriptor* desc,
+                                void* context) {
+    SkGlyphCache::VisitCache(typeface, desc, FontMetricsCacheProc, context);
 }
 
 SkScalar SkPaint::getFontMetrics(FontMetrics* metrics, SkScalar zoom) const {
@@ -1647,8 +1648,7 @@ static void test_desc(const SkScalerContext::Rec& rec,
 #endif
 
 /* see the note on ignoreGamma on descriptorProc */
-void SkPaint::getScalerContextDescriptor(SkScalerContextEffects* effects,
-                                         SkAutoDescriptor* ad,
+void SkPaint::getScalerContextDescriptor(SkAutoDescriptor* ad,
                                          const SkSurfaceProps& surfaceProps,
                                          uint32_t scalerContextFlags,
                                          const SkMatrix* deviceMatrix) const {
@@ -1674,10 +1674,6 @@ void SkPaint::getScalerContextDescriptor(SkScalerContextEffects* effects,
 #ifdef TEST_DESC
     test_desc(rec, pe, &peBuffer, mf, &mfBuffer, ra, &raBuffer, desc, descSize);
 #endif
-
-    effects->fPathEffect = pe;
-    effects->fMaskFilter = mf;
-    effects->fRasterizer = ra;
 }
 
 /*
@@ -1688,8 +1684,7 @@ void SkPaint::getScalerContextDescriptor(SkScalerContextEffects* effects,
 void SkPaint::descriptorProc(const SkSurfaceProps* surfaceProps,
                              uint32_t scalerContextFlags,
                              const SkMatrix* deviceMatrix,
-                             void (*proc)(SkTypeface*, const SkScalerContextEffects&,
-                                          const SkDescriptor*, void*),
+                             void (*proc)(SkTypeface*, const SkDescriptor*, void*),
                              void* context) const {
     SkScalerContext::Rec    rec;
 
@@ -1714,7 +1709,7 @@ void SkPaint::descriptorProc(const SkSurfaceProps* surfaceProps,
     test_desc(rec, pe, &peBuffer, mf, &mfBuffer, ra, &raBuffer, desc, descSize);
 #endif
 
-    proc(fTypeface.get(), { pe, mf, ra }, desc, context);
+    proc(fTypeface.get(), desc, context);
 }
 
 SkGlyphCache* SkPaint::detachCache(const SkSurfaceProps* surfaceProps,
index ad753dfd21d060260b43cf2f1f2b5076d389fe0f..cf4098bbdda9ccc07358d55415b6693f883e4aa8 100644 (file)
@@ -62,14 +62,30 @@ void SkGlyph::zeroMetrics() {
     #define DUMP_RECx
 #endif
 
-SkScalerContext::SkScalerContext(SkTypeface* typeface, const SkScalerContextEffects& effects,
-                                 const SkDescriptor* desc)
+static SkFlattenable* load_flattenable(const SkDescriptor* desc, uint32_t tag,
+                                       SkFlattenable::Type ft) {
+    SkFlattenable*  obj = nullptr;
+    uint32_t        len;
+    const void*     data = desc->findEntry(tag, &len);
+
+    if (data) {
+        SkReadBuffer buffer(data, len);
+        obj = buffer.readFlattenable(ft);
+        SkASSERT(buffer.offset() == buffer.size());
+    }
+    return obj;
+}
+
+SkScalerContext::SkScalerContext(SkTypeface* typeface, const SkDescriptor* desc)
     : fRec(*static_cast<const Rec*>(desc->findEntry(kRec_SkDescriptorTag, nullptr)))
 
-    , fTypeface(sk_ref_sp(typeface))
-    , fPathEffect(sk_ref_sp(effects.fPathEffect))
-    , fMaskFilter(sk_ref_sp(effects.fMaskFilter))
-    , fRasterizer(sk_ref_sp(effects.fRasterizer))
+    , fTypeface(SkRef(typeface))
+    , fPathEffect(static_cast<SkPathEffect*>(load_flattenable(desc, kPathEffect_SkDescriptorTag,
+                                             SkFlattenable::kSkPathEffect_Type)))
+    , fMaskFilter(static_cast<SkMaskFilter*>(load_flattenable(desc, kMaskFilter_SkDescriptorTag,
+                                             SkFlattenable::kSkMaskFilter_Type)))
+    , fRasterizer(static_cast<SkRasterizer*>(load_flattenable(desc, kRasterizer_SkDescriptorTag,
+                                             SkFlattenable::kSkRasterizer_Type)))
       // Initialize based on our settings. Subclasses can also force this.
     , fGenerateImageFromPath(fRec.fFrameWidth > 0 || fPathEffect != nullptr || fRasterizer != nullptr)
 
@@ -93,7 +109,11 @@ SkScalerContext::SkScalerContext(SkTypeface* typeface, const SkScalerContextEffe
 #endif
 }
 
-SkScalerContext::~SkScalerContext() {}
+SkScalerContext::~SkScalerContext() {
+    SkSafeUnref(fPathEffect);
+    SkSafeUnref(fMaskFilter);
+    SkSafeUnref(fRasterizer);
+}
 
 void SkScalerContext::getAdvance(SkGlyph* glyph) {
     // mark us as just having a valid advance
@@ -136,7 +156,7 @@ void SkScalerContext::getMetrics(SkGlyph* glyph) {
             SkMask  mask;
 
             if (fRasterizer->rasterize(fillPath, fillToDevMatrix, nullptr,
-                                       fMaskFilter.get(), &mask,
+                                       fMaskFilter, &mask,
                                        SkMask::kJustComputeBounds_CreateMode)) {
                 glyph->fLeft    = mask.fBounds.fLeft;
                 glyph->fTop     = mask.fBounds.fTop;
@@ -465,9 +485,10 @@ void SkScalerContext::getImage(const SkGlyph& origGlyph) {
         tmpGlyph.initGlyphIdFrom(origGlyph);
 
         // need the original bounds, sans our maskfilter
-        SkMaskFilter* mf = fMaskFilter.release();   // temp disable
+        SkMaskFilter* mf = fMaskFilter;
+        fMaskFilter = nullptr;             // temp disable
         this->getMetrics(&tmpGlyph);
-        fMaskFilter = sk_sp<SkMaskFilter>(mf);      // restore
+        fMaskFilter = mf;               // restore
 
         // we need the prefilter bounds to be <= filter bounds
         SkASSERT(tmpGlyph.fWidth <= origGlyph.fWidth);
@@ -495,7 +516,7 @@ void SkScalerContext::getImage(const SkGlyph& origGlyph) {
             sk_bzero(glyph->fImage, mask.computeImageSize());
 
             if (!fRasterizer->rasterize(fillPath, fillToDevMatrix, nullptr,
-                                        fMaskFilter.get(), &mask,
+                                        fMaskFilter, &mask,
                                         SkMask::kJustRenderImage_CreateMode)) {
                 return;
             }
@@ -830,9 +851,8 @@ SkAxisAlignment SkScalerContext::computeAxisAlignmentForHText() {
 
 class SkScalerContext_Empty : public SkScalerContext {
 public:
-    SkScalerContext_Empty(SkTypeface* typeface, const SkScalerContextEffects& effects,
-                          const SkDescriptor* desc)
-        : SkScalerContext(typeface, effects, desc) {}
+    SkScalerContext_Empty(SkTypeface* face, const SkDescriptor* desc)
+        : SkScalerContext(face, desc) {}
 
 protected:
     unsigned generateGlyphCount() override {
@@ -858,13 +878,12 @@ protected:
 
 extern SkScalerContext* SkCreateColorScalerContext(const SkDescriptor* desc);
 
-SkScalerContext* SkTypeface::createScalerContext(const SkScalerContextEffects& effects,
-                                                 const SkDescriptor* desc,
+SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc,
                                                  bool allowFailure) const {
-    SkScalerContext* c = this->onCreateScalerContext(effects, desc);
+    SkScalerContext* c = this->onCreateScalerContext(desc);
 
     if (!c && !allowFailure) {
-        c = new SkScalerContext_Empty(const_cast<SkTypeface*>(this), effects, desc);
+        c = new SkScalerContext_Empty(const_cast<SkTypeface*>(this), desc);
     }
     return c;
 }
index ffde83cb0a9e456f6baf035ca7feb8358983069b..96674cd5002a8934df2af4a9933834d7345bf1ad 100644 (file)
@@ -20,16 +20,6 @@ class SkMaskFilter;
 class SkPathEffect;
 class SkRasterizer;
 
-struct SkScalerContextEffects {
-    SkScalerContextEffects() : fPathEffect(nullptr), fMaskFilter(nullptr), fRasterizer(nullptr) {}
-    SkScalerContextEffects(SkPathEffect* pe, SkMaskFilter* mf, SkRasterizer* ra)
-        : fPathEffect(pe), fMaskFilter(mf), fRasterizer(ra) {}
-
-    SkPathEffect*   fPathEffect;
-    SkMaskFilter*   fMaskFilter;
-    SkRasterizer*   fRasterizer;
-};
-
 enum SkAxisAlignment {
     kNone_SkAxisAlignment,
     kX_SkAxisAlignment,
@@ -210,7 +200,8 @@ public:
         kHinting_Mask   = kHintingBit1_Flag | kHintingBit2_Flag,
     };
 
-    SkScalerContext(SkTypeface*, const SkScalerContextEffects&, const SkDescriptor*);
+
+    SkScalerContext(SkTypeface*, const SkDescriptor*);
     virtual ~SkScalerContext();
 
     SkTypeface* getTypeface() const { return fTypeface.get(); }
@@ -269,16 +260,13 @@ public:
 
     const Rec& getRec() const { return fRec; }
 
-    SkScalerContextEffects getEffects() const {
-        return { fPathEffect.get(), fMaskFilter.get(), fRasterizer.get() };
-    }
-
     /**
     *  Return the axis (if any) that the baseline for horizontal text should land on.
     *  As an example, the identity matrix will return kX_SkAxisAlignment
     */
     SkAxisAlignment computeAxisAlignmentForHText();
 
+
 protected:
     Rec         fRec;
 
@@ -338,12 +326,12 @@ private:
     friend class SkRandomScalerContext; // For debug purposes
 
     // never null
-    sk_sp<SkTypeface> fTypeface;
+    SkAutoTUnref<SkTypeface> fTypeface;
 
-    // optional objects, which may be null
-    sk_sp<SkPathEffect> fPathEffect;
-    sk_sp<SkMaskFilter> fMaskFilter;
-    sk_sp<SkRasterizer> fRasterizer;
+    // optional object, which may be null
+    SkPathEffect*   fPathEffect;
+    SkMaskFilter*   fMaskFilter;
+    SkRasterizer*   fRasterizer;
 
     // if this is set, we draw the image from a path, rather than
     // calling generateImage.
index dc5306331ce55de728f086b5da9401289023364d..6024c81a17da9d2c2dbcbafb3b8897b8d1ebaaa6 100644 (file)
@@ -40,8 +40,7 @@ protected:
     SkEmptyTypeface() : SkTypeface(SkFontStyle(), 0, true) { }
 
     SkStreamAsset* onOpenStream(int* ttcIndex) const override { return nullptr; }
-    SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
-                                           const SkDescriptor*) const override {
+    SkScalerContext* onCreateScalerContext(const SkDescriptor*) const override {
         return nullptr;
     }
     void onFilterRec(SkScalerContextRec*) const override { }
@@ -349,8 +348,7 @@ bool SkTypeface::onComputeBounds(SkRect* bounds) const {
     desc->init();
     desc->addEntry(kRec_SkDescriptorTag, sizeof(rec), &rec);
 
-    SkScalerContextEffects noeffects;
-    SkAutoTDelete<SkScalerContext> ctx(this->createScalerContext(noeffects, desc, true));
+    SkAutoTDelete<SkScalerContext> ctx(this->createScalerContext(desc, true));
     if (ctx.get()) {
         SkPaint::FontMetrics fm;
         ctx->getFontMetrics(&fm);
index 0a9601bd7e48cd1afb080557a340fcbf3c7136b7..9766e34ff07b33289a0a1c1054d628650d0e1919 100644 (file)
@@ -5,46 +5,15 @@
  * found in the LICENSE file.
  */
 
-#include "SkDescriptor.h"
 #include "SkGScalerContext.h"
 #include "SkGlyph.h"
 #include "SkPath.h"
 #include "SkCanvas.h"
 
-#define STD_SIZE    1
-
 class SkGScalerContext : public SkScalerContext {
 public:
-    SkGScalerContext(SkGTypeface* face, const SkScalerContextEffects& effects,
-                     const SkDescriptor* desc)
-        : SkScalerContext(face, effects, desc)
-        , fFace(face)
-    {
-        
-        size_t  descSize = SkDescriptor::ComputeOverhead(1) + sizeof(SkScalerContext::Rec);
-        SkAutoDescriptor ad(descSize);
-        SkDescriptor*    newDesc = ad.getDesc();
-        
-        newDesc->init();
-        void* entry = newDesc->addEntry(kRec_SkDescriptorTag,
-                                        sizeof(SkScalerContext::Rec), &fRec);
-        {
-            SkScalerContext::Rec* rec = (SkScalerContext::Rec*)entry;
-            rec->fTextSize = STD_SIZE;
-            rec->fPreScaleX = SK_Scalar1;
-            rec->fPreSkewX = 0;
-            rec->fPost2x2[0][0] = rec->fPost2x2[1][1] = SK_Scalar1;
-            rec->fPost2x2[1][0] = rec->fPost2x2[0][1] = 0;
-        }
-        SkASSERT(descSize == newDesc->getLength());
-        newDesc->computeChecksum();
-        
-        fProxy = face->proxy()->createScalerContext(effects, newDesc);
-        
-        fRec.getSingleMatrix(&fMatrix);
-        fMatrix.preScale(SK_Scalar1 / STD_SIZE, SK_Scalar1 / STD_SIZE);
-    }
-    virtual ~SkGScalerContext() { delete fProxy; }
+    SkGScalerContext(SkGTypeface*, const SkDescriptor*);
+    virtual ~SkGScalerContext();
 
 protected:
     unsigned generateGlyphCount() override;
@@ -61,6 +30,41 @@ private:
     SkMatrix         fMatrix;
 };
 
+#define STD_SIZE    1
+
+#include "SkDescriptor.h"
+
+SkGScalerContext::SkGScalerContext(SkGTypeface* face, const SkDescriptor* desc)
+        : SkScalerContext(face, desc)
+        , fFace(face)
+{
+
+    size_t  descSize = SkDescriptor::ComputeOverhead(1) + sizeof(SkScalerContext::Rec);
+    SkAutoDescriptor ad(descSize);
+    SkDescriptor*    newDesc = ad.getDesc();
+
+    newDesc->init();
+    void* entry = newDesc->addEntry(kRec_SkDescriptorTag,
+                                    sizeof(SkScalerContext::Rec), &fRec);
+    {
+        SkScalerContext::Rec* rec = (SkScalerContext::Rec*)entry;
+        rec->fTextSize = STD_SIZE;
+        rec->fPreScaleX = SK_Scalar1;
+        rec->fPreSkewX = 0;
+        rec->fPost2x2[0][0] = rec->fPost2x2[1][1] = SK_Scalar1;
+        rec->fPost2x2[1][0] = rec->fPost2x2[0][1] = 0;
+    }
+    SkASSERT(descSize == newDesc->getLength());
+    newDesc->computeChecksum();
+
+    fProxy = face->proxy()->createScalerContext(newDesc);
+
+    fRec.getSingleMatrix(&fMatrix);
+    fMatrix.preScale(SK_Scalar1 / STD_SIZE, SK_Scalar1 / STD_SIZE);
+}
+
+SkGScalerContext::~SkGScalerContext() { delete fProxy; }
+
 unsigned SkGScalerContext::generateGlyphCount() {
     return fProxy->getGlyphCount();
 }
@@ -160,9 +164,9 @@ SkGTypeface::~SkGTypeface() {
     fProxy->unref();
 }
 
-SkScalerContext* SkGTypeface::onCreateScalerContext(const SkScalerContextEffects& effects,
-                                                    const SkDescriptor* desc) const {
-    return new SkGScalerContext(const_cast<SkGTypeface*>(this), effects, desc);
+SkScalerContext* SkGTypeface::onCreateScalerContext(
+                                            const SkDescriptor* desc) const {
+    return new SkGScalerContext(const_cast<SkGTypeface*>(this), desc);
 }
 
 void SkGTypeface::onFilterRec(SkScalerContextRec* rec) const {
index 69d02ddf114132197be16d1841459502d58c45b1..75f3ebedbdeadc980f47f6d9c17b08cb696f5fa5 100644 (file)
@@ -20,8 +20,7 @@ public:
     const SkPaint& paint() const { return fPaint; }
 
 protected:
-    SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
-                                           const SkDescriptor*) const override;
+    SkScalerContext* onCreateScalerContext(const SkDescriptor*) const override;
     void onFilterRec(SkScalerContextRec*) const override;
     SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
         PerGlyphInfo,
index 245052053e3d40f77413913d4bf7ff7d60e93908..c555dd2294457012f5384bfcf0a0e840554c7083 100644 (file)
@@ -13,8 +13,7 @@
 
 class SkRandomScalerContext : public SkScalerContext {
 public:
-    SkRandomScalerContext(SkRandomTypeface*, const SkScalerContextEffects&,
-                          const SkDescriptor*, bool fFakeIt);
+    SkRandomScalerContext(SkRandomTypeface*, const SkDescriptor*, bool fFakeIt);
     virtual ~SkRandomScalerContext();
 
 protected:
@@ -36,14 +35,12 @@ private:
 
 #include "SkDescriptor.h"
 
-SkRandomScalerContext::SkRandomScalerContext(SkRandomTypeface* face,
-                                             const SkScalerContextEffects& effects,
-                                             const SkDescriptor* desc,
+SkRandomScalerContext::SkRandomScalerContext(SkRandomTypeface* face, const SkDescriptor* desc,
                                              bool fakeIt)
-        : SkScalerContext(face, effects, desc)
+        : SkScalerContext(face, desc)
         , fFace(face)
         , fFakeIt(fakeIt) {
-    fProxy = face->proxy()->createScalerContext(effects, desc);
+    fProxy = face->proxy()->createScalerContext(desc);
 }
 
 SkRandomScalerContext::~SkRandomScalerContext() { delete fProxy; }
@@ -200,9 +197,9 @@ SkRandomTypeface::~SkRandomTypeface() {
     fProxy->unref();
 }
 
-SkScalerContext* SkRandomTypeface::onCreateScalerContext(const SkScalerContextEffects& effects,
-                                                         const SkDescriptor* desc) const {
-    return new SkRandomScalerContext(const_cast<SkRandomTypeface*>(this), effects, desc, fFakeIt);
+SkScalerContext* SkRandomTypeface::onCreateScalerContext(
+                                            const SkDescriptor* desc) const {
+    return new SkRandomScalerContext(const_cast<SkRandomTypeface*>(this), desc, fFakeIt);
 }
 
 void SkRandomTypeface::onFilterRec(SkScalerContextRec* rec) const {
index 0e08f4b1ae7e08aea3f7b9339e8a4f7163f1e776..24b203f05c71175853cb92240744aef2e8207d77 100644 (file)
@@ -25,8 +25,7 @@ public:
     const SkPaint& paint() const { return fPaint; }
 
 protected:
-    SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
-                                           const SkDescriptor*) const override;
+    SkScalerContext* onCreateScalerContext(const SkDescriptor*) const override;
     void onFilterRec(SkScalerContextRec*) const override;
     SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
         PerGlyphInfo,
index a2748564a56cca6722d165c3fb224fee80712eb9..600e2de609c49fde3d31394742118faee1d4d045 100644 (file)
@@ -183,9 +183,8 @@ SkASSERT(0);  // incomplete
 
 class SkTestScalerContext : public SkScalerContext {
 public:
-    SkTestScalerContext(SkTestTypeface* face, const SkScalerContextEffects& effects,
-                        const SkDescriptor* desc)
-        : SkScalerContext(face, effects, desc)
+    SkTestScalerContext(SkTestTypeface* face, const SkDescriptor* desc)
+        : SkScalerContext(face, desc)
         , fFace(face)
     {
         fRec.getSingleMatrix(&fMatrix);
@@ -284,7 +283,6 @@ private:
     SkMatrix         fMatrix;
 };
 
-SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkScalerContextEffects& effects,
-                                                       const SkDescriptor* desc) const {
-    return new SkTestScalerContext(const_cast<SkTestTypeface*>(this), effects, desc);
+SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc) const {
+    return new SkTestScalerContext(const_cast<SkTestTypeface*>(this), desc);
 }
index 5e772601bb3eda3382035b8db49f8d932788f088..4af9bf3dfd8eeff5a33661828a580fa54e639875 100644 (file)
@@ -67,8 +67,7 @@ public:
     void getMetrics(SkGlyph* glyph);
     void getPath(const SkGlyph& glyph, SkPath* path);
 protected:
-    SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
-                                           const SkDescriptor* desc) const override;
+    SkScalerContext* onCreateScalerContext(const SkDescriptor* desc) const override;
     void onFilterRec(SkScalerContextRec* rec) const override;
     SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
         PerGlyphInfo,
index a3bba4bc7f2a163743d0edfb776341883a2f71b5..0287eb08aa82c1a5db5c15fd3fcf8dd65fb2c791 100644 (file)
@@ -14,9 +14,8 @@
 
 class GlyphGenerator : public GrPathRange::PathGenerator {
 public:
-    GlyphGenerator(const SkTypeface& typeface, const SkScalerContextEffects& effects,
-                   const SkDescriptor& desc)
-        : fScalerContext(typeface.createScalerContext(effects, &desc))
+    GlyphGenerator(const SkTypeface& typeface, const SkDescriptor& desc)
+        : fScalerContext(typeface.createScalerContext(&desc))
 #ifdef SK_DEBUG
         , fDesc(desc.copy())
 #endif
@@ -52,7 +51,6 @@ private:
 };
 
 GrPathRange* GrPathRendering::createGlyphs(const SkTypeface* typeface,
-                                           const SkScalerContextEffects& effects,
                                            const SkDescriptor* desc,
                                            const GrStrokeInfo& stroke) {
     if (nullptr == typeface) {
@@ -61,7 +59,7 @@ GrPathRange* GrPathRendering::createGlyphs(const SkTypeface* typeface,
     }
 
     if (desc) {
-        SkAutoTUnref<GlyphGenerator> generator(new GlyphGenerator(*typeface, effects, *desc));
+        SkAutoTUnref<GlyphGenerator> generator(new GlyphGenerator(*typeface, *desc));
         return this->createPathRange(generator, stroke);
     }
 
@@ -78,10 +76,7 @@ GrPathRange* GrPathRendering::createGlyphs(const SkTypeface* typeface,
     genericDesc->init();
     genericDesc->addEntry(kRec_SkDescriptorTag, sizeof(rec), &rec);
     genericDesc->computeChecksum();
-    
-    // No effects, so we make a dummy struct
-    SkScalerContextEffects noEffects;
 
-    SkAutoTUnref<GlyphGenerator> generator(new GlyphGenerator(*typeface, noEffects, *genericDesc));
+    SkAutoTUnref<GlyphGenerator> generator(new GlyphGenerator(*typeface, *genericDesc));
     return this->createPathRange(generator, stroke);
 }
index 8ee3d7b3e24168e5640b6f9ee3055852a2f1a92e..b2863b5b36c73ea38b063f982460597fb67257aa 100644 (file)
@@ -125,8 +125,7 @@ public:
      *
      * @return a new path range populated with glyphs.
      */
-    GrPathRange* createGlyphs(const SkTypeface*, const SkScalerContextEffects&,
-                              const SkDescriptor*, const GrStrokeInfo&);
+    GrPathRange* createGlyphs(const SkTypeface*, const SkDescriptor*, const GrStrokeInfo&);
 
     /** None of these params are optional, pointers used just to avoid making copies. */
     struct StencilPathArgs {
index a8c9e5a3c76ab67c5898b7bb0285a5beda043fe1..4c60f079a748a544275e61b2240bef1d64d88d18 100644 (file)
@@ -81,13 +81,11 @@ GrPathRange* GrResourceProvider::createPathRange(GrPathRange::PathGenerator* gen
     return this->gpu()->pathRendering()->createPathRange(gen, stroke);
 }
 
-GrPathRange* GrResourceProvider::createGlyphs(const SkTypeface* tf,
-                                              const SkScalerContextEffects& effects,
-                                              const SkDescriptor* desc,
+GrPathRange* GrResourceProvider::createGlyphs(const SkTypeface* tf, const SkDescriptor* desc,
                                               const GrStrokeInfo& stroke) {
 
     SkASSERT(this->gpu()->pathRendering());
-    return this->gpu()->pathRendering()->createGlyphs(tf, effects, desc, stroke);
+    return this->gpu()->pathRendering()->createGlyphs(tf, desc, stroke);
 }
 
 GrBuffer* GrResourceProvider::createBuffer(size_t size, GrBufferType intendedType,
index 5beb70a3d8773d9dc783f67070b7c7d777846900..d8e595a47bd5001de88832ace3548f6deb9eeeb8 100644 (file)
@@ -85,8 +85,7 @@ public:
      */
     GrPath* createPath(const SkPath&, const GrStrokeInfo&);
     GrPathRange* createPathRange(GrPathRange::PathGenerator*, const GrStrokeInfo&);
-    GrPathRange* createGlyphs(const SkTypeface*, const SkScalerContextEffects&,
-                              const SkDescriptor*, const GrStrokeInfo&);
+    GrPathRange* createGlyphs(const SkTypeface*, const SkDescriptor*, const GrStrokeInfo&);
 
     using GrTextureProvider::assignUniqueKeyToResource;
     using GrTextureProvider::findAndRefResourceByUniqueKey;
index afbff46994a30f7a175da8b1674ff06f25533902..4b339d4adbd4c7302fcab551875378aea17ae9ef 100644 (file)
@@ -59,9 +59,9 @@ SkGlyphCache* GrAtlasTextBlob::setupCache(int runIndex,
     // if we have an override descriptor for the run, then we should use that
     SkAutoDescriptor* desc = run->fOverrideDescriptor.get() ? run->fOverrideDescriptor.get() :
                                                               &run->fDescriptor;
-    skPaint.getScalerContextDescriptor(&run->fEffects, desc, props, scalerContextFlags, viewMatrix);
+    skPaint.getScalerContextDescriptor(desc, props, scalerContextFlags, viewMatrix);
     run->fTypeface.reset(SkSafeRef(skPaint.getTypeface()));
-    return SkGlyphCache::DetachCache(run->fTypeface, run->fEffects, desc->getDesc());
+    return SkGlyphCache::DetachCache(run->fTypeface, desc->getDesc());
 }
 
 void GrAtlasTextBlob::appendGlyph(int runIndex,
index bc1e0b4afc19269e77539d1ac68cbeb4e4e5b51f..36e45abcff3a6ebc4c494c4cbfc9a6a2296715a7 100644 (file)
@@ -474,7 +474,6 @@ private:
         SkAutoTUnref<SkTypeface> fTypeface;
         SkSTArray<kMinSubRuns, SubRunInfo> fSubRunInfo;
         SkAutoDescriptor fDescriptor;
-        SkScalerContextEffects fEffects;
 
         // Distance field text cannot draw coloremoji, and so has to fall back.  However,
         // though the distance field text and the coloremoji may share the same run, they
index 7c3cf6852457e1d078dd5a175aeea35bdc4cf1fd..7283e6d516f85411a188e855389abe316e4d441c 100644 (file)
@@ -165,7 +165,7 @@ void GrAtlasTextBlob::regenInBatch(GrDrawBatch::Target* target,
                 SkGlyphCache::AttachCache(*cache);
             }
             *desc = newDesc;
-            *cache = SkGlyphCache::DetachCache(run->fTypeface, run->fEffects, *desc);
+            *cache = SkGlyphCache::DetachCache(run->fTypeface, *desc);
             *scaler = GrTextUtils::GetGrFontScaler(*cache);
             *typeface = run->fTypeface;
         }
index a8dc20215af22b48227c5df87e3a21f67977e43f..f0c66979d565cdbf2cc265565163f9c778ae08cc 100644 (file)
@@ -539,13 +539,10 @@ GrPathRange* GrStencilAndCoverTextContext::TextRun::createGlyphs(GrContext* ctx)
             ctx->resourceProvider()->findAndRefResourceByUniqueKey(fGlyphPathsKey));
     if (nullptr == glyphs) {
         if (fUsingRawGlyphPaths) {
-            SkScalerContextEffects noeffects;
-            glyphs = ctx->resourceProvider()->createGlyphs(fFont.getTypeface(), noeffects,
-                                                           nullptr, fStroke);
+            glyphs = ctx->resourceProvider()->createGlyphs(fFont.getTypeface(), nullptr, fStroke);
         } else {
             SkGlyphCache* cache = this->getGlyphCache();
             glyphs = ctx->resourceProvider()->createGlyphs(cache->getScalerContext()->getTypeface(),
-                                                           cache->getScalerContext()->getEffects(),
                                                            &cache->getDescriptor(),
                                                            fStroke);
         }
index c368c214e18692c633404df51c54e8d7ef1f14ba..3616bcada12725bac7c09449fb5ca158de7899dd 100644 (file)
@@ -260,12 +260,10 @@ void GrTextUtils::DrawDFText(GrAtlasTextBlob* blob, int runIndex,
 
     SkPaint::GlyphCacheProc glyphCacheProc = skPaint.getGlyphCacheProc(true);
     SkAutoDescriptor desc;
-    SkScalerContextEffects effects;
     // We apply the fake-gamma by altering the distance in the shader, so we ignore the
     // passed-in scaler context flags. (It's only used when we fall-back to bitmap text).
-    skPaint.getScalerContextDescriptor(&effects, &desc, props, SkPaint::kNone_ScalerContextFlags,
-                                       nullptr);
-    SkGlyphCache* origPaintCache = SkGlyphCache::DetachCache(skPaint.getTypeface(), effects,
+    skPaint.getScalerContextDescriptor(&desc, props, SkPaint::kNone_ScalerContextFlags, nullptr);
+    SkGlyphCache* origPaintCache = SkGlyphCache::DetachCache(skPaint.getTypeface(),
                                                              desc.getDesc());
 
     SkTArray<SkScalar> positions;
index 55eb87fe6d4bfadb8eadfaf01ec78128e5981855..44eb50ce406c8b7fdec44a1fef448ac1896aabd5 100644 (file)
@@ -181,7 +181,7 @@ static void unref_ft_library() {
 
 class SkScalerContext_FreeType : public SkScalerContext_FreeType_Base {
 public:
-    SkScalerContext_FreeType(SkTypeface*, const SkScalerContextEffects&, const SkDescriptor* desc);
+    SkScalerContext_FreeType(SkTypeface*, const SkDescriptor* desc);
     virtual ~SkScalerContext_FreeType();
 
     bool success() const {
@@ -663,10 +663,10 @@ static bool isAxisAligned(const SkScalerContext::Rec& rec) {
             bothZero(rec.fPost2x2[0][0], rec.fPost2x2[1][1]));
 }
 
-SkScalerContext* SkTypeface_FreeType::onCreateScalerContext(const SkScalerContextEffects& effects,
-                                                            const SkDescriptor* desc) const {
+SkScalerContext* SkTypeface_FreeType::onCreateScalerContext(
+                                               const SkDescriptor* desc) const {
     SkScalerContext_FreeType* c =
-            new SkScalerContext_FreeType(const_cast<SkTypeface_FreeType*>(this), effects, desc);
+            new SkScalerContext_FreeType(const_cast<SkTypeface_FreeType*>(this), desc);
     if (!c->success()) {
         delete c;
         c = nullptr;
@@ -790,10 +790,8 @@ static FT_Int chooseBitmapStrike(FT_Face face, FT_F26Dot6 scaleY) {
     return chosenStrikeIndex;
 }
 
-SkScalerContext_FreeType::SkScalerContext_FreeType(SkTypeface* typeface,
-                                                   const SkScalerContextEffects& effects,
-                                                   const SkDescriptor* desc)
-    : SkScalerContext_FreeType_Base(typeface, effects, desc)
+SkScalerContext_FreeType::SkScalerContext_FreeType(SkTypeface* typeface, const SkDescriptor* desc)
+    : SkScalerContext_FreeType_Base(typeface, desc)
     , fFace(nullptr)
     , fFTSize(nullptr)
     , fStrikeIndex(-1)
index 8c13a80aa57e77a70431b52145af8393c80def8b..99b43dccca2a4381eb62ea3a56e08cfbfb93be9c 100644 (file)
@@ -26,9 +26,8 @@ protected:
     // This value was chosen by eyeballing the result in Firefox and trying to match it.
     static const FT_Pos kBitmapEmboldenStrength = 1 << 6;
 
-    SkScalerContext_FreeType_Base(SkTypeface* typeface, const SkScalerContextEffects& effects,
-                                  const SkDescriptor *desc)
-        : INHERITED(typeface, effects, desc)
+    SkScalerContext_FreeType_Base(SkTypeface* typeface, const SkDescriptor *desc)
+    : INHERITED(typeface, desc)
     {}
 
     void generateGlyphImage(FT_Face face, const SkGlyph& glyph);
@@ -76,8 +75,8 @@ protected:
         , fGlyphCount(-1)
     {}
 
-    virtual SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
-                                                   const SkDescriptor*) const override;
+    virtual SkScalerContext* onCreateScalerContext(
+                                        const SkDescriptor*) const override;
     void onFilterRec(SkScalerContextRec*) const override;
     SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
                         PerGlyphInfo, const uint32_t*, uint32_t) const override;
index 8d4a3f8cfcc0a1a39d3edd24bdcf34a1fd94fedf..ec35707dd190b40f14ecd1215e37891b43d1d840 100644 (file)
@@ -473,8 +473,7 @@ protected:
     int onGetTableTags(SkFontTableTag tags[]) const override;
     virtual size_t onGetTableData(SkFontTableTag, size_t offset,
                                   size_t length, void* data) const override;
-    SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
-                                           const SkDescriptor*) const override;
+    SkScalerContext* onCreateScalerContext(const SkDescriptor*) const override;
     void onFilterRec(SkScalerContextRec*) const override;
     void onGetFontDescriptor(SkFontDescriptor*, bool*) const override;
     virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
@@ -630,7 +629,7 @@ struct GlyphRect {
 
 class SkScalerContext_Mac : public SkScalerContext {
 public:
-    SkScalerContext_Mac(SkTypeface_Mac*, const SkScalerContextEffects&, const SkDescriptor*);
+    SkScalerContext_Mac(SkTypeface_Mac*, const SkDescriptor*);
 
 protected:
     unsigned generateGlyphCount(void) override;
@@ -739,9 +738,8 @@ static CTFontRef ctfont_create_exact_copy(CTFontRef baseFont, CGFloat textSize,
 }
 
 SkScalerContext_Mac::SkScalerContext_Mac(SkTypeface_Mac* typeface,
-                                         const SkScalerContextEffects& effects,
                                          const SkDescriptor* desc)
-        : INHERITED(typeface, effects, desc)
+        : INHERITED(typeface, desc)
         , fFBoundingBoxes()
         , fFBoundingBoxesGlyphOffset(0)
         , fGeneratedFBoundingBoxes(false)
@@ -1939,9 +1937,8 @@ size_t SkTypeface_Mac::onGetTableData(SkFontTableTag tag, size_t offset,
     return length;
 }
 
-SkScalerContext* SkTypeface_Mac::onCreateScalerContext(const SkScalerContextEffects& effects,
-                                                       const SkDescriptor* desc) const {
-    return new SkScalerContext_Mac(const_cast<SkTypeface_Mac*>(this), effects, desc);
+SkScalerContext* SkTypeface_Mac::onCreateScalerContext(const SkDescriptor* desc) const {
+    return new SkScalerContext_Mac(const_cast<SkTypeface_Mac*>(this), desc);
 }
 
 void SkTypeface_Mac::onFilterRec(SkScalerContextRec* rec) const {
index 395307cf043c714729fa25b286acf475c896b939..f772d8c57e13b28faebe8ed7f4238001a2f7f271 100644 (file)
@@ -257,8 +257,7 @@ public:
 
 protected:
     SkStreamAsset* onOpenStream(int* ttcIndex) const override;
-    SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
-                                           const SkDescriptor*) const override;
+    SkScalerContext* onCreateScalerContext(const SkDescriptor*) const override;
     void onFilterRec(SkScalerContextRec*) const override;
     SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
                                 PerGlyphInfo, const uint32_t*, uint32_t) const override;
@@ -534,7 +533,7 @@ const void* HDCOffscreen::draw(const SkGlyph& glyph, bool isBW,
 
 class SkScalerContext_GDI : public SkScalerContext {
 public:
-    SkScalerContext_GDI(SkTypeface*, const SkScalerContextEffects&, const SkDescriptor* desc);
+    SkScalerContext_GDI(SkTypeface*, const SkDescriptor* desc);
     virtual ~SkScalerContext_GDI();
 
     // Returns true if the constructor was able to complete all of its
@@ -605,9 +604,8 @@ static BYTE compute_quality(const SkScalerContext::Rec& rec) {
 }
 
 SkScalerContext_GDI::SkScalerContext_GDI(SkTypeface* rawTypeface,
-                                         const SkScalerContextEffects& effects,
-                                         const SkDescriptor* desc)
-        : SkScalerContext(rawTypeface, effects, desc)
+                                                 const SkDescriptor* desc)
+        : SkScalerContext(rawTypeface, desc)
         , fDDC(0)
         , fSavefont(0)
         , fFont(0)
@@ -2287,10 +2285,8 @@ size_t LogFontTypeface::onGetTableData(SkFontTableTag tag, size_t offset,
     return bufferSize == GDI_ERROR ? 0 : bufferSize;
 }
 
-SkScalerContext* LogFontTypeface::onCreateScalerContext(const SkScalerContextEffects& effects,
-                                                        const SkDescriptor* desc) const {
-    SkScalerContext_GDI* ctx = new SkScalerContext_GDI(const_cast<LogFontTypeface*>(this),
-                                                       effects, desc);
+SkScalerContext* LogFontTypeface::onCreateScalerContext(const SkDescriptor* desc) const {
+    SkScalerContext_GDI* ctx = new SkScalerContext_GDI(const_cast<LogFontTypeface*>(this), desc);
     if (!ctx->isValid()) {
         delete ctx;
         ctx = nullptr;
index 4609d04851870891c7b60bb32485e62af90255ed..f276762bbfae666d0a7d2b9f1ce25c059f33cb6a 100644 (file)
@@ -204,9 +204,8 @@ static bool is_axis_aligned(const SkScalerContext::Rec& rec) {
 }
 
 SkScalerContext_DW::SkScalerContext_DW(DWriteFontTypeface* typeface,
-                                       const SkScalerContextEffects& effects,
                                        const SkDescriptor* desc)
-        : SkScalerContext(typeface, effects, desc)
+        : SkScalerContext(typeface, desc)
         , fTypeface(SkRef(typeface))
         , fGlyphCount(-1) {
 
index 9b2477203644a2b9a2f9473169bf7006c5b66016..abf2bc9aa02e75d404e676057cf69b966d3e82d7 100644 (file)
@@ -20,7 +20,7 @@ class SkDescriptor;
 
 class SkScalerContext_DW : public SkScalerContext {
 public:
-    SkScalerContext_DW(DWriteFontTypeface*, const SkScalerContextEffects&, const SkDescriptor*);
+    SkScalerContext_DW(DWriteFontTypeface*, const SkDescriptor* desc);
     virtual ~SkScalerContext_DW();
 
 protected:
index 18c63a5089250747fe7e4418f44c6319d15f463f..160c66ed0eb577d10ea5bbf0f2dcd7366f711052 100644 (file)
@@ -244,9 +244,8 @@ SkStreamAsset* DWriteFontTypeface::onOpenStream(int* ttcIndex) const {
     return new SkDWriteFontFileStream(fontFileStream.get());
 }
 
-SkScalerContext* DWriteFontTypeface::onCreateScalerContext(const SkScalerContextEffects& effects,
-                                                           const SkDescriptor* desc) const {
-    return new SkScalerContext_DW(const_cast<DWriteFontTypeface*>(this), effects, desc);
+SkScalerContext* DWriteFontTypeface::onCreateScalerContext(const SkDescriptor* desc) const {
+    return new SkScalerContext_DW(const_cast<DWriteFontTypeface*>(this), desc);
 }
 
 void DWriteFontTypeface::onFilterRec(SkScalerContext::Rec* rec) const {
index b1237c0e98e48200563101fb4af7e314fad0b508..cdbeeaa785b55d431c9a15bad06aebb2126b3b4c 100644 (file)
@@ -96,8 +96,7 @@ protected:
     }
 
     SkStreamAsset* onOpenStream(int* ttcIndex) const override;
-    SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
-                                           const SkDescriptor*) const override;
+    SkScalerContext* onCreateScalerContext(const SkDescriptor*) const override;
     void onFilterRec(SkScalerContextRec*) const override;
     SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
                                 PerGlyphInfo, const uint32_t*, uint32_t) const override;
index 96af746ace7436d7f5f3425375a3ff38efc946ca..b663b45e1fbc54f06b26521eed06cd183d9b7c98 100644 (file)
@@ -125,8 +125,7 @@ static void test_matchStyleCSS3(skiatest::Reporter* reporter) {
         TestTypeface(const SkFontStyle& fontStyle, SkFontID id) : SkTypeface(fontStyle, id, false){}
     protected:
         SkStreamAsset* onOpenStream(int* ttcIndex) const override { return nullptr; }
-        SkScalerContext* onCreateScalerContext(const SkScalerContextEffects&,
-                                               const SkDescriptor*) const override {
+        SkScalerContext* onCreateScalerContext(const SkDescriptor*) const override {
             return nullptr;
         }
         void onFilterRec(SkScalerContextRec*) const override { }