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

Unified Diff: src/core/SkDraw.cpp

Issue 79283004: Minor fixes for distance field fonts: (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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/GrBitmapTextContext.cpp » ('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 aa91df3df557bfc83d2cb5539933400491ac2c3d..6d82f86df759b358198fd6c49b0c31f24a5e0126 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -2003,6 +2003,8 @@ void SkDraw::drawPosText(const char text[], size_t byteLength,
SkDrawCacheProc glyphCacheProc = paint.getDrawCacheProc();
#if SK_DISTANCEFIELD_FONTS
const SkMatrix* ctm = fMatrix;
bsalomon 2013/11/20 22:18:06 Would it be simpler to turn this into: const SkMa
jvanverth1 2013/11/21 14:25:40 My plan is to rip out all of the distance field co
+ SkMatrix identity;
+ identity.setIdentity();
bsalomon 2013/11/20 22:18:06 setIdentity() should probably be marked deprecated
jvanverth1 2013/11/21 14:25:40 Done.
const SkPaint* paintRef = &paint;
SkPaint paintCopy;
uint32_t procFlags = fProcs ? fProcs->fFlags : 0;
@@ -2012,7 +2014,7 @@ void SkDraw::drawPosText(const char text[], size_t byteLength,
paintRef = &paintCopy;
}
if (procFlags & SkDrawProcs::kSkipBakedGlyphTransform_Flag) {
- ctm = NULL;
+ ctm = &identity;
}
SkAutoGlyphCache autoCache(*paintRef, &fDevice->fLeakyProperties, ctm);
#else
@@ -2036,7 +2038,11 @@ void SkDraw::drawPosText(const char text[], size_t byteLength,
AlignProc alignProc = pick_align_proc(paint.getTextAlign());
SkDraw1Glyph d1g;
SkDraw1Glyph::Proc proc = d1g.init(this, blitter, cache, paint);
+#if SK_DISTANCEFIELD_FONTS
+ TextMapState tms(*ctm, constY);
+#else
TextMapState tms(*fMatrix, constY);
+#endif
TextMapState::Proc tmsProc = tms.pickProc(scalarsPerPosition);
if (cache->isSubpixel()) {
« no previous file with comments | « no previous file | src/gpu/GrBitmapTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698