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

Unified Diff: src/core/SkDraw.cpp

Issue 1424173005: Replace glyph find and position with common code for the gpu bitmap case. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: keep blitter choose alive 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/core/SkFindAndPlaceGlyph.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDraw.cpp
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 0b650bea441fdc25fa87a78f190232fb4a9d97bc..4be510c2c7c207394a11918c3f765b1cd7a6731b 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1748,13 +1748,10 @@ void SkDraw::drawPosText(const char text[], size_t byteLength,
return;
}
- SkDrawCacheProc glyphCacheProc = paint.getDrawCacheProc();
- SkAutoGlyphCache autoCache(paint, &fDevice->surfaceProps(), fMatrix);
- SkGlyphCache* cache = autoCache.getCache();
-
+ // The Blitter Choose needs to be live while using the blitter below.
+ SkAutoBlitterChoose blitterChooser;
SkAAClipBlitterWrapper wrapper;
- SkAutoBlitterChoose blitterChooser;
- SkBlitter* blitter = nullptr;
+ SkBlitter* blitter = nullptr;
if (needsRasterTextBlit(*this)) {
blitterChooser.choose(fDst, *fMatrix, paint);
blitter = blitterChooser.get();
@@ -1764,23 +1761,21 @@ void SkDraw::drawPosText(const char text[], size_t byteLength,
}
}
+ SkAutoGlyphCache autoCache(paint, &fDevice->surfaceProps(), fMatrix);
+ SkGlyphCache* cache = autoCache.getCache();
SkDraw1Glyph d1g;
SkDraw1Glyph::Proc proc = d1g.init(this, blitter, cache, paint);
+ SkPaint::Align textAlignment = paint.getTextAlign();
+ SkDrawCacheProc glyphCacheProc = paint.getDrawCacheProc();
- auto processOneGlyph =
+ SkFindAndPlaceGlyph::ProcessPosText(
+ text, byteLength, offset, *fMatrix, pos, scalarsPerPosition,
+ textAlignment, glyphCacheProc, cache,
[&](const SkGlyph& glyph, SkPoint position, SkPoint rounding) {
position += rounding;
proc(d1g, SkScalarToFixed(position.fX), SkScalarToFixed(position.fY), glyph);
- };
-
- SkPaint::Align textAlignment = paint.getTextAlign();
- if (!SkFindAndPlaceGlyph::SpecializedProcessPosText(
- text, byteLength, offset, *fMatrix, pos, scalarsPerPosition,
- textAlignment, glyphCacheProc, cache, processOneGlyph)) {
- SkFindAndPlaceGlyph::ProcessPosText(
- text, byteLength, offset, *fMatrix, pos, scalarsPerPosition,
- textAlignment, glyphCacheProc, cache, processOneGlyph);
- }
+ }
+ );
}
#if defined _WIN32 && _MSC_VER >= 1300
« no previous file with comments | « no previous file | src/core/SkFindAndPlaceGlyph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698