SkAlphaThresholdFilter.h allow flattening
Motivation: allows this:
#include "SkAlphaThresholdFilter.h"
void init() {
SkAlphaThresholdFilter::InitializeFlattenables();
}
BUG=skia:4613
Review URL: https://codereview.chromium.org/1500373003
diff --git a/include/effects/SkAlphaThresholdFilter.h b/include/effects/SkAlphaThresholdFilter.h
index f409ee0..17521b6 100644
--- a/include/effects/SkAlphaThresholdFilter.h
+++ b/include/effects/SkAlphaThresholdFilter.h
@@ -22,6 +22,7 @@
*/
static SkImageFilter* Create(const SkRegion& region, SkScalar innerThreshold,
SkScalar outerThreshold, SkImageFilter* input = NULL);
+ SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP();
};
#endif
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index 661d0d3..b6be944 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -22,6 +22,7 @@
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkAlphaThresholdFilterImpl)
+ friend void SkAlphaThresholdFilter::InitializeFlattenables();
protected:
void flatten(SkWriteBuffer&) const override;
@@ -40,6 +41,11 @@
typedef SkImageFilter INHERITED;
};
+SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkAlphaThresholdFilter)
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkAlphaThresholdFilterImpl)
+SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
+
+
SkImageFilter* SkAlphaThresholdFilter::Create(const SkRegion& region,
SkScalar innerThreshold,
SkScalar outerThreshold,