Remove colorspace restrictions for 565/FP16 configs in Android Codec.

Bug: b/123377741
Change-Id: I82ae1ba1eddade35fe2d7f8c2c160db1ae20ced6
Reviewed-on: https://skia-review.googlesource.com/c/188026
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
This commit is contained in:
Derek Sollenberger 2019-01-30 11:21:33 -05:00 committed by Skia Commit-Bot
parent dcfc3ef110
commit 1be431f60f

View File

@ -162,6 +162,17 @@ SkAlphaType SkAndroidCodec::computeOutputAlphaType(bool requestedUnpremul) {
sk_sp<SkColorSpace> SkAndroidCodec::computeOutputColorSpace(SkColorType outputColorType,
sk_sp<SkColorSpace> prefColorSpace) {
switch (outputColorType) {
#ifdef SK_SUPPORT_LEGACY_ANDROID_CODEC_COLORSPACE
case kRGBA_F16_SkColorType:
// Note that |prefColorSpace| is ignored, F16 is always linear sRGB.
return SkColorSpace::MakeSRGBLinear();
case kRGB_565_SkColorType:
// Note that |prefColorSpace| is ignored, 565 is always sRGB.
return SkColorSpace::MakeSRGB();
#else
case kRGBA_F16_SkColorType:
case kRGB_565_SkColorType:
#endif
case kRGBA_8888_SkColorType:
case kBGRA_8888_SkColorType: {
// If |prefColorSpace| is supplied, choose it.
@ -184,12 +195,6 @@ sk_sp<SkColorSpace> SkAndroidCodec::computeOutputColorSpace(SkColorType outputCo
return SkColorSpace::MakeSRGB();
}
case kRGBA_F16_SkColorType:
// Note that |prefColorSpace| is ignored, F16 is always linear sRGB.
return SkColorSpace::MakeSRGBLinear();
case kRGB_565_SkColorType:
// Note that |prefColorSpace| is ignored, 565 is always sRGB.
return SkColorSpace::MakeSRGB();
default:
// Color correction not supported for kGray.
return nullptr;