aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrShaderCaps.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-01-10 14:20:02 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-10 20:37:09 +0000
commit986563bcff26300ea4317b4dd84917d5240bb723 (patch)
tree45d8ebce472b8f115193c800448bb3ae9078ee7c /src/gpu/GrShaderCaps.cpp
parentfdb124adfcb9cacf9eea50f6f554b2a955bbacc6 (diff)
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>
Diffstat (limited to 'src/gpu/GrShaderCaps.cpp')
-rw-r--r--src/gpu/GrShaderCaps.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gpu/GrShaderCaps.cpp b/src/gpu/GrShaderCaps.cpp
index 3e6323f255..90df176051 100644
--- a/src/gpu/GrShaderCaps.cpp
+++ b/src/gpu/GrShaderCaps.cpp
@@ -202,6 +202,7 @@ void GrShaderCaps::initSamplerPrecisionTable() {
uint8_t* table = fSamplerPrecisions[visibility];
table[kUnknown_GrPixelConfig] = kDefault_GrSLPrecision;
table[kAlpha_8_GrPixelConfig] = lowp;
+ table[kGray_8_GrPixelConfig] = lowp;
table[kIndex_8_GrPixelConfig] = lowp;
table[kRGB_565_GrPixelConfig] = lowp;
table[kRGBA_4444_GrPixelConfig] = lowp;
@@ -218,7 +219,7 @@ void GrShaderCaps::initSamplerPrecisionTable() {
table[kAlpha_half_GrPixelConfig] = mediump;
table[kRGBA_half_GrPixelConfig] = mediump;
- GR_STATIC_ASSERT(17 == kGrPixelConfigCnt);
+ GR_STATIC_ASSERT(18 == kGrPixelConfigCnt);
}
}