Fix premul state in from_srgb in convert_with_pipeline

Without this patch, the pipeline
1. converts to unpremultiplied
2. applies the sRGB transfer assuming the pixel is premultiplied

In step 2, we should assume the pixel is unpremultiplied.

Bug:738517
Change-Id: Ic11fcf64faa423577ccb1cfc0cfe96feb57db09a
Reviewed-on: https://skia-review.googlesource.com/28404
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
Christopher Cameron 2017-07-30 12:46:39 -07:00 committed by Skia Commit-Bot
parent 0500ebafec
commit 179849efe5

View File

@ -301,7 +301,7 @@ static void convert_with_pipeline(const SkImageInfo& dstInfo, void* dstRow, size
SkColorSpaceTransferFn srcFn;
if (isColorAware && srcInfo.gammaCloseToSRGB()) {
pipeline.append_from_srgb(srcInfo.alphaType());
pipeline.append_from_srgb(premulState);
} else if (isColorAware && !srcInfo.colorSpace()->gammaIsLinear()) {
SkAssertResult(srcInfo.colorSpace()->isNumericalTransferFn(&srcFn));
pipeline.append(SkRasterPipeline::parametric_r, &srcFn);