Add Gray8 pixel config
This is still just linear (non-sRGB), but adding sRGB will
be the next step. I've verified that this is really making
R8 textures when uploading Gray8 bitmaps. Tests pass, and
the all_bitmap_configs GM still renders correctly (unlike
when we just mapped Gray8 to Alpha8).
This adds another pixel config, which could grow our cache
footprint, but the benefits of not using 4bpp for 1bpp data
should outweigh that?
Re-land of https://skia-review.googlesource.com/c/6817/,
with fixes for Vulkan.
BUG=skia:6110
Change-Id: Ia763c276808be28027ed0005ee4b88637306583f
Reviewed-on: https://skia-review.googlesource.com/6839
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/vk/GrVkUtil.cpp b/src/gpu/vk/GrVkUtil.cpp
index 3071fc8..b92f03e 100644
--- a/src/gpu/vk/GrVkUtil.cpp
+++ b/src/gpu/vk/GrVkUtil.cpp
@@ -48,6 +48,9 @@
case kAlpha_8_GrPixelConfig:
*format = VK_FORMAT_R8_UNORM;
return true;
+ case kGray_8_GrPixelConfig:
+ *format = VK_FORMAT_R8_UNORM;
+ return true;
case kETC1_GrPixelConfig:
// converting to ETC2 which is a superset of ETC1
*format = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK;