diff options
author | Herb Derby <herb@google.com> | 2018-11-09 19:01:00 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-11-09 19:01:08 +0000 |
commit | 106296323223b6ac9980862ae6e9ce039bbd1534 (patch) | |
tree | 687f22a6742fef4bb43832b0f989caa4caf38b9a /src/core/SkPaint_text.cpp | |
parent | b07aba42145e29e0e995b373844c59846058a9ba (diff) | |
download | skqp-106296323223b6ac9980862ae6e9ce039bbd1534.tar.gz |
Revert "Move remove ptr args to MakeRecAndEffects"
This reverts commit b07aba42145e29e0e995b373844c59846058a9ba.
Reason for revert: Changes GMs
Original change's description:
> Move remove ptr args to MakeRecAndEffects
>
> Move this conversion out through the transitive closure of calls. As you
> move up the stack, everything becomes refs instread of pointers.
>
> Reorder args of MakeRecAndEffects and setupCache to match the majority of other
> calls.
>
> Change-Id: I72baf457cd9140f76ee5f7122493284c4be5bcd0
> Reviewed-on: https://skia-review.googlesource.com/c/169765
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
TBR=bungeman@google.com,herb@google.com
Change-Id: I29e54cea5b7b5709dd6db6816cb6556d73e003e0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/170221
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src/core/SkPaint_text.cpp')
-rw-r--r-- | src/core/SkPaint_text.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/core/SkPaint_text.cpp b/src/core/SkPaint_text.cpp index 47f7891f31..21a7c9570b 100644 --- a/src/core/SkPaint_text.cpp +++ b/src/core/SkPaint_text.cpp @@ -102,7 +102,7 @@ int SkPaint::textToGlyphs(const void* textData, size_t byteLength, uint16_t glyp return SkToInt(byteLength >> 1); } - auto cache = SkStrikeCache::FindOrCreateStrikeWithNoDeviceExclusive(*this); + auto cache = SkStrikeCache::FindOrCreateStrikeExclusive(*this); const void* stop = (const char*)textData + byteLength; uint16_t* gptr = glyphs; @@ -137,7 +137,7 @@ bool SkPaint::containsText(const void* textData, size_t byteLength) const { return true; } - auto cache = SkStrikeCache::FindOrCreateStrikeWithNoDeviceExclusive(*this); + auto cache = SkStrikeCache::FindOrCreateStrikeExclusive(*this); const void* stop = (const char*)textData + byteLength; const SkTypeface::Encoding encoding = to_encoding(this->getTextEncoding()); while (textData < stop) { @@ -158,7 +158,7 @@ void SkPaint::glyphsToUnichars(const uint16_t glyphs[], int count, SkUnichar tex SkSurfaceProps props(0, kUnknown_SkPixelGeometry); auto cache = SkStrikeCache::FindOrCreateStrikeExclusive( - *this, props, SkScalerContextFlags::kFakeGammaAndBoostContrast, SkMatrix::I()); + *this, &props, SkScalerContextFlags::kFakeGammaAndBoostContrast, nullptr); for (int index = 0; index < count; index++) { textData[index] = cache->glyphToUnichar(glyphs[index]); @@ -390,7 +390,7 @@ SkScalar SkPaint::measureText(const void* textData, size_t length, SkRect* bound const SkPaint& paint = canon.getPaint(); SkScalar scale = canon.getScale(); - auto cache = SkStrikeCache::FindOrCreateStrikeWithNoDeviceExclusive(paint); + auto cache = SkStrikeCache::FindOrCreateStrikeExclusive(paint); SkScalar width = 0; @@ -443,7 +443,7 @@ size_t SkPaint::breakText(const void* textD, size_t length, SkScalar maxWidth, maxWidth /= scale; } - auto cache = SkStrikeCache::FindOrCreateStrikeWithNoDeviceExclusive(paint); + auto cache = SkStrikeCache::FindOrCreateStrikeExclusive(paint); GlyphCacheProc glyphCacheProc = SkPaint::GetGlyphCacheProc(paint.getTextEncoding(), false); @@ -486,8 +486,7 @@ SkScalar SkPaint::getFontMetrics(SkFontMetrics* metrics) const { SkScalerContextEffects effects; auto desc = SkScalerContext::CreateDescriptorAndEffectsUsingPaint( - paint, SkSurfaceProps(0, kUnknown_SkPixelGeometry), - SkScalerContextFlags::kNone, SkMatrix::I(), &ad, &effects); + paint, nullptr, SkScalerContextFlags::kNone, nullptr, &ad, &effects); { auto typeface = SkPaintPriv::GetTypefaceOrDefault(paint); @@ -526,7 +525,7 @@ int SkPaint::getTextWidths(const void* textData, size_t byteLength, const SkPaint& paint = canon.getPaint(); SkScalar scale = canon.getScale(); - auto cache = SkStrikeCache::FindOrCreateStrikeWithNoDeviceExclusive(paint); + auto cache = SkStrikeCache::FindOrCreateStrikeExclusive(paint); GlyphCacheProc glyphCacheProc = SkPaint::GetGlyphCacheProc(paint.getTextEncoding(), nullptr != bounds); @@ -788,7 +787,9 @@ SkTextBaseIter::SkTextBaseIter(const char text[], size_t length, } // SRGBTODO: Is this correct? - fCache = SkStrikeCache::FindOrCreateStrikeWithNoDeviceExclusive(fPaint); + fCache = SkStrikeCache::FindOrCreateStrikeExclusive( + fPaint, nullptr, + SkScalerContextFlags::kFakeGammaAndBoostContrast, nullptr); SkPaint::Style style = SkPaint::kFill_Style; sk_sp<SkPathEffect> pe; |