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 <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Chris Dalton 2019-11-19 12:31:25 -07:00 committed by Skia Commit-Bot
parent b9df230d65
commit e7b8e4144f
3 changed files with 9 additions and 4 deletions

View File

@ -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);
}

View File

@ -65,7 +65,7 @@ public:
SkUNREACHABLE;
}
using LazyInstantiateAtlasCallback = std::function<sk_sp<GrTexture>(
using LazyInstantiateAtlasCallback = std::function<GrSurfaceProxy::LazyCallbackResult(
GrResourceProvider*, GrPixelConfig, const GrBackendFormat&, int sampleCount)>;
static sk_sp<GrTextureProxy> MakeLazyAtlasProxy(const LazyInstantiateAtlasCallback&,

View File

@ -29,7 +29,7 @@ void GrCCClipPath::init(
if (!textureProxy || !textureProxy->instantiate(resourceProvider)) {
fAtlasScale = fAtlasTranslate = {0, 0};
SkDEBUGCODE(fHasAtlasTransform = true);
return sk_sp<GrTexture>();
return GrSurfaceProxy::LazyCallbackResult();
}
sk_sp<GrTexture> 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);