From a50205fca5f7cff36dd3adac841b4c23a90a0b7d Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Fri, 6 Jul 2018 13:57:01 -0400 Subject: Add color type to the image filter DAG's OutputProperties Don't try to guess the pixel config to use for intermediates. Instead, just make the intermediates in the same color type (and space) as the final destination. This removes some no-longer-correct logic that was using sRGB configs, resulting in linear blending and precision loss. Change-Id: I627c47193a9f2889c3dc121170ff3e7d5d315fa0 Reviewed-on: https://skia-review.googlesource.com/139547 Reviewed-by: Mike Klein Commit-Queue: Brian Osman --- src/pdf/SkPDFDevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pdf') diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp index 2d2e27bf1f..6868aefe5c 100644 --- a/src/pdf/SkPDFDevice.cpp +++ b/src/pdf/SkPDFDevice.cpp @@ -2342,9 +2342,9 @@ void SkPDFDevice::drawSpecial(SkSpecialImage* srcImg, int x, int y, const SkPain const SkIRect clipBounds = this->cs().bounds(this->bounds()).roundOut().makeOffset(-x, -y); sk_sp cache(this->getImageFilterCache()); - // TODO: Should PDF be operating in a specified color space? For now, run the filter + // TODO: Should PDF be operating in a specified color type/space? For now, run the filter // in the same color space as the source (this is different from all other backends). - SkImageFilter::OutputProperties outputProperties(srcImg->getColorSpace()); + SkImageFilter::OutputProperties outputProperties(kN32_SkColorType, srcImg->getColorSpace()); SkImageFilter::Context ctx(matrix, clipBounds, cache.get(), outputProperties); sk_sp resultImg(filter->filterImage(srcImg, ctx, &offset)); -- cgit v1.2.3