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

Unified Diff: src/gpu/GrBatchFontCache.h

Issue 1257603005: Minimize retrieving SkGlyph in GrTextContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 5 years, 5 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/GrAtlasTextContext.cpp ('k') | src/gpu/GrBatchFontCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBatchFontCache.h
diff --git a/src/gpu/GrBatchFontCache.h b/src/gpu/GrBatchFontCache.h
index 28aa0364103e240ec8576f056a8f7dd5d30dbf1a..33f313c912730eb14064eca77ce481b5331fb3bf 100644
--- a/src/gpu/GrBatchFontCache.h
+++ b/src/gpu/GrBatchFontCache.h
@@ -11,6 +11,7 @@
#include "GrBatchAtlas.h"
#include "GrFontScaler.h"
#include "GrGlyph.h"
+#include "SkGlyph.h"
#include "SkTDynamicHash.h"
#include "SkVarAlloc.h"
@@ -30,16 +31,17 @@ public:
const GrFontDescKey* getFontScalerKey() const { return fFontScalerKey; }
GrBatchFontCache* getBatchFontCache() const { return fBatchFontCache; }
- inline GrGlyph* getGlyph(GrGlyph::PackedID packed, GrFontScaler* scaler) {
+ inline GrGlyph* getGlyph(const SkGlyph& skGlyph, GrGlyph::PackedID packed,
+ GrFontScaler* scaler) {
GrGlyph* glyph = fCache.find(packed);
if (NULL == glyph) {
- glyph = this->generateGlyph(packed, scaler);
+ glyph = this->generateGlyph(skGlyph, packed, scaler);
}
return glyph;
}
// returns true if glyph successfully added to texture atlas, false otherwise
- bool addGlyphToAtlas(GrBatchTarget*, GrGlyph*, GrFontScaler*);
+ bool addGlyphToAtlas(GrBatchTarget*, GrGlyph*, GrFontScaler*, const SkGlyph&);
// testing
int countGlyphs() const { return fCache.count(); }
@@ -66,7 +68,7 @@ private:
int fAtlasedGlyphs;
bool fIsAbandoned;
- GrGlyph* generateGlyph(GrGlyph::PackedID packed, GrFontScaler* scaler);
+ GrGlyph* generateGlyph(const SkGlyph&, GrGlyph::PackedID, GrFontScaler*);
friend class GrBatchFontCache;
};
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrBatchFontCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698