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

Unified Diff: include/gpu/GrTypes.h

Issue 359803003: 32 bpp floating point textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback incorporated 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 425c136fa6013f5c8d444c87faa4bd3b0e62b132..db013e33e5a90c6bf07440459833a66c24aa0519 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -274,7 +274,7 @@ enum GrPixelConfig {
* Premultiplied. Byte order is b,g,r,a.
*/
kBGRA_8888_GrPixelConfig,
- /**
+ /**
* ETC1 Compressed Data
*/
kETC1_GrPixelConfig,
@@ -282,14 +282,16 @@ enum GrPixelConfig {
* LATC/RGTC/3Dc/BC4 Compressed Data
*/
kLATC_GrPixelConfig,
-
/**
* R11 EAC Compressed Data
* (Corresponds to section C.3.5 of the OpenGL 4.4 core profile spec)
*/
kR11_EAC_GrPixelConfig,
-
- kLast_GrPixelConfig = kR11_EAC_GrPixelConfig
+ /**
+ * Byte order is r, g, b, a. This color format is 32 bits per channel
+ */
+ kRGBA_float_GrPixelConfig,
+ kLast_GrPixelConfig = kRGBA_float_GrPixelConfig
};
static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
@@ -353,6 +355,25 @@ static inline size_t GrBytesPerPixel(GrPixelConfig config) {
case kRGBA_8888_GrPixelConfig:
case kBGRA_8888_GrPixelConfig:
return 4;
+ case kRGBA_float_GrPixelConfig:
+ return 16;
+ default:
+ return 0;
+ }
+}
+
+static inline size_t GrUnpackAlignment(GrPixelConfig config) {
+ switch (config) {
+ case kAlpha_8_GrPixelConfig:
+ case kIndex_8_GrPixelConfig:
+ return 1;
+ case kRGB_565_GrPixelConfig:
+ case kRGBA_4444_GrPixelConfig:
+ return 2;
+ case kRGBA_8888_GrPixelConfig:
+ case kBGRA_8888_GrPixelConfig:
+ case kRGBA_float_GrPixelConfig:
+ return 4;
default:
return 0;
}
@@ -644,7 +665,7 @@ enum GrGLBackendState {
/**
* Returns the data size for the given compressed pixel config
- */
+ */
static inline size_t GrCompressedFormatDataSize(GrPixelConfig config,
int width, int height) {
SkASSERT(GrPixelConfigIsCompressed(config));
« 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