aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-03-21 10:47:30 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-21 15:11:48 +0000
commit4e34a017231ca164fd25f8f909a3880d23a0d0fc (patch)
treeaf5d2db58d5bcb9562d720b833cfa27986113265
parent9475aa0f90bd82fcc8e68deb56f70bd816719537 (diff)
Remove more uses of SkAutoGlyphCache.
Change-Id: I438bfb1a43857aa9e7e29b19e53dd921ec6eab1a Reviewed-on: https://skia-review.googlesource.com/115604 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Herb Derby <herb@google.com>
-rw-r--r--bench/PathTextBench.cpp3
-rw-r--r--src/gpu/text/GrAtlasTextContext.cpp6
2 files changed, 4 insertions, 5 deletions
diff --git a/bench/PathTextBench.cpp b/bench/PathTextBench.cpp
index 4e83d33119..c4429fbafd 100644
--- a/bench/PathTextBench.cpp
+++ b/bench/PathTextBench.cpp
@@ -46,8 +46,7 @@ private:
void onDelayedSetup() override {
SkPaint defaultPaint;
- SkAutoGlyphCache agc(defaultPaint, nullptr, &SkMatrix::I());
- SkGlyphCache* cache = agc.get();
+ auto cache = SkGlyphCache::FindOrCreateStrikeExclusive(defaultPaint);
for (int i = 0; i < kNumGlyphs; ++i) {
SkGlyphID id = cache->unicharToGlyph(kGlyphs[i]);
cache->getScalerContext()->getPath(SkPackedGlyphID(id), &fGlyphs[i]);
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp
index f532f8eea5..0179e433cf 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrAtlasTextContext.cpp
@@ -500,8 +500,8 @@ void GrAtlasTextContext::DrawBmpPosTextAsPaths(GrAtlasTextBlob* blob, int runInd
SkPaint::GlyphCacheProc glyphCacheProc = SkPaint::GetGlyphCacheProc(pathPaint.getTextEncoding(),
pathPaint.isDevKernText(),
true);
- SkAutoGlyphCache autoCache(pathPaint, &props, nullptr);
- SkGlyphCache* cache = autoCache.get();
+ auto cache = SkGlyphCache::FindOrCreateStrikeExclusive(
+ pathPaint, &props, SkScalerContextFlags::kFakeGammaAndBoostContrast, nullptr);
const char* stop = text + byteLength;
const char* lastText = text;
@@ -509,7 +509,7 @@ void GrAtlasTextContext::DrawBmpPosTextAsPaths(GrAtlasTextBlob* blob, int runInd
SkTextMapStateProc tmsProc(SkMatrix::I(), offset, scalarsPerPosition);
while (text < stop) {
- const SkGlyph& glyph = glyphCacheProc(cache, &text);
+ const SkGlyph& glyph = glyphCacheProc(cache.get(), &text);
if (glyph.fWidth) {
SkPoint tmsLoc;
tmsProc(pos, &tmsLoc);