Index: include/effects/SkComposeImageFilter.h |
diff --git a/include/effects/SkComposeImageFilter.h b/include/effects/SkComposeImageFilter.h |
index 068bcab7b86e16b06ebd348c3c88ec675f6130a2..26eed378722d2d2d728674658108bcf3c9907680 100644 |
--- a/include/effects/SkComposeImageFilter.h |
+++ b/include/effects/SkComposeImageFilter.h |
@@ -14,7 +14,13 @@ class SK_API SkComposeImageFilter : public SkImageFilter { |
public: |
virtual ~SkComposeImageFilter(); |
- static SkComposeImageFilter* Create(SkImageFilter* outer, SkImageFilter* inner) { |
+ static SkImageFilter* Create(SkImageFilter* outer, SkImageFilter* inner) { |
+ if (NULL == outer) { |
+ return SkSafeRef(inner); |
+ } |
+ if (NULL == inner) { |
+ return SkRef(outer); |
+ } |
SkImageFilter* inputs[2] = { outer, inner }; |
return SkNEW_ARGS(SkComposeImageFilter, (inputs)); |
} |
@@ -22,8 +28,13 @@ public: |
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposeImageFilter) |
protected: |
- explicit SkComposeImageFilter(SkImageFilter* inputs[2]) : INHERITED(2, inputs) {} |
+ explicit SkComposeImageFilter(SkImageFilter* inputs[2]) : INHERITED(2, inputs) { |
+ SkASSERT(inputs[0]); |
+ SkASSERT(inputs[1]); |
+ } |
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
explicit SkComposeImageFilter(SkReadBuffer& buffer); |
+#endif |
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, |
SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE; |