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

Unified Diff: src/gpu/GrBatchFontCache.cpp

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 | « src/gpu/GrBatchFontCache.h ('k') | src/gpu/batches/GrAtlasTextBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBatchFontCache.cpp
diff --git a/src/gpu/GrBatchFontCache.cpp b/src/gpu/GrBatchFontCache.cpp
index f3844cecbacdaabee62fd59ec9872452506f5743..ad76e4d71fa13e8ef7c9bcc26130b6a692e813b6 100644
--- a/src/gpu/GrBatchFontCache.cpp
+++ b/src/gpu/GrBatchFontCache.cpp
@@ -196,8 +196,9 @@ void GrBatchTextStrike::removeID(GrBatchAtlas::AtlasID id) {
}
}
-bool GrBatchTextStrike::addGlyphToAtlas(GrDrawBatch::Target* target, GrGlyph* glyph,
- GrFontScaler* scaler, const SkGlyph& skGlyph,
+bool GrBatchTextStrike::addGlyphToAtlas(GrDrawBatch::Target* target,
+ GrGlyph* glyph,
+ GrFontScaler* scaler,
GrMaskFormat expectedMaskFormat) {
SkASSERT(glyph);
SkASSERT(scaler);
@@ -210,6 +211,7 @@ bool GrBatchTextStrike::addGlyphToAtlas(GrDrawBatch::Target* target, GrGlyph* gl
size_t size = glyph->fBounds.area() * bytesPerPixel;
SkAutoSMalloc<1024> storage(size);
+ const SkGlyph& skGlyph = scaler->grToSkGlyph(glyph->fPackedID);
if (GrGlyph::kDistance_MaskStyle == GrGlyph::UnpackMaskStyle(glyph->fPackedID)) {
if (!scaler->getPackedGlyphDFImage(skGlyph, glyph->width(), glyph->height(),
storage.get())) {
« no previous file with comments | « src/gpu/GrBatchFontCache.h ('k') | src/gpu/batches/GrAtlasTextBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698