Index: src/gpu/SkGr.cpp |
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp |
index e311ae2ace4c76991c59a889d9a4ce661dd1ba42..ce073fd4a730f6564f2e856afcd4ca241554e2a3 100644 |
--- a/src/gpu/SkGr.cpp |
+++ b/src/gpu/SkGr.cpp |
@@ -403,7 +403,7 @@ GrTexture* GrRefCachedBitmapTexture(GrContext* ctx, |
// alphatype is ignore for now, but if GrPixelConfig is expanded to encompass |
// alpha info, that will be considered. |
-GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType ct, SkAlphaType) { |
+GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType ct, SkAlphaType, SkColorProfileType pt) { |
switch (ct) { |
case kUnknown_SkColorType: |
return kUnknown_GrPixelConfig; |
@@ -414,6 +414,9 @@ GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType ct, SkAlphaType) { |
case kARGB_4444_SkColorType: |
return kRGBA_4444_GrPixelConfig; |
case kRGBA_8888_SkColorType: |
+ if (kSRGB_SkColorProfileType == pt) { |
+ return kSRGBA_8888_GrPixelConfig; |
+ } |
return kRGBA_8888_GrPixelConfig; |
case kBGRA_8888_SkColorType: |
return kBGRA_8888_GrPixelConfig; |
@@ -424,8 +427,10 @@ GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType ct, SkAlphaType) { |
return kUnknown_GrPixelConfig; |
} |
-bool GrPixelConfig2ColorType(GrPixelConfig config, SkColorType* ctOut) { |
+bool GrPixelConfig2ColorAndProfileType(GrPixelConfig config, SkColorType* ctOut, |
+ SkColorProfileType* ptOut) { |
SkColorType ct; |
+ SkColorProfileType pt = kLinear_SkColorProfileType; |
switch (config) { |
case kAlpha_8_GrPixelConfig: |
ct = kAlpha_8_SkColorType; |
@@ -445,12 +450,19 @@ bool GrPixelConfig2ColorType(GrPixelConfig config, SkColorType* ctOut) { |
case kBGRA_8888_GrPixelConfig: |
ct = kBGRA_8888_SkColorType; |
break; |
+ case kSRGBA_8888_GrPixelConfig: |
+ ct = kRGBA_8888_SkColorType; |
+ pt = kSRGB_SkColorProfileType; |
+ break; |
default: |
return false; |
} |
if (ctOut) { |
*ctOut = ct; |
} |
+ if (ptOut) { |
+ *ptOut = pt; |
+ } |
return true; |
} |