aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-07-02 16:47:38 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-03 13:41:13 +0000
commitff2181e62e79ffd2ce628fc8c05b5457d4f54163 (patch)
tree5185ca093986d1ee49dd3abfa93a00991c77ac7a /src/gpu/vk
parent94d57c477fe122c146a034c625cebb6c44ef21b0 (diff)
Remove setting/use of GrPixelConfig in GrBackendTex/RT ctors.
Bug: skia: Change-Id: I1466668e3502cd1e6e1f6aed4105e0f626d293dd Reviewed-on: https://skia-review.googlesource.com/138987 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/vk')
-rw-r--r--src/gpu/vk/GrVkGpu.cpp12
-rw-r--r--src/gpu/vk/GrVkUtil.cpp34
-rw-r--r--src/gpu/vk/GrVkUtil.h5
3 files changed, 10 insertions, 41 deletions
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index ba1f7caf2d..ed45c55758 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -1359,7 +1359,11 @@ GrBackendTexture GrVkGpu::createTestingOnlyBackendTexture(const void* srcData, i
&info)) {
return {};
}
- return GrBackendTexture(w, h, info);
+ GrBackendTexture beTex = GrBackendTexture(w, h, info);
+ // Lots of tests don't go through Skia's public interface which will set the config so for
+ // testing we make sure we set a config here.
+ beTex.setPixelConfig(config);
+ return beTex;
}
bool GrVkGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const {
@@ -1409,7 +1413,11 @@ GrBackendRenderTarget GrVkGpu::createTestingOnlyBackendRenderTarget(int w, int h
&info)) {
return {};
}
- return {w, h, 1, 0, info};
+ GrBackendRenderTarget beRT = GrBackendRenderTarget(w, h, 1, 0, info);
+ // Lots of tests don't go through Skia's public interface which will set the config so for
+ // testing we make sure we set a config here.
+ beRT.setPixelConfig(config);
+ return beRT;
}
void GrVkGpu::deleteTestingOnlyBackendRenderTarget(const GrBackendRenderTarget& rt) {
diff --git a/src/gpu/vk/GrVkUtil.cpp b/src/gpu/vk/GrVkUtil.cpp
index 2b0bba732d..b0aa3d4c14 100644
--- a/src/gpu/vk/GrVkUtil.cpp
+++ b/src/gpu/vk/GrVkUtil.cpp
@@ -75,40 +75,6 @@ bool GrPixelConfigToVkFormat(GrPixelConfig config, VkFormat* format) {
return false;
}
-GrPixelConfig GrVkFormatToPixelConfig(VkFormat format) {
- switch (format) {
- case VK_FORMAT_R8G8B8A8_UNORM:
- return kRGBA_8888_GrPixelConfig;
- case VK_FORMAT_B8G8R8A8_UNORM:
- return kBGRA_8888_GrPixelConfig;
- case VK_FORMAT_R8G8B8A8_SRGB:
- return kSRGBA_8888_GrPixelConfig;
- case VK_FORMAT_B8G8R8A8_SRGB:
- return kSBGRA_8888_GrPixelConfig;
- case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
- return kRGBA_1010102_GrPixelConfig;
- case VK_FORMAT_R5G6B5_UNORM_PACK16:
- return kRGB_565_GrPixelConfig;
- break;
- case VK_FORMAT_B4G4R4A4_UNORM_PACK16:
- // R4G4B4A4 is not required to be supported so we actually
- // store RGBA_4444 data as B4G4R4A4.
- return kRGBA_4444_GrPixelConfig;
- case VK_FORMAT_R8_UNORM:
- return kAlpha_8_GrPixelConfig;
- case VK_FORMAT_R32G32B32A32_SFLOAT:
- return kRGBA_float_GrPixelConfig;
- case VK_FORMAT_R32G32_SFLOAT:
- return kRG_float_GrPixelConfig;
- case VK_FORMAT_R16G16B16A16_SFLOAT:
- return kRGBA_half_GrPixelConfig;
- case VK_FORMAT_R16_SFLOAT:
- return kAlpha_half_GrPixelConfig;
- default:
- return kUnknown_GrPixelConfig;
- }
-}
-
bool GrVkFormatPixelConfigPairIsValid(VkFormat format, GrPixelConfig config) {
switch (format) {
case VK_FORMAT_R8G8B8A8_UNORM:
diff --git a/src/gpu/vk/GrVkUtil.h b/src/gpu/vk/GrVkUtil.h
index 71cc5d4e6a..7c56c6941f 100644
--- a/src/gpu/vk/GrVkUtil.h
+++ b/src/gpu/vk/GrVkUtil.h
@@ -33,11 +33,6 @@ class GrVkGpu;
*/
bool GrPixelConfigToVkFormat(GrPixelConfig config, VkFormat* format);
-/**
-* Returns the GrPixelConfig for the given vulkan texture format
-*/
-GrPixelConfig GrVkFormatToPixelConfig(VkFormat format);
-
bool GrVkFormatIsSupported(VkFormat);
/**