diff options
author | ajuma <ajuma@chromium.org> | 2016-01-08 14:58:35 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-08 14:58:35 -0800 |
commit | 77b6ba3b6e23b84a3a4f3a62812e4a9eb6de4c23 (patch) | |
tree | e567bf7da5cadf68009bbd21d2e65fb01895663a /src/core/SkPathEffect.cpp | |
parent | c146aa6fd45dffe29b4f565aafd4ec3a16d9f73b (diff) |
Implement an SkPaint-based image filter
This implements SkPaintImageFilter, and is intended to replace
SkRectShaderImageFilter. By allowing a paint and not just a
shader as input, this allows consumers to control dithering.
BUG=skia:4780
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1556553002
Review URL: https://codereview.chromium.org/1556553002
Diffstat (limited to 'src/core/SkPathEffect.cpp')
-rw-r--r-- | src/core/SkPathEffect.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/SkPathEffect.cpp b/src/core/SkPathEffect.cpp index 2403ffcb30..293bb53b2c 100644 --- a/src/core/SkPathEffect.cpp +++ b/src/core/SkPathEffect.cpp @@ -67,7 +67,11 @@ void SkPairPathEffect::toString(SkString* str) const { SkFlattenable* SkComposePathEffect::CreateProc(SkReadBuffer& buffer) { SkAutoTUnref<SkPathEffect> pe0(buffer.readPathEffect()); SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect()); - return SkComposePathEffect::Create(pe0, pe1); + if (pe0 && pe1) { + return SkComposePathEffect::Create(pe0, pe1); + } else { + return nullptr; + } } bool SkComposePathEffect::filterPath(SkPath* dst, const SkPath& src, @@ -100,7 +104,11 @@ void SkComposePathEffect::toString(SkString* str) const { SkFlattenable* SkSumPathEffect::CreateProc(SkReadBuffer& buffer) { SkAutoTUnref<SkPathEffect> pe0(buffer.readPathEffect()); SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect()); - return SkSumPathEffect::Create(pe0, pe1); + if (pe0 && pe1) { + return SkSumPathEffect::Create(pe0, pe1); + } else { + return nullptr; + } } bool SkSumPathEffect::filterPath(SkPath* dst, const SkPath& src, |