aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2015-05-21 08:12:27 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-21 08:12:27 -0700
commitfb5df43af87e77beeb7ca0759678f0cc95a8c6da (patch)
tree509345031fef11b001069ff016089654da9b3efc /include/gpu
parentab8657722c7a6676b67b0820210b288ba84a14d9 (diff)
Add RGBA half float texture format.
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrColor.h2
-rw-r--r--include/gpu/GrTypes.h10
2 files changed, 11 insertions, 1 deletions
diff --git a/include/gpu/GrColor.h b/include/gpu/GrColor.h
index 43bfd8dc11..f5757b93f5 100644
--- a/include/gpu/GrColor.h
+++ b/include/gpu/GrColor.h
@@ -183,6 +183,7 @@ static inline uint32_t GrPixelConfigComponentMask(GrPixelConfig config) {
kRGBA_GrColorComponentFlags, // kASTC_12x12_GrPixelConfig
kRGBA_GrColorComponentFlags, // kRGBA_float_GrPixelConfig
kA_GrColorComponentFlag, // kAlpha_16_GrPixelConfig
+ kRGBA_GrColorComponentFlags, // kRGBA_half_GrPixelConfig
};
return kFlags[config];
@@ -200,6 +201,7 @@ static inline uint32_t GrPixelConfigComponentMask(GrPixelConfig config) {
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);
}
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index c1d324bad0..b38608e666 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -250,7 +250,12 @@ enum GrPixelConfig {
*/
kAlpha_half_GrPixelConfig,
- kLast_GrPixelConfig = kAlpha_half_GrPixelConfig
+ /**
+ * Byte order is r, g, b, a. This color format is 16 bits per channel
+ */
+ kRGBA_half_GrPixelConfig,
+
+ kLast_GrPixelConfig = kRGBA_half_GrPixelConfig
};
static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
@@ -335,6 +340,8 @@ static inline size_t GrBytesPerPixel(GrPixelConfig config) {
case kBGRA_8888_GrPixelConfig:
case kSRGBA_8888_GrPixelConfig:
return 4;
+ case kRGBA_half_GrPixelConfig:
+ return 8;
case kRGBA_float_GrPixelConfig:
return 16;
default:
@@ -350,6 +357,7 @@ static inline size_t GrUnpackAlignment(GrPixelConfig config) {
case kRGB_565_GrPixelConfig:
case kRGBA_4444_GrPixelConfig:
case kAlpha_half_GrPixelConfig:
+ case kRGBA_half_GrPixelConfig:
return 2;
case kRGBA_8888_GrPixelConfig:
case kBGRA_8888_GrPixelConfig: