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

Unified Diff: src/gpu/GrBatchFontCache.h

Issue 1467133003: Remove unecessary GetGlyphIdMetrics call (Closed) Base URL: https://skia.googlesource.com/skia.git@temptext
Patch Set: added comment Created 5 years, 1 month 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 | « no previous file | 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 946356656bc248772b0c9cc551129a8596ee6c31..46ab1c82741a2820f00fdc36358f2e8b17c549c7 100644
--- a/src/gpu/GrBatchFontCache.h
+++ b/src/gpu/GrBatchFontCache.h
@@ -43,10 +43,15 @@ public:
// that the maskformat of the glyph differs from what we expect. In these cases we will just
// draw a clear square.
// skbug:4143 crbug:510931
- inline GrGlyph* getGlyph(const SkGlyph& skGlyph, GrGlyph::PackedID packed,
- GrMaskFormat expectedMaskFormat, GrFontScaler* scaler) {
+ inline GrGlyph* getGlyph(GrGlyph::PackedID packed,
+ GrMaskFormat expectedMaskFormat,
+ GrFontScaler* scaler) {
GrGlyph* glyph = fCache.find(packed);
if (nullptr == glyph) {
+ // We could return this to the caller, but in practice it adds code complexity for
+ // potentially little benefit(ie, if the glyph is not in our font cache, then its not
+ // in the atlas and we're going to be doing a texture upload anyways).
+ const SkGlyph& skGlyph = scaler->grToSkGlyph(packed);
glyph = this->generateGlyph(skGlyph, packed, scaler);
glyph->fMaskFormat = expectedMaskFormat;
}
@@ -58,7 +63,7 @@ public:
// happen.
// TODO we can handle some of these cases if we really want to, but the long term solution is to
// get the actual glyph image itself when we get the glyph metrics.
- bool addGlyphToAtlas(GrDrawBatch::Target*, GrGlyph*, GrFontScaler*, const SkGlyph&,
+ bool addGlyphToAtlas(GrDrawBatch::Target*, GrGlyph*, GrFontScaler*,
GrMaskFormat expectedMaskFormat);
// testing
« no previous file with comments | « no previous file | src/gpu/GrBatchFontCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698