Chromium Code Reviews| Index: include/core/SkFlattenable.h |
| diff --git a/include/core/SkFlattenable.h b/include/core/SkFlattenable.h |
| index 0b21abcc764c7aed2bd67f9a83c5162df3e222a9..181d2857e858ef7be55b1d16af827f168f0debec 100644 |
| --- a/include/core/SkFlattenable.h |
| +++ b/include/core/SkFlattenable.h |
| @@ -27,7 +27,7 @@ class SkFlattenableWriteBuffer; |
| } |
| #define SK_DECLARE_UNFLATTENABLE_OBJECT() \ |
| - virtual Factory getFactory() SK_OVERRIDE { return NULL; }; \ |
| + virtual Factory getFactory() SK_OVERRIDE { return NULL; } |
| #define SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(flattenable) \ |
| virtual Factory getFactory() SK_OVERRIDE { return CreateProc; } \ |
| @@ -45,6 +45,8 @@ class SK_API SkFlattenable : public SkRefCnt { |
| public: |
| SK_DECLARE_INST_COUNT(SkFlattenable) |
| + enum Type { FLATTENABLE, IMAGE_FILTER }; |
|
sugoi
2013/08/13 15:20:26
This, of course, could be extended to other types.
|
| + |
| typedef SkFlattenable* (*Factory)(SkFlattenableReadBuffer&); |
| SkFlattenable() {} |
| @@ -54,6 +56,7 @@ public: |
| override of flatten(). |
| */ |
| virtual Factory getFactory() = 0; |
| + virtual bool isA(Type type) const { return FLATTENABLE == type; } |
| static Factory NameToFactory(const char name[]); |
| static const char* FactoryToName(Factory); |