Index: src/gpu/SkGr.cpp |
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp |
index c8839f3f1a49b0863df897e6f60de1a421ea0c54..9ee8722afa0eb213dd9d40709e7b761b74c1f6f0 100644 |
--- a/src/gpu/SkGr.cpp |
+++ b/src/gpu/SkGr.cpp |
@@ -508,6 +508,19 @@ bool GrPixelConfigToColorType(GrPixelConfig config, SkColorType* ctOut) { |
return true; |
} |
+GrPixelConfig GrRenderableConfigForColorSpace(SkColorSpace* colorSpace) { |
+ if (!colorSpace) { |
+ return kRGBA_8888_GrPixelConfig; |
+ } else if (colorSpace->gammaIsLinear()) { |
+ return kRGBA_half_GrPixelConfig; |
+ } else if (colorSpace->gammaCloseToSRGB()) { |
+ return kSRGBA_8888_GrPixelConfig; |
+ } else { |
+ SkDEBUGFAIL("No renderable config exists for color space with strange gamma"); |
+ return kUnknown_GrPixelConfig; |
+ } |
+} |
+ |
//////////////////////////////////////////////////////////////////////////////////////////////// |
static inline bool blend_requires_shader(const SkXfermode::Mode mode, bool primitiveIsSrc) { |