aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-06-18 16:25:52 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-19 19:56:25 +0000
commit9d85d63468eede1324c88b6e174834eb096113fe (patch)
treeb08d9d455cb2323aadea851abc10cf6d40d2a458 /src/gpu/text
parent91e260f4dbcb4006c3b177c2eba7ed0dc1af3e3d (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/gpu/text')
-rw-r--r--src/gpu/text/GrTextContext.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gpu/text/GrTextContext.cpp b/src/gpu/text/GrTextContext.cpp
index b63b726079..6da4c0d014 100644
--- a/src/gpu/text/GrTextContext.cpp
+++ b/src/gpu/text/GrTextContext.cpp
@@ -217,7 +217,9 @@ void GrTextContext::regenerateTextBlob(GrTextBlob* cacheBlob,
builder.prepareDrawText(runPaint.skPaint(),
(const char*)it.glyphs(), textLen, origin);
- builder.temporaryShuntToCallback(
+ auto glyphRun = builder.useGlyphRun();
+
+ glyphRun->temporaryShuntToCallback(
[&](size_t runSize, const char* glyphIDs, const SkScalar* pos) {
this->drawDFPosText(
cacheBlob, run, glyphCache, props, runPaint, scalerContextFlags,
@@ -250,7 +252,9 @@ void GrTextContext::regenerateTextBlob(GrTextBlob* cacheBlob,
builder.prepareDrawText(runPaint.skPaint(),
(const char*)it.glyphs(), textLen, origin);
- builder.temporaryShuntToCallback(
+ auto glyphRun = builder.useGlyphRun();
+
+ glyphRun->temporaryShuntToCallback(
[&](size_t runSize, const char* glyphIDs, const SkScalar* pos) {
this->DrawBmpPosText(
cacheBlob, run, glyphCache, props, runPaint, scalerContextFlags,
@@ -782,8 +786,9 @@ std::unique_ptr<GrDrawOp> GrTextContext::createOp_TestingOnly(GrContext* context
builder.prepareDrawText(skPaint, text, textLen, origin);
sk_sp<GrTextBlob> blob;
+ auto glyphRun = builder.useGlyphRun();
// Use the text and textLen below, because we don't want to mess with the paint.
- builder.temporaryShuntToCallback(
+ glyphRun->temporaryShuntToCallback(
[&](size_t runSize, const char* glyphIDs, const SkScalar* pos) {
blob = textContext->makeDrawPosTextBlob(
context->contextPriv().getTextBlobCache(), glyphCache,