diff --git a/src/core/SkRemoteGlyphCache.cpp b/src/core/SkRemoteGlyphCache.cpp index 76d330f437..5fb780d54d 100644 --- a/src/core/SkRemoteGlyphCache.cpp +++ b/src/core/SkRemoteGlyphCache.cpp @@ -207,7 +207,7 @@ void add_fallback_text_to_cache(const GrTextContext::FallbackGlyphRunHelper& hel SkScalerContextEffects effects; auto* glyphCacheState = - server->getOrCreateCache(fallbackPaint, &props, &fallbackMatrix, + server->getOrCreateCache(fallbackPaint, props, fallbackMatrix, SkScalerContextFlags::kFakeGammaAndBoostContrast, &effects); for (auto glyphID : helper.fallbackText()) { @@ -285,7 +285,7 @@ void SkTextBlobCacheDiffCanvas::TrackLayerDevice::processGlyphRunForMask( SkScalerContextEffects effects; auto* glyphCacheState = fStrikeServer->getOrCreateCache( - runPaint, &this->surfaceProps(), &runMatrix, + runPaint, this->surfaceProps(), runMatrix, SkScalerContextFlags::kFakeGammaAndBoostContrast, &effects); SkASSERT(glyphCacheState); @@ -321,7 +321,7 @@ void SkTextBlobCacheDiffCanvas::TrackLayerDevice::processGlyphRunForPaths( SkScalerContextEffects effects; auto* glyphCacheState = fStrikeServer->getOrCreateCache( - pathPaint, &this->surfaceProps(), &SkMatrix::I(), + pathPaint, this->surfaceProps(), SkMatrix::I(), SkScalerContextFlags::kFakeGammaAndBoostContrast, &effects); const bool asPath = true; @@ -369,8 +369,8 @@ bool SkTextBlobCacheDiffCanvas::TrackLayerDevice::maybeProcessGlyphRunForDFT( GrTextContext::InitDistanceFieldPaint(nullptr, &dfPaint, runMatrix, options, &textRatio, &flags); SkScalerContextEffects effects; - auto* glyphCacheState = fStrikeServer->getOrCreateCache(dfPaint, &this->surfaceProps(), - &SkMatrix::I(), flags, &effects); + auto* glyphCacheState = fStrikeServer->getOrCreateCache(dfPaint, this->surfaceProps(), + SkMatrix::I(), flags, &effects); GrTextContext::FallbackGlyphRunHelper fallbackTextHelper(runMatrix, runPaint, textRatio); const bool asPath = false; @@ -473,12 +473,12 @@ void SkStrikeServer::writeStrikeData(std::vector* memory) { SkStrikeServer::SkGlyphCacheState* SkStrikeServer::getOrCreateCache( const SkPaint& paint, - const SkSurfaceProps* props, - const SkMatrix* matrix, + const SkSurfaceProps& props, + const SkMatrix& matrix, SkScalerContextFlags flags, SkScalerContextEffects* effects) { SkAutoDescriptor keyAutoDesc; - auto keyDesc = create_descriptor(kKey, paint, *matrix, *props, flags, &keyAutoDesc, effects); + auto keyDesc = create_descriptor(kKey, paint, matrix, props, flags, &keyAutoDesc, effects); // In cases where tracing is turned off, make sure not to get an unused function warning. // Lambdaize the function. @@ -510,7 +510,7 @@ SkStrikeServer::SkGlyphCacheState* SkStrikeServer::getOrCreateCache( SkScalerContextEffects deviceEffects; SkAutoDescriptor deviceAutoDesc; auto deviceDesc = create_descriptor( - kDevice, paint, *matrix, *props, flags, &deviceAutoDesc, &deviceEffects); + kDevice, paint, matrix, props, flags, &deviceAutoDesc, &deviceEffects); SkASSERT(cache->getDeviceDescriptor() == *deviceDesc); #endif bool locked = fDiscardableHandleManager->lockHandle(it->second->discardableHandleId()); @@ -536,7 +536,7 @@ SkStrikeServer::SkGlyphCacheState* SkStrikeServer::getOrCreateCache( SkScalerContextEffects deviceEffects; SkAutoDescriptor deviceAutoDesc; auto deviceDesc = create_descriptor( - kDevice, paint, *matrix, *props, flags, &deviceAutoDesc, &deviceEffects); + kDevice, paint, matrix, props, flags, &deviceAutoDesc, &deviceEffects); auto context = tf->createScalerContext(deviceEffects, deviceDesc); diff --git a/src/core/SkRemoteGlyphCache.h b/src/core/SkRemoteGlyphCache.h index b1636e0b88..6f068c51c4 100644 --- a/src/core/SkRemoteGlyphCache.h +++ b/src/core/SkRemoteGlyphCache.h @@ -124,7 +124,7 @@ public: // Methods used internally in skia ------------------------------------------ class SkGlyphCacheState; - SkGlyphCacheState* getOrCreateCache(const SkPaint&, const SkSurfaceProps*, const SkMatrix*, + SkGlyphCacheState* getOrCreateCache(const SkPaint&, const SkSurfaceProps&, const SkMatrix&, SkScalerContextFlags flags, SkScalerContextEffects* effects); diff --git a/tests/SkRemoteGlyphCacheTest.cpp b/tests/SkRemoteGlyphCacheTest.cpp index 1493f2ba63..347cd47de1 100644 --- a/tests/SkRemoteGlyphCacheTest.cpp +++ b/tests/SkRemoteGlyphCacheTest.cpp @@ -789,7 +789,9 @@ DEF_TEST(SkRemoteGlyphCache_ReWriteGlyph, reporter) { SkScalerContextEffects effects; SkScalerContextFlags flags = SkScalerContextFlags::kFakeGammaAndBoostContrast; paint.setTypeface(serverTf); - auto* cacheState = server.getOrCreateCache(paint, nullptr, nullptr, flags, &effects); + auto* cacheState = server.getOrCreateCache( + paint, SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType), + SkMatrix::I(), flags, &effects); cacheState->addGlyph(lostGlyphID, false); std::vector serverStrikeData;