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

Unified Diff: src/core/SkPaint.cpp

Issue 1985613003: Add a mode to force linear-text in SkCanonicalizePaint Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 25b6aec1ec46da9239a69aae39acfff5aee6e645..46ea86b8c352d3f4f1e8c24a5ebb15465af3a328 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -711,9 +711,11 @@ SkScalar SkPaint::setupForAsPaths() {
class SkCanonicalizePaint {
public:
- SkCanonicalizePaint(const SkPaint& paint) : fPaint(&paint), fScale(0) {
- if (paint.isLinearText() || SkDraw::ShouldDrawTextAsPaths(paint, SkMatrix::I())) {
+ SkCanonicalizePaint(const SkPaint& paint, bool forceLinearText = false) : fPaint(&paint), fScale(0) {
+ if (forceLinearText || paint.isLinearText() || SkDraw::ShouldDrawTextAsPaths(paint, SkMatrix::I())) {
SkPaint* p = fLazy.set(paint);
+ if (forceLinearText)
+ p->setLinearText(true);
fScale = p->setupForAsPaths();
fPaint = p;
}
@@ -999,7 +1001,7 @@ int SkPaint::getTextWidths(const void* textData, size_t byteLength,
return this->countText(textData, byteLength);
}
- SkCanonicalizePaint canon(*this);
+ SkCanonicalizePaint canon(*this, true);
const SkPaint& paint = canon.getPaint();
SkScalar scale = canon.getScale();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698