aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-07-06 13:57:01 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-06 18:34:58 +0000
commita50205fca5f7cff36dd3adac841b4c23a90a0b7d (patch)
tree4aa111a0c4b80400dfa39ef5b36e8ef391c164ab /include/core
parent5a619a740f12f0b1f504f305b8964efe4c85ee26 (diff)
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 <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkImageFilter.h6
1 files changed, 5 insertions, 1 deletions
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;