Stop using GrBackendSurface's pixel config
Note: I'll follow this up with a separate CL that removes the pixel config
Bug: skia:6718
Change-Id: If069afa95bd51d5d6b24089fd3a8526e4d982820
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228257
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/image/SkImage_GpuBase.cpp b/src/image/SkImage_GpuBase.cpp
index e2f70ae..201daad 100644
--- a/src/image/SkImage_GpuBase.cpp
+++ b/src/image/SkImage_GpuBase.cpp
@@ -56,6 +56,10 @@
return false;
}
+ if (!ctx->priv().caps()->areColorTypeAndFormatCompatible(grCT, backendFormat)) {
+ return false;
+ }
+
*config = ctx->priv().caps()->getConfigFromBackendFormat(backendFormat, grCT);
return *config != kUnknown_GrPixelConfig;
}
@@ -249,6 +253,7 @@
if (!backendFormat.isValid()) {
return false;
}
+
yuvaTexturesCopy[textureIndex].fConfig =
caps->getYUVAConfigFromBackendFormat(backendFormat);
if (yuvaTexturesCopy[textureIndex].fConfig == kUnknown_GrPixelConfig) {