aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrColor.h
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-03-17 13:01:26 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-17 13:01:26 -0700
commitc571c001cee4e0dfacd7bd17d5cd0a2900a853a9 (patch)
treeb677d3cb745b52dd7f74507de78709c8437b3ecd /include/gpu/GrColor.h
parentb893a4c569d0719a395abffb266d1d61af847e2f (diff)
Revert of sRGB support in Ganesh. Several pieces: (patchset #12 id:220001 of https://codereview.chromium.org/1789663002/ )
Reason for revert: We're getting sRGB non-8888 configs? Original issue's description: > sRGB support in Ganesh. Several pieces: > > sRGB support now also requires GL_EXT_texture_sRGB_decode, which allows > us to disable sRGB -> Linear conversion when reading textures. This gives > us an easy way to support "legacy" L32 mode. We disable decoding based on > the pixel config of the render target. Textures can override that behavior > (specifically for format-conversion draws where we want that behavior). > > Added sBGRA pixel config, which is not-really-a-format. It's just sRGBA > internally, and the external format is BGR order, so TexImage calls will > swizzle correctly. This lets us interact with sRGB raster surfaces on BGR > platforms. > > Devices without sRGB support behave like they always have: conversion from > color type and profile type ignores sRGB and always returns linear pixel > configs. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1789663002 > > Committed: https://skia.googlesource.com/skia/+/9e3f1bf4e5cd8fc59554f986f36d6b034e99f9eb TBR=reed@google.com,bsalomon@google.com,robertphillips@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1814533003
Diffstat (limited to 'include/gpu/GrColor.h')
-rw-r--r--include/gpu/GrColor.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/include/gpu/GrColor.h b/include/gpu/GrColor.h
index 77f1a6cb08..6b83237626 100644
--- a/include/gpu/GrColor.h
+++ b/include/gpu/GrColor.h
@@ -208,6 +208,7 @@ static inline char GrColorComponentFlagToChar(GrColorComponentFlags component) {
}
static inline uint32_t GrPixelConfigComponentMask(GrPixelConfig config) {
+ SkASSERT(config >= 0 && config < kGrPixelConfigCnt);
static const uint32_t kFlags[] = {
0, // kUnknown_GrPixelConfig
kA_GrColorComponentFlag, // kAlpha_8_GrPixelConfig
@@ -217,7 +218,6 @@ static inline uint32_t GrPixelConfigComponentMask(GrPixelConfig config) {
kRGBA_GrColorComponentFlags, // kRGBA_8888_GrPixelConfig
kRGBA_GrColorComponentFlags, // kBGRA_8888_GrPixelConfig
kRGBA_GrColorComponentFlags, // kSRGBA_8888_GrPixelConfig
- kRGBA_GrColorComponentFlags, // kSBGRA_8888_GrPixelConfig
kRGB_GrColorComponentFlags, // kETC1_GrPixelConfig
kA_GrColorComponentFlag, // kLATC_GrPixelConfig
kA_GrColorComponentFlag, // kR11_EAC_GrPixelConfig
@@ -236,14 +236,13 @@ static inline uint32_t GrPixelConfigComponentMask(GrPixelConfig config) {
GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig);
GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig);
GR_STATIC_ASSERT(7 == kSRGBA_8888_GrPixelConfig);
- GR_STATIC_ASSERT(8 == kSBGRA_8888_GrPixelConfig);
- GR_STATIC_ASSERT(9 == kETC1_GrPixelConfig);
- GR_STATIC_ASSERT(10 == kLATC_GrPixelConfig);
- GR_STATIC_ASSERT(11 == kR11_EAC_GrPixelConfig);
- GR_STATIC_ASSERT(12 == kASTC_12x12_GrPixelConfig);
- GR_STATIC_ASSERT(13 == kRGBA_float_GrPixelConfig);
- GR_STATIC_ASSERT(14 == kAlpha_half_GrPixelConfig);
- GR_STATIC_ASSERT(15 == kRGBA_half_GrPixelConfig);
+ GR_STATIC_ASSERT(8 == kETC1_GrPixelConfig);
+ GR_STATIC_ASSERT(9 == kLATC_GrPixelConfig);
+ GR_STATIC_ASSERT(10 == kR11_EAC_GrPixelConfig);
+ GR_STATIC_ASSERT(11 == kASTC_12x12_GrPixelConfig);
+ GR_STATIC_ASSERT(12 == kRGBA_float_GrPixelConfig);
+ GR_STATIC_ASSERT(13 == kAlpha_half_GrPixelConfig);
+ GR_STATIC_ASSERT(14 == kRGBA_half_GrPixelConfig);
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt);
}