Move read swizzle from GL ConfigInfo to FormatInfo.
With this change I also removed GrPixelConfig as param to supportedReadPixelsColorType().
This meant some updates had to be made to Vulkan and Metal to make sure they return the
right GrColorType.
Bug: skia:6718
Change-Id: I71b6360489cf499692c7b777e5915090fad05c56
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228349
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index 5afffe8..8e49259 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -1743,16 +1743,12 @@
auto dstCT = SkColorTypeToGrColorType(info.colorType());
bool needsRescale = srcRect.width() != info.width() || srcRect.height() != info.height();
auto colorTypeOfFinalContext = this->colorSpaceInfo().colorType();
- GrPixelConfig configOfFinalContext = fRenderTargetProxy->config();
auto backendFormatOfFinalContext = fRenderTargetProxy->backendFormat();
if (needsRescale) {
colorTypeOfFinalContext = dstCT;
backendFormatOfFinalContext = this->caps()->getBackendFormatFromColorType(dstCT);
- configOfFinalContext = this->caps()->getConfigFromBackendFormat(backendFormatOfFinalContext,
- dstCT);
}
auto readInfo = this->caps()->supportedReadPixelsColorType(colorTypeOfFinalContext,
- configOfFinalContext,
backendFormatOfFinalContext, dstCT);
// Fail if we can't read from the source surface's color type.
if (readInfo.fColorType == GrColorType::kUnknown) {
@@ -1841,8 +1837,7 @@
return {};
}
auto supportedRead = this->caps()->supportedReadPixelsColorType(
- this->colorSpaceInfo().colorType(), fRenderTargetProxy->config(),
- fRenderTargetProxy->backendFormat(), dstCT);
+ this->colorSpaceInfo().colorType(), fRenderTargetProxy->backendFormat(), dstCT);
// Fail if read color type does not have all of dstCT's color channels and those missing color
// channels are in the src.
uint32_t dstComponents = GrColorTypeComponentFlags(dstCT);