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

Unified Diff: src/core/SkDraw.cpp

Issue 16378003: call through to the device from SkDraw (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 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 | « gyp/gmslides.gypi ('k') | no next file » | 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 5782fc537eb25f31f06068c61f7d8270a6dd314c..30d5956ae839e6a39ee622bc823fda91a3e0215c 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1861,12 +1861,8 @@ void SkDraw::drawPosText_asPaths(const char text[], size_t byteLength,
SkPaint paint(origPaint);
SkScalar matrixScale = paint.setupForAsPaths();
- SkDraw draw(*this);
-
- // Now modify our matrix to account for the canonical text size
- SkMatrix matrix = *fMatrix;
- matrix.preScale(matrixScale, matrixScale);
- const SkScalar posScale = SkScalarInvert(matrixScale);
+ SkMatrix matrix;
+ matrix.setScale(matrixScale, matrixScale);
SkDrawCacheProc glyphCacheProc = paint.getDrawCacheProc();
SkAutoGlyphCache autoCache(paint, NULL, NULL);
@@ -1886,11 +1882,13 @@ void SkDraw::drawPosText_asPaths(const char text[], size_t byteLength,
SkIPoint fixedLoc;
alignProc(tms.fLoc, glyph, &fixedLoc);
- SkMatrix localMatrix = matrix;
- localMatrix.preTranslate(SkFixedToScalar(fixedLoc.fX) * posScale,
- SkFixedToScalar(fixedLoc.fY) * posScale);
- draw.fMatrix = &localMatrix;
- draw.drawPath(*path, paint);
+ matrix[SkMatrix::kMTransX] = SkFixedToScalar(fixedLoc.fX);
+ matrix[SkMatrix::kMTransY] = SkFixedToScalar(fixedLoc.fY);
+ if (fDevice) {
+ fDevice->drawPath(*this, *path, paint, &matrix, false);
+ } else {
+ this->drawPath(*path, paint, &matrix, false);
+ }
}
}
pos += scalarsPerPosition;
« no previous file with comments | « gyp/gmslides.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698