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 --- include/core/SkImageFilter.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/core') diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h index f0ab16017c..beccc80205 100644 --- a/include/core/SkImageFilter.h +++ b/include/core/SkImageFilter.h @@ -14,6 +14,7 @@ #include "SkColorSpace.h" #include "SkFilterQuality.h" #include "SkFlattenable.h" +#include "SkImageInfo.h" #include "SkMatrix.h" #include "SkRect.h" @@ -41,11 +42,14 @@ public: // consumer of the DAG's output. class OutputProperties { public: - explicit OutputProperties(SkColorSpace* colorSpace) : fColorSpace(colorSpace) {} + explicit OutputProperties(SkColorType colorType, SkColorSpace* colorSpace) + : fColorType(colorType), fColorSpace(colorSpace) {} + SkColorType colorType() const { return fColorType; } SkColorSpace* colorSpace() const { return fColorSpace; } private: + SkColorType fColorType; // This will be a pointer to the device's color space, and our lifetime is bounded by // the device, so we can store a bare pointer. SkColorSpace* fColorSpace; -- cgit v1.2.3