aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-01-23 13:39:21 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-23 21:55:50 +0000
commit980a48de64baf2f974f6c99096391280d1c1d22c (patch)
tree8268924145dd50b4e6ce3e2e01bb36fb536ca948 /src/gpu
parent27059d36d63284b1af2c25e0e5a52c17485c54d7 (diff)
Move glyph cache and descriptor functions off of SkPaint
BUG=skia:7515 Change-Id: If17b157db1077a9a3c0f9efd03929f62a3486419 Reviewed-on: https://skia-review.googlesource.com/98841 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/text/GrAtlasTextBlob.cpp3
-rw-r--r--src/gpu/text/GrAtlasTextContext.cpp4
-rw-r--r--src/gpu/text/GrStencilAndCoverTextContext.cpp5
3 files changed, 7 insertions, 5 deletions
diff --git a/src/gpu/text/GrAtlasTextBlob.cpp b/src/gpu/text/GrAtlasTextBlob.cpp
index 7fce4ba856..887addd25c 100644
--- a/src/gpu/text/GrAtlasTextBlob.cpp
+++ b/src/gpu/text/GrAtlasTextBlob.cpp
@@ -59,7 +59,8 @@ SkGlyphCache* GrAtlasTextBlob::setupCache(int runIndex,
SkAutoDescriptor* desc = run->fOverrideDescriptor.get() ? run->fOverrideDescriptor.get() :
&run->fDescriptor;
SkScalerContextEffects effects;
- skPaint.getScalerContextDescriptor(&effects, desc, &props, scalerContextFlags, viewMatrix);
+ SkScalerContext::CreateDescriptorAndEffectsUsingPaint(
+ skPaint, &props, scalerContextFlags, viewMatrix, desc, &effects);
run->fTypeface.reset(SkSafeRef(skPaint.getTypeface()));
run->fPathEffect = sk_ref_sp(effects.fPathEffect);
run->fMaskFilter = sk_ref_sp(effects.fMaskFilter);
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp
index 41c46466ac..1dce4e0d44 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrAtlasTextContext.cpp
@@ -602,8 +602,8 @@ void GrAtlasTextContext::drawDFText(GrAtlasTextBlob* blob, int runIndex,
SkScalerContextEffects effects;
// We apply the fake-gamma by altering the distance in the shader, so we ignore the
// passed-in scaler context flags. (It's only used when we fall-back to bitmap text).
- skPaint.getScalerContextDescriptor(&effects, &desc, &props, SkScalerContextFlags::kNone,
- nullptr);
+ SkScalerContext::CreateDescriptorAndEffectsUsingPaint(
+ skPaint, &props, SkScalerContextFlags::kNone, nullptr, &desc, &effects);
SkGlyphCache* origPaintCache =
SkGlyphCache::DetachCache(skPaint.getTypeface(), effects, desc.getDesc());
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp
index 2170f0a486..5c45f220ce 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp
@@ -605,8 +605,9 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx,
SkGlyphCache* GrStencilAndCoverTextContext::TextRun::getGlyphCache() const {
if (!fDetachedGlyphCache) {
- fDetachedGlyphCache = fFont.detachCache(nullptr, SkScalerContextFlags::kNone,
- nullptr);
+ fDetachedGlyphCache = SkGlyphCache::DetachCacheUsingPaint(fFont, nullptr,
+ SkScalerContextFlags::kNone,
+ nullptr);
}
return fDetachedGlyphCache;
}