Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Unified Diff: src/gpu/GrDistanceFieldTextContext.h

Issue 641613003: Rearrange code in TextContexts to be more consistent. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Some more indention clean up Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrBitmapTextContext.cpp ('k') | src/gpu/GrDistanceFieldTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDistanceFieldTextContext.h
diff --git a/src/gpu/GrDistanceFieldTextContext.h b/src/gpu/GrDistanceFieldTextContext.h
index 0b08b5986c154d5a776530ee8d02b115cd1074c6..d628e3e3bdd81673556457a32ef63dac2d67f495 100644
--- a/src/gpu/GrDistanceFieldTextContext.h
+++ b/src/gpu/GrDistanceFieldTextContext.h
@@ -21,6 +21,8 @@ public:
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,38 +30,35 @@ public:
const SkScalar pos[], int scalarsPerPosition,
const SkPoint& offset) SK_OVERRIDE;
- virtual bool canDraw(const SkPaint& paint) SK_OVERRIDE;
-
private:
+ enum {
+ kMinRequestedGlyphs = 1,
+ kDefaultRequestedGlyphs = 64,
+ kMinRequestedVerts = kMinRequestedGlyphs * 4,
+ kDefaultRequestedVerts = kDefaultRequestedGlyphs * 4,
+ };
+
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;
+ 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 drawPackedGlyph(GrGlyph::PackedID, SkFixed left, SkFixed top, GrFontScaler*);
- void flushGlyphs(); // automatically called by destructor
+ void appendGlyph(GrGlyph::PackedID, SkFixed left, SkFixed top, GrFontScaler*);
void setupCoverageEffect(const SkColor& filteredColor);
+ void flush(); // automatically called by destructor
void finish();
-
- enum {
- kMinRequestedGlyphs = 1,
- kDefaultRequestedGlyphs = 64,
- kMinRequestedVerts = kMinRequestedGlyphs * 4,
- kDefaultRequestedVerts = kDefaultRequestedGlyphs * 4,
- };
-
- void* fVertices;
- int32_t fMaxVertices;
- GrTexture* fCurrTexture;
- int fCurrVertex;
- SkRect fVertexBounds;
};
#endif
« no previous file with comments | « src/gpu/GrBitmapTextContext.cpp ('k') | src/gpu/GrDistanceFieldTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698