Pass GrBackendFormat to GrResourceProvider and GrGpu texture create
functions.
Change-Id: Ie3fe9d56fdbf369ccacd0188a3d3d73ce1d30d48
Bug: skia:6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232141
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/ccpr/GrCCAtlas.cpp b/src/gpu/ccpr/GrCCAtlas.cpp
index 56b115e..89eff1a 100644
--- a/src/gpu/ccpr/GrCCAtlas.cpp
+++ b/src/gpu/ccpr/GrCCAtlas.cpp
@@ -75,9 +75,13 @@
break;
}
+ auto instantiate = [cb = std::move(callback), pixelConfig, format,
+ sampleCount](GrResourceProvider* rp) {
+ return cb(rp, pixelConfig, format, sampleCount);
+ };
sk_sp<GrTextureProxy> proxy = GrProxyProvider::MakeFullyLazyProxy(
- std::bind(callback, std::placeholders::_1, pixelConfig, sampleCount), format,
- GrRenderable::kYes, sampleCount, GrProtected::kNo, kTextureOrigin, pixelConfig, caps);
+ std::move(instantiate), format, GrRenderable::kYes, sampleCount, GrProtected::kNo,
+ kTextureOrigin, pixelConfig, caps);
return proxy;
}
@@ -109,19 +113,21 @@
fTopNode = skstd::make_unique<Node>(nullptr, 0, 0, fWidth, fHeight);
- fTextureProxy = MakeLazyAtlasProxy([this](
- GrResourceProvider* resourceProvider, GrPixelConfig pixelConfig, int sampleCount) {
- if (!fBackingTexture) {
- GrSurfaceDesc desc;
- desc.fWidth = fWidth;
- desc.fHeight = fHeight;
- desc.fConfig = pixelConfig;
- fBackingTexture = resourceProvider->createTexture(
- desc, GrRenderable::kYes, sampleCount, SkBudgeted::kYes, GrProtected::kNo,
- GrResourceProvider::Flags::kNoPendingIO);
- }
- return fBackingTexture;
- }, fCoverageType, caps);
+ fTextureProxy = MakeLazyAtlasProxy(
+ [this](GrResourceProvider* resourceProvider, GrPixelConfig pixelConfig,
+ const GrBackendFormat& format, int sampleCount) {
+ if (!fBackingTexture) {
+ GrSurfaceDesc desc;
+ desc.fWidth = fWidth;
+ desc.fHeight = fHeight;
+ desc.fConfig = pixelConfig;
+ fBackingTexture = resourceProvider->createTexture(
+ desc, format, GrRenderable::kYes, sampleCount, SkBudgeted::kYes,
+ GrProtected::kNo, GrResourceProvider::Flags::kNoPendingIO);
+ }
+ return fBackingTexture;
+ },
+ fCoverageType, caps);
fTextureProxy->priv().setIgnoredByResourceAllocator();
}