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

Unified Diff: include/gpu/GrTypes.h

Issue 399623004: Add new ASTC pixel config (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 6 years, 5 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/GrDrawTarget.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 db013e33e5a90c6bf07440459833a66c24aa0519..0a73be9d85f7d5e581f9da161a6e315eacb411c7 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -287,6 +287,19 @@ enum GrPixelConfig {
* (Corresponds to section C.3.5 of the OpenGL 4.4 core profile spec)
*/
kR11_EAC_GrPixelConfig,
+
+ /**
+ * 12x12 ASTC Compressed Data
+ * ASTC stands for Adaptive Scalable Texture Compression. It is a technique
+ * that allows for a lot of customization in the compressed representataion
+ * of a block. The only thing fixed in the representation is the block size,
+ * which means that a texture that contains ASTC data must be treated as
+ * having RGBA values. However, there are single-channel encodings which set
+ * the alpha to opaque and all three RGB channels equal effectively making the
+ * compression format a single channel such as R11 EAC and LATC.
+ */
+ kASTC_12x12_GrPixelConfig,
+
/**
* Byte order is r, g, b, a. This color format is 32 bits per channel
*/
@@ -314,6 +327,7 @@ static inline bool GrPixelConfigIsCompressed(GrPixelConfig config) {
case kETC1_GrPixelConfig:
case kLATC_GrPixelConfig:
case kR11_EAC_GrPixelConfig:
+ case kASTC_12x12_GrPixelConfig:
return true;
default:
return false;
@@ -678,6 +692,11 @@ static inline size_t GrCompressedFormatDataSize(GrPixelConfig config,
SkASSERT((height & 3) == 0);
return (width >> 2) * (height >> 2) * 8;
+ case kASTC_12x12_GrPixelConfig:
+ SkASSERT((width % 12) == 0);
+ SkASSERT((height % 12) == 0);
+ return (width / 12) * (height / 12) * 16;
+
default:
SkFAIL("Unknown compressed pixel config");
return 4 * width * height;
« no previous file with comments | « include/gpu/GrColor.h ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698