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

Unified Diff: src/gpu/GrAtlasTextContext.cpp

Issue 1517563002: Move appending of large glyphs into GrAtlasTextBlob (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanuptext6
Patch Set: rebase Created 5 years 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlasTextContext.cpp
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index 615f7091cdbf34ce37a168d619205dc5bfb33561..153d0fe5169461a16ee92f40f757f37ca65540ee 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -889,19 +889,14 @@ void GrAtlasTextContext::bmpAppendGlyph(GrAtlasTextBlob* blob, int runIndex,
int width = glyph->fBounds.width();
int height = glyph->fBounds.height();
- // If the glyph is too large we fall back to paths
- if (glyph->fTooLargeForAtlas) {
- this->appendGlyphPath(blob, glyph, scaler, skGlyph, SkIntToScalar(vx), SkIntToScalar(vy));
- return;
- }
-
SkRect r;
r.fLeft = SkIntToScalar(x);
r.fTop = SkIntToScalar(y);
r.fRight = r.fLeft + SkIntToScalar(width);
r.fBottom = r.fTop + SkIntToScalar(height);
- blob->appendGlyph(runIndex, r, color, fCurrStrike, glyph);
+ blob->appendGlyph(runIndex, r, color, fCurrStrike, glyph, scaler, skGlyph,
+ SkIntToScalar(vx), SkIntToScalar(vy), 1.0f, false);
}
bool GrAtlasTextContext::dfAppendGlyph(GrAtlasTextBlob* blob, int runIndex,
@@ -941,32 +936,11 @@ bool GrAtlasTextContext::dfAppendGlyph(GrAtlasTextBlob* blob, int runIndex,
sy += dy;
SkRect glyphRect = SkRect::MakeXYWH(sx, sy, width, height);
- // TODO combine with the above
- // If the glyph is too large we fall back to paths
- if (glyph->fTooLargeForAtlas) {
- this->appendGlyphPath(blob, glyph, scaler, skGlyph, sx - dx, sy - dy, scale, true);
- return true;
- }
-
- blob->appendGlyph(runIndex, glyphRect, color, fCurrStrike, glyph);
+ blob->appendGlyph(runIndex, glyphRect, color, fCurrStrike, glyph, scaler, skGlyph,
+ sx - dx, sy - dy, scale, true);
return true;
}
-inline void GrAtlasTextContext::appendGlyphPath(GrAtlasTextBlob* blob, GrGlyph* glyph,
- GrFontScaler* scaler, const SkGlyph& skGlyph,
- SkScalar x, SkScalar y, SkScalar scale,
- bool applyVM) {
- if (nullptr == glyph->fPath) {
- const SkPath* glyphPath = scaler->getGlyphPath(skGlyph);
- if (!glyphPath) {
- return;
- }
-
- glyph->fPath = new SkPath(*glyphPath);
- }
- blob->fBigGlyphs.push_back(GrAtlasTextBlob::BigGlyph(*glyph->fPath, x, y, scale, applyVM));
-}
-
void GrAtlasTextContext::flushRunAsPaths(GrDrawContext* dc,
const SkTextBlobRunIterator& it,
const GrClip& clip, const SkPaint& skPaint,
« no previous file with comments | « src/gpu/GrAtlasTextContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698