diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrColor.h | 4 | ||||
-rw-r--r-- | include/gpu/GrTypes.h | 37 |
2 files changed, 26 insertions, 15 deletions
diff --git a/include/gpu/GrColor.h b/include/gpu/GrColor.h index 183781ac3e..9f6eb1cde2 100644 --- a/include/gpu/GrColor.h +++ b/include/gpu/GrColor.h @@ -132,6 +132,8 @@ static inline uint32_t GrPixelConfigComponentMask(GrPixelConfig config) { kRGBA_GrColorComponentFlags, // kRGBA_4444_GrPixelConfig kRGBA_GrColorComponentFlags, // kRGBA_8888_GrPixelConfig kRGBA_GrColorComponentFlags, // kBGRA_8888_GrPixelConfig + kRGB_GrColorComponentFlags, // kETC1_GrPixelConfig + kA_GrColorComponentFlag, // kLATC_GrPixelConfig }; return kFlags[config]; @@ -142,6 +144,8 @@ static inline uint32_t GrPixelConfigComponentMask(GrPixelConfig config) { GR_STATIC_ASSERT(4 == kRGBA_4444_GrPixelConfig); GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig); GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig); + GR_STATIC_ASSERT(7 == kETC1_GrPixelConfig); + GR_STATIC_ASSERT(8 == kLATC_GrPixelConfig); GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt); } diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h index 5868a39e7d..53e633da57 100644 --- a/include/gpu/GrTypes.h +++ b/include/gpu/GrTypes.h @@ -281,8 +281,16 @@ enum GrPixelConfig { * Premultiplied. Byte order is b,g,r,a. */ kBGRA_8888_GrPixelConfig, + /** + * ETC1 Compressed Data + */ + kETC1_GrPixelConfig, + /** + * LATC/RGTC/3Dc/BC4 Compressed Data + */ + kLATC_GrPixelConfig, - kLast_GrPixelConfig = kBGRA_8888_GrPixelConfig + kLast_GrPixelConfig = kLATC_GrPixelConfig }; static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1; @@ -298,6 +306,18 @@ static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1; #error "SK_*32_SHIFT values must correspond to GL_BGRA or GL_RGBA format." #endif +// Returns true if the pixel config is a GPU-specific compressed format +// representation. +static inline bool GrPixelConfigIsCompressed(GrPixelConfig config) { + switch (config) { + case kETC1_GrPixelConfig: + case kLATC_GrPixelConfig: + return true; + default: + return false; + } +} + // Returns true if the pixel config is 32 bits per pixel static inline bool GrPixelConfigIs8888(GrPixelConfig config) { switch (config) { @@ -340,6 +360,7 @@ static inline size_t GrBytesPerPixel(GrPixelConfig config) { static inline bool GrPixelConfigIsOpaque(GrPixelConfig config) { switch (config) { + case kETC1_GrPixelConfig: case kRGB_565_GrPixelConfig: return true; default: @@ -620,20 +641,6 @@ enum GrGLBackendState { }; /** - * The compressed texture formats that may be supported by the renderer. - * Make sure to check for the required capabilities using - * GrDrawTargetCaps::compressedTextureSupport - */ -enum GrCompressedFormat { - kETC1_GrCompressedFormat, - kETC2_GrCompressedFormat, - kDXT1_GrCompressedFormat, - - kLast_GrCompressedFormat = kDXT1_GrCompressedFormat -}; -static const int kGrCompressedFormatCount = kLast_GrCompressedFormat + 1; - -/** * This value translates to reseting all the context state for any backend. */ static const uint32_t kAll_GrBackendState = 0xffffffff; |