565 color xforms: make sure we clamp if necessary

Bug: skia:
Change-Id: I48528a0ff8dd199e0cd1649f973b5722384eacf3
Reviewed-on: https://skia-review.googlesource.com/10581
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
This commit is contained in:
Matt Sarett 2017-03-29 17:12:26 -04:00 committed by Skia Commit-Bot
parent d7e06aec7e
commit 8f7a9a9bfb

View File

@ -1227,7 +1227,10 @@ bool SkColorSpaceXform_XYZ<kCSM>
if (kNone_ColorSpaceMatch == kCSM) {
pipeline.append(SkRasterPipeline::matrix_3x4, fSrcToDst);
if (kRGBA_8888_ColorFormat == dstColorFormat || kBGRA_8888_ColorFormat == dstColorFormat) {
if (kRGBA_8888_ColorFormat == dstColorFormat ||
kBGRA_8888_ColorFormat == dstColorFormat ||
kBGR_565_ColorFormat == dstColorFormat)
{
bool need_clamp_0, need_clamp_1;
analyze_3x4_matrix(fSrcToDst, &need_clamp_0, &need_clamp_1);