From eef980270d3385fee340eb1633962fe3ba8b7132 Mon Sep 17 00:00:00 2001 From: brianosman Date: Mon, 29 Feb 2016 13:39:09 -0800 Subject: Progress on gamma-correctness in the GPU backend. Fixed conversion of color and profile type to pixel config, which makes many things "just work". Added (color=8888|f16|srgb) option to gpu configurations, along with gpuf16, gpusrgb, and anglesrgb predefined configs. Runs the gpu backend in gamma-correct mode (with either FP16 linear or sRGB 8888 frambuffers). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1746253002 Review URL: https://codereview.chromium.org/1746253002 --- src/gpu/SkGr.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/gpu/SkGr.cpp') diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index a3848c77e0..4106d494b1 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: -- cgit v1.2.3