aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrShaderCaps.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-01-09 15:32:57 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-10 16:20:03 +0000
commitf2956459f707de596dcb2c79a7ee1fa62d599c0d (patch)
tree4c558c871bd88d8d599162b63864ce7083f58f0e /src/gpu/GrShaderCaps.cpp
parente98234f231d66848e149db683c11b6388e10b233 (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? BUG=skia:6110 Change-Id: I4fc4c2479fc25f1d278e174a9bb5b542a0cb184c Reviewed-on: https://skia-review.googlesource.com/6817 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);
}
}