Delete GrBackendSurface's GrPixelConfig
This member variable is no longer used
TBR=bsalomon@google.com
Bug: skia:6718
Change-Id: I84680c8c3bc36eefa603f5be7f3c15b496a79948
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229478
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/image/SkImage_GpuBase.cpp b/src/image/SkImage_GpuBase.cpp
index 201daad..0590467 100644
--- a/src/image/SkImage_GpuBase.cpp
+++ b/src/image/SkImage_GpuBase.cpp
@@ -38,9 +38,8 @@
}
#endif
-bool SkImage_GpuBase::ValidateBackendTexture(GrContext* ctx, const GrBackendTexture& tex,
- GrPixelConfig* config, GrColorType grCT,
- SkColorType ct, SkAlphaType at,
+bool SkImage_GpuBase::ValidateBackendTexture(const GrCaps* caps, const GrBackendTexture& tex,
+ GrColorType grCT, SkColorType ct, SkAlphaType at,
sk_sp<SkColorSpace> cs) {
if (!tex.isValid()) {
return false;
@@ -56,12 +55,7 @@
return false;
}
- if (!ctx->priv().caps()->areColorTypeAndFormatCompatible(grCT, backendFormat)) {
- return false;
- }
-
- *config = ctx->priv().caps()->getConfigFromBackendFormat(backendFormat, grCT);
- return *config != kUnknown_GrPixelConfig;
+ return caps->areColorTypeAndFormatCompatible(grCT, backendFormat);
}
//////////////////////////////////////////////////////////////////////////////////////////////////
@@ -244,30 +238,21 @@
GrProxyProvider* proxyProvider = ctx->priv().proxyProvider();
const GrCaps* caps = ctx->priv().caps();
- // We need to make a copy of the input backend textures because we need to preserve the result
- // of validate_backend_texture.
- GrBackendTexture yuvaTexturesCopy[4];
for (int textureIndex = 0; textureIndex < numTextures; ++textureIndex) {
- yuvaTexturesCopy[textureIndex] = yuvaTextures[textureIndex];
- GrBackendFormat backendFormat = yuvaTexturesCopy[textureIndex].getBackendFormat();
+ GrBackendFormat backendFormat = yuvaTextures[textureIndex].getBackendFormat();
if (!backendFormat.isValid()) {
return false;
}
- yuvaTexturesCopy[textureIndex].fConfig =
- caps->getYUVAConfigFromBackendFormat(backendFormat);
- if (yuvaTexturesCopy[textureIndex].fConfig == kUnknown_GrPixelConfig) {
- return false;
- }
GrColorType grColorType = caps->getYUVAColorTypeFromBackendFormat(backendFormat);
if (GrColorType::kUnknown == grColorType) {
return false;
}
- SkASSERT(yuvaTexturesCopy[textureIndex].isValid());
+ SkASSERT(yuvaTextures[textureIndex].isValid());
tempTextureProxies[textureIndex] = proxyProvider->wrapBackendTexture(
- yuvaTexturesCopy[textureIndex], grColorType, imageOrigin, kBorrow_GrWrapOwnership,
+ yuvaTextures[textureIndex], grColorType, imageOrigin, kBorrow_GrWrapOwnership,
GrWrapCacheable::kNo, kRead_GrIOType);
if (!tempTextureProxies[textureIndex]) {
return false;
@@ -432,20 +417,11 @@
return {};
}
- auto backendTexture = promiseTexture->backendTexture();
+ const GrBackendTexture& backendTexture = promiseTexture->backendTexture();
if (!backendTexture.isValid()) {
return {};
}
- // TODO: delete this block
- {
- GrPixelConfig config = resourceProvider->caps()->getConfigFromBackendFormat(
- backendTexture.getBackendFormat(),
- fColorType);
- SkASSERT(kUnknown_GrPixelConfig != config);
- backendTexture.fConfig = config;
- }
-
sk_sp<GrTexture> tex;
static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain();
GrUniqueKey key;