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

Unified Diff: src/gpu/GrBatchFontCache.h

Issue 1087203004: Store pointers to GrGlyph directly in BitmapTextBlob (Closed) Base URL: https://skia.googlesource.com/skia.git@atdfopt2
Patch Set: more Created 5 years, 8 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
Index: src/gpu/GrBatchFontCache.h
diff --git a/src/gpu/GrBatchFontCache.h b/src/gpu/GrBatchFontCache.h
index 6aa14e69daf271fd05f049c9acbb76fb820c78c4..5b163428bd7823c602d27eca6f2065be62bb3146 100644
--- a/src/gpu/GrBatchFontCache.h
+++ b/src/gpu/GrBatchFontCache.h
@@ -24,7 +24,7 @@ class GrGpu;
* is abstracted by GrGlyph, and indexed by a PackedID and GrFontScaler. The GrFontScaler is what
* actually creates the mask.
*/
-class GrBatchTextStrike {
+class GrBatchTextStrike : public SkNVRefCnt<GrBatchTextStrike> {
public:
GrBatchTextStrike(GrBatchFontCache*, const GrFontDescKey* fontScalerKey);
~GrBatchTextStrike();
@@ -52,6 +52,9 @@ public:
// remove any references to this plot
void removeID(GrBatchAtlas::AtlasID);
+ // If a TextStrike is abandoned by the cache, then the caller must get a new strike
+ bool isAbandoned() const { return fIsAbandoned; }
+
static const GrFontDescKey& GetKey(const GrBatchTextStrike& ts) {
return *(ts.fFontScalerKey);
}
@@ -66,6 +69,7 @@ private:
GrBatchFontCache* fBatchFontCache;
int fAtlasedGlyphs;
+ bool fIsAbandoned;
GrGlyph* generateGlyph(GrGlyph::PackedID packed, GrFontScaler* scaler);

Powered by Google App Engine
This is Rietveld 408576698