Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Unified Diff: src/core/SkPathEffect.cpp

Issue 1556553002: Implement an SkPaint-based image filter (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: More randomness for paths and for rasterizer's paint Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkPathEffect.cpp
diff --git a/src/core/SkPathEffect.cpp b/src/core/SkPathEffect.cpp
index 2403ffcb30c5f99511ebed3c6d7cf9b589231027..293bb53b2c416a55ce931b6c727e7d0e686a7047 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,

Powered by Google App Engine
This is Rietveld 408576698