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

Unified Diff: src/gpu/batches/GrAtlasTextBatch.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.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAtlasTextBatch.cpp
diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp
index cfc97c44e199bc382997e56b6daaaff9f5887a53..8e886d2060b5dcbb5af399507311e89854c87a6f 100644
--- a/src/gpu/batches/GrAtlasTextBatch.cpp
+++ b/src/gpu/batches/GrAtlasTextBatch.cpp
@@ -168,24 +168,18 @@ void GrAtlasTextBatch::regenBlob(Target* target, FlushInfo* flushInfo, Blob* blo
if (regenTexCoords) {
size_t glyphOffset = glyphIdx + info->fGlyphStartIndex;
- glyph = blob->fGlyphs[glyphOffset];
- GrGlyph::PackedID id = glyph->fPackedID;
- const SkGlyph& skGlyph = (*scaler)->grToSkGlyph(id);
if (regenGlyphs) {
// Get the id from the old glyph, and use the new strike to lookup
// the glyph.
- blob->fGlyphs[glyphOffset] = strike->getGlyph(skGlyph, id, this->maskFormat(),
- *scaler);
+ GrGlyph::PackedID id = blob->fGlyphs[glyphOffset]->fPackedID;
+ blob->fGlyphs[glyphOffset] = strike->getGlyph(id, this->maskFormat(), *scaler);
+ SkASSERT(id == blob->fGlyphs[glyphOffset]->fPackedID);
}
glyph = blob->fGlyphs[glyphOffset];
- SkASSERT(glyph);
- SkASSERT(id == glyph->fPackedID);
- // We want to be able to assert this but cannot for testing purposes.
- // once skbug:4143 has landed we can revist this assert
- //SkASSERT(glyph->fMaskFormat == this->maskFormat());
+ SkASSERT(glyph && glyph->fMaskFormat == this->maskFormat());
if (!fFontCache->hasGlyph(glyph) &&
- !strike->addGlyphToAtlas(target, glyph, *scaler, skGlyph, this->maskFormat())) {
+ !strike->addGlyphToAtlas(target, glyph, *scaler, this->maskFormat())) {
this->flush(target, flushInfo);
target->initDraw(gp, this->pipeline());
brokenRun = glyphIdx > 0;
@@ -193,7 +187,6 @@ void GrAtlasTextBatch::regenBlob(Target* target, FlushInfo* flushInfo, Blob* blo
SkDEBUGCODE(bool success =) strike->addGlyphToAtlas(target,
glyph,
*scaler,
- skGlyph,
this->maskFormat());
SkASSERT(success);
}
« no previous file with comments | « src/gpu/GrBatchFontCache.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698