Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Unified Diff: include/gpu/GrTypes.h

Issue 304743004: Move ETC1 and LATC enums value to GrPixelConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Only generate mipmaps for uncompressed textures. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrColor.h ('k') | src/gpu/GrAtlas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « include/gpu/GrColor.h ('k') | src/gpu/GrAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698