Index: include/gpu/GrTypes.h |
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h |
index 5868a39e7d22add6a914351a166d6d28e0d08188..bb9a46429903295832dcf09aeed5fa02fa906fb4 100644 |
--- a/include/gpu/GrTypes.h |
+++ b/include/gpu/GrTypes.h |
@@ -282,7 +282,9 @@ enum GrPixelConfig { |
*/ |
kBGRA_8888_GrPixelConfig, |
robertphillips
2014/05/29 12:53:18
I think these comments should only have one * or b
krajcevski
2014/05/29 14:28:22
Done.
|
- kLast_GrPixelConfig = kBGRA_8888_GrPixelConfig |
+ kETC1_GrPixelConfig, /** ETC1 Compressed Data **/ |
+ kLATC_GrPixelConfig, /** LATC/RGTC/3Dc/BC4 Compressed Data **/ |
+ kLast_GrPixelConfig = kLATC_GrPixelConfig |
}; |
static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1; |
@@ -298,6 +300,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 +354,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 +635,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; |