diff --git a/src/gpu/ccpr/GrCCAtlas.cpp b/src/gpu/ccpr/GrCCAtlas.cpp index d0639bf1a0..d92f6a6b4c 100644 --- a/src/gpu/ccpr/GrCCAtlas.cpp +++ b/src/gpu/ccpr/GrCCAtlas.cpp @@ -125,7 +125,7 @@ GrCCAtlas::GrCCAtlas(CoverageType coverageType, const Specs& specs, const GrCaps desc, format, GrRenderable::kYes, sampleCount, GrMipMapped::kNo, SkBudgeted::kYes, GrProtected::kNo); } - return fBackingTexture; + return GrSurfaceProxy::LazyCallbackResult(fBackingTexture); }, fCoverageType, caps, GrSurfaceProxy::UseAllocator::kNo); } diff --git a/src/gpu/ccpr/GrCCAtlas.h b/src/gpu/ccpr/GrCCAtlas.h index ac7faaa41d..49a26f630e 100644 --- a/src/gpu/ccpr/GrCCAtlas.h +++ b/src/gpu/ccpr/GrCCAtlas.h @@ -65,7 +65,7 @@ public: SkUNREACHABLE; } - using LazyInstantiateAtlasCallback = std::function( + using LazyInstantiateAtlasCallback = std::function; static sk_sp MakeLazyAtlasProxy(const LazyInstantiateAtlasCallback&, diff --git a/src/gpu/ccpr/GrCCClipPath.cpp b/src/gpu/ccpr/GrCCClipPath.cpp index 9e86d2e2d2..fc0bd9b2b0 100644 --- a/src/gpu/ccpr/GrCCClipPath.cpp +++ b/src/gpu/ccpr/GrCCClipPath.cpp @@ -29,7 +29,7 @@ void GrCCClipPath::init( if (!textureProxy || !textureProxy->instantiate(resourceProvider)) { fAtlasScale = fAtlasTranslate = {0, 0}; SkDEBUGCODE(fHasAtlasTransform = true); - return sk_sp(); + return GrSurfaceProxy::LazyCallbackResult(); } sk_sp texture = sk_ref_sp(textureProxy->peekTexture()); @@ -43,7 +43,12 @@ void GrCCClipPath::init( fDevToAtlasOffset.fY * fAtlasScale.y()); SkDEBUGCODE(fHasAtlasTransform = true); - return texture; + // We use LazyInstantiationKeyMode::kUnsynced here because CCPR clip masks are never + // cached, and the clip FP proxies need to ignore any unique keys that atlas + // textures use for path mask caching. + return GrSurfaceProxy::LazyCallbackResult( + std::move(texture), true, + GrSurfaceProxy::LazyInstantiationKeyMode::kUnsynced); }, atlasCoverageType, caps, GrSurfaceProxy::UseAllocator::kYes);