diff options
author | Herb Derby <herb@google.com> | 2018-06-18 16:25:52 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-19 19:56:25 +0000 |
commit | 9d85d63468eede1324c88b6e174834eb096113fe (patch) | |
tree | b08d9d455cb2323aadea851abc10cf6d40d2a458 /src/core/SkCanvas.cpp | |
parent | 91e260f4dbcb4006c3b177c2eba7ed0dc1af3e3d (diff) |
Use SkGlyphRun instead of builder
Move from passing builder down the stack to passing the
object we really want to be the interface down the stack.
Move code that shunts from glyph run style to drawTextPos
to the SkGlyphRun from the builder.
Change-Id: Iefaca69104737ce46c06fbb26dc99996784b2bdb
Reviewed-on: https://skia-review.googlesource.com/135620
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'src/core/SkCanvas.cpp')
-rw-r--r-- | src/core/SkCanvas.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 494bd3b837..be55947efd 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -2452,7 +2452,8 @@ void SkCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkSca while (iter.next()) { fScratchGlyphRunBuilder->prepareDrawText(paint, text, byteLength, SkPoint::Make(x, y)); - iter.fDevice->drawGlyphRun(looper.paint(), fScratchGlyphRunBuilder.get()); + auto glyphRun = fScratchGlyphRunBuilder->useGlyphRun(); + iter.fDevice->drawGlyphRun(looper.paint(), glyphRun); } LOOPER_END @@ -2465,7 +2466,8 @@ void SkCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoint while (iter.next()) { fScratchGlyphRunBuilder->prepareDrawPosText(paint, text, byteLength, pos); - iter.fDevice->drawGlyphRun(looper.paint(), fScratchGlyphRunBuilder.get()); + auto glyphRun = fScratchGlyphRunBuilder->useGlyphRun(); + iter.fDevice->drawGlyphRun(looper.paint(), glyphRun); } LOOPER_END @@ -2478,7 +2480,8 @@ void SkCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkScala while (iter.next()) { fScratchGlyphRunBuilder->prepareDrawPosTextH(paint, text, byteLength, xpos, constY); - iter.fDevice->drawGlyphRun(looper.paint(), fScratchGlyphRunBuilder.get()); + const auto& glyphRun = fScratchGlyphRunBuilder->useGlyphRun(); + iter.fDevice->drawGlyphRun(looper.paint(), glyphRun); } LOOPER_END |