diff options
author | 2018-03-19 15:39:16 -0400 | |
---|---|---|
committer | 2018-03-20 19:11:31 +0000 | |
commit | aeb425dbf1735eaad7daef5c1f2d599d170a5a38 (patch) | |
tree | 5e51a25c5baa5e339d163665f0c90f610664a25f /src/core/SkScalerContext.cpp | |
parent | b0ca84f3a840e80f7775b9b4fbd3872513c14d7d (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 'src/core/SkScalerContext.cpp')
-rw-r--r-- | src/core/SkScalerContext.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp index b8778282e2..6302a80dc1 100644 --- a/src/core/SkScalerContext.cpp +++ b/src/core/SkScalerContext.cpp @@ -805,6 +805,10 @@ std::unique_ptr<SkScalerContext> SkTypeface::createScalerContext( c = skstd::make_unique<SkScalerContext_Empty>(sk_ref_sp(const_cast<SkTypeface*>(this)), effects, desc); } + + // !allowFailure implies c != nullptr + SkASSERT(c || allowFailure); + return c; } |