Revert "Improve handling of GrPixelConfig in GrBackendTex/RT ctors"
This reverts commit 7d2b16ad13fd3262c776ae75ae35da4ad69df690.
Reason for revert: Maybe breaking chrome?
Original change's description:
> Improve handling of GrPixelConfig in GrBackendTex/RT ctors
>
> Make sure that no client facing code was relying on what we set as the
> default value for fConfig by making in kUnkown.
>
> Bug: skia:
> Change-Id: Ie52ff08ba8deeacc16fe06eb0dd0c7292b2edf91
> Reviewed-on: https://skia-review.googlesource.com/114261
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: I91e190d72407f9c4bee93a031a557f740bb49b66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/114423
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/tools/gpu/GrTest.cpp b/tools/gpu/GrTest.cpp
index dfb8c2d..e1a7924 100644
--- a/tools/gpu/GrTest.cpp
+++ b/tools/gpu/GrTest.cpp
@@ -56,32 +56,26 @@
GrBackendTexture CreateBackendTexture(GrBackend backend, int width, int height,
GrPixelConfig config, GrMipMapped mipMapped,
GrBackendObject handle) {
- GrBackendTexture beTex;
switch (backend) {
#ifdef SK_VULKAN
case kVulkan_GrBackend: {
GrVkImageInfo* vkInfo = (GrVkImageInfo*)(handle);
SkASSERT((GrMipMapped::kYes == mipMapped) == (vkInfo->fLevelCount > 1));
- beTex = GrBackendTexture(width, height, *vkInfo);
- break;
+ return GrBackendTexture(width, height, *vkInfo);
}
#endif
case kOpenGL_GrBackend: {
GrGLTextureInfo* glInfo = (GrGLTextureInfo*)(handle);
SkASSERT(glInfo->fFormat);
- beTex = GrBackendTexture(width, height, mipMapped, *glInfo);
- break;
+ return GrBackendTexture(width, height, mipMapped, *glInfo);
}
case kMock_GrBackend: {
GrMockTextureInfo* mockInfo = (GrMockTextureInfo*)(handle);
- beTex = GrBackendTexture(width, height, mipMapped, *mockInfo);
- break;
+ return GrBackendTexture(width, height, mipMapped, *mockInfo);
}
default:
return GrBackendTexture();
}
- beTex.setPixelConfig(config);
- return beTex;
}
GrBackendFormat CreateBackendFormatFromTexture(const GrBackendTexture& tex) {
@@ -344,6 +338,16 @@
//////////////////////////////////////////////////////////////////////////////
+GrPixelConfig GrBackendTexture::testingOnly_getPixelConfig() const {
+ return fConfig;
+}
+
+GrPixelConfig GrBackendRenderTarget::testingOnly_getPixelConfig() const {
+ return fConfig;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
#define DRAW_OP_TEST_EXTERN(Op) \
extern std::unique_ptr<GrDrawOp> Op##__Test(GrPaint&&, SkRandom*, GrContext*, GrFSAAType)
#define DRAW_OP_TEST_ENTRY(Op) Op##__Test