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

Unified Diff: include/gpu/GrTypes.h

Issue 1789663002: sRGB support in Ganesh. Several pieces: (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Squelch assert when blurring sRGB Created 4 years, 9 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/GrTextureParams.h ('k') | include/gpu/SkGr.h » ('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 3def9aaa993df434948afe15cf8263d655f42776..9be500d3b2206e004a9fbed3bc176365bae51d0a 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -218,6 +218,10 @@ enum GrPixelConfig {
*/
kSRGBA_8888_GrPixelConfig,
/**
+ * Premultiplied and sRGB. Byte order is b,g,r,a.
+ */
+ kSBGRA_8888_GrPixelConfig,
+ /**
* ETC1 Compressed Data
*/
kETC1_GrPixelConfig,
@@ -268,8 +272,10 @@ static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
#endif
#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
+ static const GrPixelConfig kSkiaGamma8888_GrPixelConfig = kSBGRA_8888_GrPixelConfig;
#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
static const GrPixelConfig kSkia8888_GrPixelConfig = kRGBA_8888_GrPixelConfig;
+ static const GrPixelConfig kSkiaGamma8888_GrPixelConfig = kSRGBA_8888_GrPixelConfig;
#else
#error "SK_*32_SHIFT values must correspond to GL_BGRA or GL_RGBA format."
#endif
@@ -311,6 +317,7 @@ static inline bool GrPixelConfigIs8888(GrPixelConfig config) {
case kRGBA_8888_GrPixelConfig:
case kBGRA_8888_GrPixelConfig:
case kSRGBA_8888_GrPixelConfig:
+ case kSBGRA_8888_GrPixelConfig:
return true;
default:
return false;
@@ -322,6 +329,7 @@ static inline bool GrPixelConfigIs8888(GrPixelConfig config) {
static inline bool GrPixelConfigIsSRGB(GrPixelConfig config) {
switch (config) {
case kSRGBA_8888_GrPixelConfig:
+ case kSBGRA_8888_GrPixelConfig:
return true;
default:
return false;
@@ -336,6 +344,10 @@ static inline GrPixelConfig GrPixelConfigSwapRAndB(GrPixelConfig config) {
return kRGBA_8888_GrPixelConfig;
case kRGBA_8888_GrPixelConfig:
return kBGRA_8888_GrPixelConfig;
+ case kSBGRA_8888_GrPixelConfig:
+ return kSRGBA_8888_GrPixelConfig;
+ case kSRGBA_8888_GrPixelConfig:
+ return kSBGRA_8888_GrPixelConfig;
default:
return kUnknown_GrPixelConfig;
}
@@ -353,6 +365,7 @@ static inline size_t GrBytesPerPixel(GrPixelConfig config) {
case kRGBA_8888_GrPixelConfig:
case kBGRA_8888_GrPixelConfig:
case kSRGBA_8888_GrPixelConfig:
+ case kSBGRA_8888_GrPixelConfig:
return 4;
case kRGBA_half_GrPixelConfig:
return 8;
@@ -386,6 +399,16 @@ static inline bool GrPixelConfigIsAlphaOnly(GrPixelConfig config) {
}
}
+static inline bool GrAllowSRGBForDestinationPixelConfig(GrPixelConfig config) {
+ switch (config) {
+ case kRGBA_8888_GrPixelConfig:
+ case kBGRA_8888_GrPixelConfig:
+ return false;
+ default:
+ return true;
+ }
+}
+
/**
* Optional bitfield flags that can be set on GrSurfaceDesc (below).
*/
« no previous file with comments | « include/gpu/GrTextureParams.h ('k') | include/gpu/SkGr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698