Restore text vertex buffer alloc and other optimizations.
Modifies the fontcache GM to ensure that the font cache is forced to flush.
R=bsalomon@google.com, robertphillips@google.com
Author: jvanverth@google.com
Review URL: https://codereview.chromium.org/466363009
diff --git a/src/gpu/GrBitmapTextContext.h b/src/gpu/GrBitmapTextContext.h
index 6d4ea6d..24ee7e8 100644
--- a/src/gpu/GrBitmapTextContext.h
+++ b/src/gpu/GrBitmapTextContext.h
@@ -30,9 +30,8 @@
virtual bool canDraw(const SkPaint& paint) SK_OVERRIDE;
private:
- GrTextStrike* fStrike;
-
void init(const GrPaint&, const SkPaint&);
+ void allocateVertices(const char text[], size_t byteLength);
void drawPackedGlyph(GrGlyph::PackedID, SkFixed left, SkFixed top, GrFontScaler*);
void flushGlyphs(); // automatically called by destructor
void finish();
@@ -44,12 +43,13 @@
kDefaultRequestedVerts = kDefaultRequestedGlyphs * 4,
};
- void* fVertices;
- int32_t fMaxVertices;
- GrTexture* fCurrTexture;
+ GrTextStrike* fStrike;
SkAutoTUnref<GrEffect> fCachedEffect;
// Used to check whether fCachedEffect is still valid.
uint32_t fEffectTextureUniqueID;
+
+ void* fVertices;
+ int fVertexCount;
int fCurrVertex;
SkRect fVertexBounds;
};