Revert "Pass GrColorType to the GrGpu::wrapRenderableBackendTexture chain of calls"
This reverts commit 5572737d952421a588c5790d4a8fc05957cb3d50.
Reason for revert: Adreno 4xx bots hitting compatibility assert in InitialTextureClear test
Original change's description:
> Pass GrColorType to the GrGpu::wrapRenderableBackendTexture chain of calls
>
> This is a step towards reducing our reliance-on/use-of the GrPixelConfig stored in the GrBackendTexture.
>
> Bug: skia:6718
> Change-Id: I2170032bfbbb57423c4bb0d901ad014c61d38131
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223701
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,robertphillips@google.com
Change-Id: I24cf6b3aa0dfca2e935a36592860ad91171b21a7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227637
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index f007304..79cfbf4 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -230,32 +230,23 @@
}
sk_sp<GrTexture> GrGpu::wrapRenderableBackendTexture(const GrBackendTexture& backendTex,
- int sampleCnt, GrColorType colorType,
- GrWrapOwnership ownership,
+ int sampleCnt, GrWrapOwnership ownership,
GrWrapCacheable cacheable) {
this->handleDirtyContext();
if (sampleCnt < 1) {
return nullptr;
}
-
- const GrCaps* caps = this->caps();
-
- SkASSERT(GrCaps::AreConfigsCompatible(backendTex.config(),
- caps->getConfigFromBackendFormat(
- backendTex.getBackendFormat(),
- colorType)));
-
- if (!caps->isFormatTexturable(colorType, backendTex.getBackendFormat()) ||
- !caps->getRenderTargetSampleCount(sampleCnt, colorType, backendTex.getBackendFormat())) {
+ if (!this->caps()->isConfigTexturable(backendTex.config()) ||
+ !this->caps()->getRenderTargetSampleCount(sampleCnt, backendTex.config())) {
return nullptr;
}
- if (backendTex.width() > caps->maxRenderTargetSize() ||
- backendTex.height() > caps->maxRenderTargetSize()) {
+ if (backendTex.width() > this->caps()->maxRenderTargetSize() ||
+ backendTex.height() > this->caps()->maxRenderTargetSize()) {
return nullptr;
}
- sk_sp<GrTexture> tex = this->onWrapRenderableBackendTexture(backendTex, sampleCnt, colorType,
- ownership, cacheable);
+ sk_sp<GrTexture> tex =
+ this->onWrapRenderableBackendTexture(backendTex, sampleCnt, ownership, cacheable);
SkASSERT(!tex || tex->asRenderTarget());
return tex;
}