aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-03-13 16:44:48 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-14 14:12:42 +0000
commit7d2b16ad13fd3262c776ae75ae35da4ad69df690 (patch)
tree768403578659fe038f155a8a78bd0244faa3b51a /tools
parentb78dd5d01eb16ae3cb9104ce8c0fa7e861431259 (diff)
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/gpu/GrTest.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/tools/gpu/GrTest.cpp b/tools/gpu/GrTest.cpp
index e1a7924062..dfb8c2d4f6 100644
--- a/tools/gpu/GrTest.cpp
+++ b/tools/gpu/GrTest.cpp
@@ -56,26 +56,32 @@ void SetupAlwaysEvictAtlas(GrContext* context, int dim) {
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));
- return GrBackendTexture(width, height, *vkInfo);
+ beTex = GrBackendTexture(width, height, *vkInfo);
+ break;
}
#endif
case kOpenGL_GrBackend: {
GrGLTextureInfo* glInfo = (GrGLTextureInfo*)(handle);
SkASSERT(glInfo->fFormat);
- return GrBackendTexture(width, height, mipMapped, *glInfo);
+ beTex = GrBackendTexture(width, height, mipMapped, *glInfo);
+ break;
}
case kMock_GrBackend: {
GrMockTextureInfo* mockInfo = (GrMockTextureInfo*)(handle);
- return GrBackendTexture(width, height, mipMapped, *mockInfo);
+ beTex = GrBackendTexture(width, height, mipMapped, *mockInfo);
+ break;
}
default:
return GrBackendTexture();
}
+ beTex.setPixelConfig(config);
+ return beTex;
}
GrBackendFormat CreateBackendFormatFromTexture(const GrBackendTexture& tex) {
@@ -338,16 +344,6 @@ void GrDrawingManager::testingOnly_removeOnFlushCallbackObject(GrOnFlushCallback
//////////////////////////////////////////////////////////////////////////////
-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