Index: include/gpu/GrTypes.h |
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h |
index 5868a39e7d22add6a914351a166d6d28e0d08188..53e633da573207f77d632209683051323e1eb8bd 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; |