diff options
author | Herb Derby <herb@google.com> | 2018-07-30 10:10:40 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-31 20:51:18 +0000 |
commit | 0ab5ce151c4507966c135ab3986cf2b28b36d6c6 (patch) | |
tree | 42fac4dd57f2027f027be03f43343059f27b30af /src/core/SkDraw.cpp | |
parent | a83bb57bfe2be07a7fb60cd01417e8c69e77e967 (diff) |
Move path leaf loop to drawer
This CL makes GPU and Raster use the same path drawing interface. When
I get the main body of regenerate over into the glyph run system, I
I can refactor a lot of annoyingly similar code away.
Change-Id: I6bd2e6119570062695d6943565749d85555b03fa
Reviewed-on: https://skia-review.googlesource.com/144350
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src/core/SkDraw.cpp')
-rw-r--r-- | src/core/SkDraw.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index b35d7f9f4c..177d38f535 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -1628,9 +1628,18 @@ void SkDraw::drawGlyphRunList( return; } - auto perPathBuilder = [this](const SkPaint& paint, SkArenaAlloc*) { - auto perPath = [this, &paint](const SkPath& path, const SkMatrix& matrix) { - this->drawPath(path, paint, &matrix, false); + SkMatrix renderMatrix{*fMatrix}; + auto perPathBuilder = [this, &renderMatrix] + (const SkPaint& paint, SkScalar scaleMatrix, SkArenaAlloc*) { + renderMatrix.setScale(scaleMatrix, scaleMatrix); + auto perPath = + [this, &renderMatrix, &paint] + (const SkPath* path, const SkGlyph&, SkPoint position) { + if (path != nullptr) { + renderMatrix[SkMatrix::kMTransX] = position.fX; + renderMatrix[SkMatrix::kMTransY] = position.fY; + this->drawPath(*path, paint, &renderMatrix, false); + } }; return perPath; }; |