Make deferred render target context without config or format
config is completely redundant. No caller really cares what the backend
format is.
Change-Id: I93f1feb3ee61db6c21b7915bab3ee3fba5656f92
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225194
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index c4a5bab..730c9b1 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -86,16 +86,10 @@
sk_sp<GrTextureProxy> proxy = this->asTextureProxyRef(context);
- GrBackendFormat format = context->priv().caps()->getBackendFormatFromColorType(targetCT);
- if (!format.isValid()) {
- return nullptr;
- }
-
sk_sp<GrRenderTargetContext> renderTargetContext(
context->priv().makeDeferredRenderTargetContextWithFallback(
- format, SkBackingFit::kExact, this->width(), this->height(),
- SkColorType2GrPixelConfig(targetCT), SkColorTypeToGrColorType(targetCT),
- nullptr));
+ SkBackingFit::kExact, this->width(), this->height(),
+ SkColorTypeToGrColorType(targetCT), nullptr));
if (!renderTargetContext) {
return nullptr;
}
@@ -228,13 +222,10 @@
const int width = imageSize.width();
const int height = imageSize.height();
- const GrBackendFormat format =
- ctx->priv().caps()->getBackendFormatFromColorType(kRGBA_8888_SkColorType);
-
// Needs to create a render target in order to draw to it for the yuv->rgb conversion.
sk_sp<GrRenderTargetContext> renderTargetContext(ctx->priv().makeDeferredRenderTargetContext(
- format, SkBackingFit::kExact, width, height, kRGBA_8888_GrPixelConfig,
- GrColorType::kRGBA_8888, std::move(imageColorSpace), 1, GrMipMapped::kNo, imageOrigin));
+ SkBackingFit::kExact, width, height, GrColorType::kRGBA_8888,
+ std::move(imageColorSpace), 1, GrMipMapped::kNo, imageOrigin));
if (!renderTargetContext) {
return nullptr;
}
diff --git a/src/image/SkImage_GpuYUVA.cpp b/src/image/SkImage_GpuYUVA.cpp
index 2a3b6bb..7b938dd 100644
--- a/src/image/SkImage_GpuYUVA.cpp
+++ b/src/image/SkImage_GpuYUVA.cpp
@@ -140,15 +140,11 @@
return nullptr;
}
- const GrBackendFormat format =
- fContext->priv().caps()->getBackendFormatFromColorType(kAssumedColorType);
-
// Needs to create a render target in order to draw to it for the yuv->rgb conversion.
sk_sp<GrRenderTargetContext> renderTargetContext(
context->priv().makeDeferredRenderTargetContext(
- format, SkBackingFit::kExact, this->width(), this->height(),
- kRGBA_8888_GrPixelConfig, GrColorType::kRGBA_8888, this->refColorSpace(), 1,
- GrMipMapped::kNo, fOrigin));
+ SkBackingFit::kExact, this->width(), this->height(), GrColorType::kRGBA_8888,
+ this->refColorSpace(), 1, GrMipMapped::kNo, fOrigin));
if (!renderTargetContext) {
return nullptr;
}
diff --git a/src/image/SkImage_Lazy.cpp b/src/image/SkImage_Lazy.cpp
index a05eddd..b31063e 100644
--- a/src/image/SkImage_Lazy.cpp
+++ b/src/image/SkImage_Lazy.cpp
@@ -431,8 +431,6 @@
const GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(this->imageInfo());
SkColorType colorType = this->colorType();
- GrBackendFormat format =
- ctx->priv().caps()->getBackendFormatFromColorType(colorType);
ScopedGenerator generator(fSharedGenerator);
Generator_GrYUVProvider provider(generator);
@@ -446,7 +444,7 @@
// TODO: Update to create the mipped surface in the YUV generator and draw the base
// layer directly into the mipped surface.
- proxy = provider.refAsTextureProxy(ctx, format, desc, SkColorTypeToGrColorType(colorType),
+ proxy = provider.refAsTextureProxy(ctx, desc, SkColorTypeToGrColorType(colorType),
generatorColorSpace, thisColorSpace);
if (proxy) {
SK_HISTOGRAM_ENUMERATION("LockTexturePath", kYUV_LockTexturePath,