From e7b8e4144f094a511470933efa5312012764394f Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Tue, 19 Nov 2019 12:31:25 -0700 Subject: [PATCH] Don't sync unique keys on ccpr clip FP proxies 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. Change-Id: I40d0f40c8b1cebbae6798ff95c88cb32616c84a2 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255143 Commit-Queue: Chris Dalton Reviewed-by: Robert Phillips --- src/gpu/ccpr/GrCCAtlas.cpp | 2 +- src/gpu/ccpr/GrCCAtlas.h | 2 +- src/gpu/ccpr/GrCCClipPath.cpp | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) 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);