aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-04-11 07:51:07 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-11 07:51:07 -0700
commitc79172857c3f69cc46837e1beeae0c1ead377bb2 (patch)
tree4e6eebf5b3b09e91c58287875d24f75d62850818 /src/gpu/text
parent6dc14aab5ea6be87b5b10f17a19737f586708768 (diff)
Pass effects directly to fontcache
Diffstat (limited to 'src/gpu/text')
-rw-r--r--src/gpu/text/GrAtlasTextBlob.cpp4
-rw-r--r--src/gpu/text/GrAtlasTextBlob.h1
-rw-r--r--src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp2
-rw-r--r--src/gpu/text/GrStencilAndCoverTextContext.cpp5
-rw-r--r--src/gpu/text/GrTextUtils.cpp6
5 files changed, 12 insertions, 6 deletions
diff --git a/src/gpu/text/GrAtlasTextBlob.cpp b/src/gpu/text/GrAtlasTextBlob.cpp
index 4b339d4adb..afbff46994 100644
--- a/src/gpu/text/GrAtlasTextBlob.cpp
+++ b/src/gpu/text/GrAtlasTextBlob.cpp
@@ -59,9 +59,9 @@ SkGlyphCache* GrAtlasTextBlob::setupCache(int runIndex,
// if we have an override descriptor for the run, then we should use that
SkAutoDescriptor* desc = run->fOverrideDescriptor.get() ? run->fOverrideDescriptor.get() :
&run->fDescriptor;
- skPaint.getScalerContextDescriptor(desc, props, scalerContextFlags, viewMatrix);
+ skPaint.getScalerContextDescriptor(&run->fEffects, desc, props, scalerContextFlags, viewMatrix);
run->fTypeface.reset(SkSafeRef(skPaint.getTypeface()));
- return SkGlyphCache::DetachCache(run->fTypeface, desc->getDesc());
+ return SkGlyphCache::DetachCache(run->fTypeface, run->fEffects, desc->getDesc());
}
void GrAtlasTextBlob::appendGlyph(int runIndex,
diff --git a/src/gpu/text/GrAtlasTextBlob.h b/src/gpu/text/GrAtlasTextBlob.h
index 36e45abcff..bc1e0b4afc 100644
--- a/src/gpu/text/GrAtlasTextBlob.h
+++ b/src/gpu/text/GrAtlasTextBlob.h
@@ -474,6 +474,7 @@ private:
SkAutoTUnref<SkTypeface> fTypeface;
SkSTArray<kMinSubRuns, SubRunInfo> fSubRunInfo;
SkAutoDescriptor fDescriptor;
+ SkScalerContextEffects fEffects;
// Distance field text cannot draw coloremoji, and so has to fall back. However,
// though the distance field text and the coloremoji may share the same run, they
diff --git a/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp b/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp
index 7283e6d516..7c3cf68524 100644
--- a/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp
+++ b/src/gpu/text/GrAtlasTextBlob_regenInBatch.cpp
@@ -165,7 +165,7 @@ void GrAtlasTextBlob::regenInBatch(GrDrawBatch::Target* target,
SkGlyphCache::AttachCache(*cache);
}
*desc = newDesc;
- *cache = SkGlyphCache::DetachCache(run->fTypeface, *desc);
+ *cache = SkGlyphCache::DetachCache(run->fTypeface, run->fEffects, *desc);
*scaler = GrTextUtils::GetGrFontScaler(*cache);
*typeface = run->fTypeface;
}
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp
index f0c66979d5..a8dc20215a 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp
@@ -539,10 +539,13 @@ GrPathRange* GrStencilAndCoverTextContext::TextRun::createGlyphs(GrContext* ctx)
ctx->resourceProvider()->findAndRefResourceByUniqueKey(fGlyphPathsKey));
if (nullptr == glyphs) {
if (fUsingRawGlyphPaths) {
- glyphs = ctx->resourceProvider()->createGlyphs(fFont.getTypeface(), nullptr, fStroke);
+ SkScalerContextEffects noeffects;
+ glyphs = ctx->resourceProvider()->createGlyphs(fFont.getTypeface(), noeffects,
+ nullptr, fStroke);
} else {
SkGlyphCache* cache = this->getGlyphCache();
glyphs = ctx->resourceProvider()->createGlyphs(cache->getScalerContext()->getTypeface(),
+ cache->getScalerContext()->getEffects(),
&cache->getDescriptor(),
fStroke);
}
diff --git a/src/gpu/text/GrTextUtils.cpp b/src/gpu/text/GrTextUtils.cpp
index 3616bcada1..c368c214e1 100644
--- a/src/gpu/text/GrTextUtils.cpp
+++ b/src/gpu/text/GrTextUtils.cpp
@@ -260,10 +260,12 @@ void GrTextUtils::DrawDFText(GrAtlasTextBlob* blob, int runIndex,
SkPaint::GlyphCacheProc glyphCacheProc = skPaint.getGlyphCacheProc(true);
SkAutoDescriptor desc;
+ 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(&desc, props, SkPaint::kNone_ScalerContextFlags, nullptr);
- SkGlyphCache* origPaintCache = SkGlyphCache::DetachCache(skPaint.getTypeface(),
+ skPaint.getScalerContextDescriptor(&effects, &desc, props, SkPaint::kNone_ScalerContextFlags,
+ nullptr);
+ SkGlyphCache* origPaintCache = SkGlyphCache::DetachCache(skPaint.getTypeface(), effects,
desc.getDesc());
SkTArray<SkScalar> positions;