Rearrange code in TextContexts to be more consistent and match style guide.
Review URL: https://codereview.chromium.org/641613003
diff --git a/src/gpu/GrDistanceFieldTextContext.h b/src/gpu/GrDistanceFieldTextContext.h
index 0b08b59..d628e3e 100644
--- a/src/gpu/GrDistanceFieldTextContext.h
+++ b/src/gpu/GrDistanceFieldTextContext.h
@@ -21,6 +21,8 @@
GrDistanceFieldTextContext(GrContext*, const SkDeviceProperties&, bool enable);
virtual ~GrDistanceFieldTextContext();
+ virtual bool canDraw(const SkPaint& paint) SK_OVERRIDE;
+
virtual void drawText(const GrPaint&, const SkPaint&, const char text[], size_t byteLength,
SkScalar x, SkScalar y) SK_OVERRIDE;
virtual void drawPosText(const GrPaint&, const SkPaint&,
@@ -28,26 +30,7 @@
const SkScalar pos[], int scalarsPerPosition,
const SkPoint& offset) SK_OVERRIDE;
- virtual bool canDraw(const SkPaint& paint) SK_OVERRIDE;
-
private:
- GrTextStrike* fStrike;
- SkScalar fTextRatio;
- bool fUseLCDText;
- bool fEnableDFRendering;
- SkAutoTUnref<GrGeometryProcessor> fCachedGeometryProcessor;
- // 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 {
kMinRequestedGlyphs = 1,
kDefaultRequestedGlyphs = 64,
@@ -55,11 +38,27 @@
kDefaultRequestedVerts = kDefaultRequestedGlyphs * 4,
};
- void* fVertices;
- int32_t fMaxVertices;
- GrTexture* fCurrTexture;
- int fCurrVertex;
- SkRect fVertexBounds;
+ GrTextStrike* fStrike;
+ SkScalar fTextRatio;
+ bool fUseLCDText;
+ bool fEnableDFRendering;
+ SkAutoTUnref<GrGeometryProcessor> fCachedGeometryProcessor;
+ // Used to check whether fCachedEffect is still valid.
+ uint32_t fEffectTextureUniqueID;
+ SkColor fEffectColor;
+ uint32_t fEffectFlags;
+ GrTexture* fGammaTexture;
+ void* fVertices;
+ int32_t fMaxVertices;
+ GrTexture* fCurrTexture;
+ int fCurrVertex;
+ SkRect fVertexBounds;
+
+ void init(const GrPaint&, const SkPaint&);
+ void appendGlyph(GrGlyph::PackedID, SkFixed left, SkFixed top, GrFontScaler*);
+ void setupCoverageEffect(const SkColor& filteredColor);
+ void flush(); // automatically called by destructor
+ void finish();
};
#endif