aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/remote_demo.cpp
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-03-19 15:39:16 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-20 19:11:31 +0000
commitaeb425dbf1735eaad7daef5c1f2d599d170a5a38 (patch)
tree5e51a25c5baa5e339d163665f0c90f610664a25f /tools/remote_demo.cpp
parentb0ca84f3a840e80f7775b9b4fbd3872513c14d7d (diff)
Regularize SkGlyphCache creation.
This allows no need for downcasting for specialized use of SkScalerContext for the remote case. This allows cache priming to be used in a single process. BUG=skia:7515 Change-Id: I963a50e36af9deef5a3414fc8a4c94ccfc38deaf Reviewed-on: https://skia-review.googlesource.com/115121 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'tools/remote_demo.cpp')
-rw-r--r--tools/remote_demo.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/tools/remote_demo.cpp b/tools/remote_demo.cpp
index 8ff7d2986d..7cedaea00b 100644
--- a/tools/remote_demo.cpp
+++ b/tools/remote_demo.cpp
@@ -774,14 +774,8 @@ static void prepopulate_cache(
// TODO: implement effects handling.
SkScalerContextEffects effects;
if ((strike = SkGlyphCache::FindStrikeExclusive(*desc)) == nullptr) {
- auto creator = [&effects, &tf, &fontMetrics](
- const SkDescriptor& descriptor, bool canFail)
- {
- auto scaler = tf->createScalerContext(effects, &descriptor, canFail);
- ((SkScalerContextProxy*)scaler.get())->setFontMetrics(*fontMetrics);
- return scaler;
- };
- strike = SkGlyphCache::CreateStrikeExclusive(*desc,creator);
+ auto scaler = SkGlyphCache::CreateScalerContext(*desc, effects, *tf);
+ strike = SkGlyphCache::CreateStrikeExclusive(*desc, std::move(scaler), fontMetrics);
}
#if INSTRUMENT
std::cout << std::hex << "prepop cache " << (intptr_t)cache