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

Unified Diff: src/core/SkPaint.cpp

Issue 20693003: Fix several issues with drawing text as paths. Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 months 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/core/SkDraw.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPaint.cpp
===================================================================
--- src/core/SkPaint.cpp (revision 10398)
+++ src/core/SkPaint.cpp (working copy)
@@ -986,7 +986,10 @@
SkScalar textSize = fTextSize;
this->setTextSize(kCanonicalTextSizeForPaths);
- return textSize / kCanonicalTextSizeForPaths;
+ SkScalar scale = textSize / kCanonicalTextSizeForPaths;
+ this->setStrokeWidth(fWidth / scale);
reed1 2013/07/29 14:44:39 Can this be: setStrokeWIdth(fWidth * kCanonical /
bungeman-skia 2013/07/29 14:54:18 Sure, so long as its the same number, doesn't matt
+ //this->setStrokeMiter(fMiterLimit / scale);
reed1 2013/07/29 14:44:39 Do we need this line?
bungeman-skia 2013/07/29 14:54:18 Probably? The only reason it's commented out is th
bungeman-skia 2014/05/22 15:06:25 Mike pointed out to me that the miter limit is act
+ return scale;
}
class SkCanonicalizePaint {
@@ -2501,7 +2504,6 @@
fGlyphCacheProc = paint.getMeasureCacheProc(SkPaint::kForward_TextBufferDirection,
true);
- fPaint.setLinearText(true);
fPaint.setMaskFilter(NULL); // don't want this affecting our path-cache lookup
if (fPaint.getPathEffect() == NULL && !has_thick_frame(fPaint)) {
@@ -2509,7 +2511,7 @@
}
// can't use our canonical size if we need to apply patheffects
- if (fPaint.getPathEffect() == NULL) {
+ if (fPaint.isLinearText() && fPaint.getPathEffect() == NULL) {
fPaint.setTextSize(SkIntToScalar(SkPaint::kCanonicalTextSizeForPaths));
fScale = paint.getTextSize() / SkPaint::kCanonicalTextSizeForPaths;
if (has_thick_frame(fPaint)) {
« no previous file with comments | « src/core/SkDraw.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698