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

Unified Diff: src/gpu/SkGr.cpp

Issue 2359443003: Fix some GPU image filter code to preserve precision and color space (Closed)
Patch Set: Created 4 years, 3 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
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) {
« no previous file with comments | « src/gpu/GrDrawingManager.cpp ('k') | src/gpu/SkGrPriv.h » ('j') | src/gpu/SkGrPriv.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698