Add effect caching to distance field text.
This also is a step towards unifying GrDistanceFieldTextureEffect and GrDistanceFieldLCDTextureEffect.
Committed: https://skia.googlesource.com/skia/+/137bac067306c5446bc4f9797bedc3bbaf302822
R=robertphillips@google.com
Author: jvanverth@google.com
Review URL: https://codereview.chromium.org/424103002
diff --git a/src/gpu/GrDistanceFieldTextContext.h b/src/gpu/GrDistanceFieldTextContext.h
index 7676fc1..672922d 100644
--- a/src/gpu/GrDistanceFieldTextContext.h
+++ b/src/gpu/GrDistanceFieldTextContext.h
@@ -34,11 +34,17 @@
SkScalar fTextRatio;
bool fUseLCDText;
bool fEnableDFRendering;
+ SkAutoTUnref<GrEffect> fCachedEffect;
+ // Used to check whether fCachedEffect is still valid.
+ uint32_t fEffectTextureUniqueID;
+ SkColor fEffectColor;
+ uint32_t fEffectFlags;
GrTexture* fGammaTexture;
void init(const GrPaint&, const SkPaint&);
void drawPackedGlyph(GrGlyph::PackedID, SkFixed left, SkFixed top, GrFontScaler*);
void flushGlyphs(); // automatically called by destructor
+ void setupCoverageEffect(const SkColor& filteredColor);
void finish();
enum {