aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2012-03-20 14:42:45 -0400
committerDerek Sollenberger <djsollen@google.com>2012-03-20 14:42:45 -0400
commitb9e9dcfa17a61a0cc2c192daae78d0af2927736a (patch)
tree60082bb72704f8a7a087f6729342bbf1f2875e42 /src
parent83df1caf0a1492e4de67551177c3dbf1ae92c3da (diff)
downloadexternal_skia-b9e9dcfa17a61a0cc2c192daae78d0af2927736a.zip
external_skia-b9e9dcfa17a61a0cc2c192daae78d0af2927736a.tar.gz
external_skia-b9e9dcfa17a61a0cc2c192daae78d0af2927736a.tar.bz2
Fix incorrectly rendered stroked text on path
If the paint has a text point size that is small (e.g. < 1) then the results returned from FreeType are not accurate. This code is an adapation of the Skia CL that was reviewed at http://codereview.appspot.com/5844060/ Change-Id: I3ca1d69b2097b47b344ec9f56a04fe94da76013d http://code.google.com/p/android/issues/detail?id=26764
Diffstat (limited to 'src')
-rw-r--r--src/core/SkPaint.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index b0b855a..e93e8d6 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -2018,9 +2018,12 @@ SkTextToPathIter::SkTextToPathIter( const char text[], size_t length,
}
// can't use our canonical size if we need to apply patheffects/strokes
- if (fPaint.isLinearText() && !applyStrokeAndPathEffects) {
+ if (fPaint.getPathEffect() == NULL) {
fPaint.setTextSize(SkIntToScalar(SkPaint::kCanonicalTextSizeForPaths));
fScale = paint.getTextSize() / SkPaint::kCanonicalTextSizeForPaths;
+ if (has_thick_frame(fPaint)) {
+ fPaint.setStrokeWidth(SkScalarDiv(fPaint.getStrokeWidth(), fScale));
+ }
} else {
fScale = SK_Scalar1;
}