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

Unified Diff: src/gpu/SkGr.cpp

Issue 1746253002: Progress on gamma-correctness in the GPU backend. Fixed conversion of color and profile type to pix… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase and switch back to kN32 color type. Fixes DM crash on some configs. Created 4 years, 10 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 | « dm/DMSrcSink.cpp ('k') | tests/TestConfigParsing.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index a3848c77e01de508f9c22a96e8c4b2d0f69d8454..4106d494b1f07d9f0cebc716d03dcefaef302daf 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -370,12 +370,13 @@ GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType ct, SkAlphaType, SkColorProf
case kARGB_4444_SkColorType:
return kRGBA_4444_GrPixelConfig;
case kRGBA_8888_SkColorType:
- //if (kSRGB_SkColorProfileType == pt) {
- // return kSRGBA_8888_GrPixelConfig;
- //}
- return kRGBA_8888_GrPixelConfig;
+ return (kSRGB_SkColorProfileType == pt)
+ ? kSRGBA_8888_GrPixelConfig
+ : kRGBA_8888_GrPixelConfig;
case kBGRA_8888_SkColorType:
- return kBGRA_8888_GrPixelConfig;
+ return (kSRGB_SkColorProfileType == pt)
+ ? kSRGBA_8888_GrPixelConfig // Does not preserve byte order!
+ : kBGRA_8888_GrPixelConfig;
case kIndex_8_SkColorType:
return kIndex_8_GrPixelConfig;
case kGray_8_SkColorType:
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | tests/TestConfigParsing.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698