diff options
author | msarett <msarett@google.com> | 2016-04-25 06:40:26 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-25 06:40:26 -0700 |
commit | edf7fcd8b9e339800edb61ae422f8b6c1b77c3e8 (patch) | |
tree | 93be6103d394984eab3984a9ab5f32ff08ea69d8 /include | |
parent | 5d36360c47ed48c93e6928cc5de1a5ebd65b6eea (diff) |
Make SkDrawable an SkFlattenable
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1911403004
Review URL: https://codereview.chromium.org/1911403004
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkDrawable.h | 8 | ||||
-rw-r--r-- | include/core/SkFlattenable.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/include/core/SkDrawable.h b/include/core/SkDrawable.h index 2f0a62d8b5..6fec3fcf93 100644 --- a/include/core/SkDrawable.h +++ b/include/core/SkDrawable.h @@ -8,9 +8,10 @@ #ifndef SkDrawable_DEFINED #define SkDrawable_DEFINED -#include "SkRefCnt.h" +#include "SkFlattenable.h" class SkCanvas; +class SkMatrix; class SkPicture; struct SkRect; @@ -21,7 +22,7 @@ struct SkRect; * allow for clients of the drawable that may want to cache the results, the drawable must * change its generation ID whenever its internal state changes such that it will draw differently. */ -class SkDrawable : public SkRefCnt { +class SkDrawable : public SkFlattenable { public: SkDrawable(); @@ -58,6 +59,9 @@ public: */ void notifyDrawingChanged(); + SK_DEFINE_FLATTENABLE_TYPE(SkDrawable) + Factory getFactory() const override { return nullptr; } + protected: virtual SkRect onGetBounds() = 0; virtual void onDraw(SkCanvas*) = 0; diff --git a/include/core/SkFlattenable.h b/include/core/SkFlattenable.h index 0ba83da087..260ea33dab 100644 --- a/include/core/SkFlattenable.h +++ b/include/core/SkFlattenable.h @@ -71,6 +71,7 @@ class SK_API SkFlattenable : public SkRefCnt { public: enum Type { kSkColorFilter_Type, + kSkDrawable_Type, kSkDrawLooper_Type, kSkImageFilter_Type, kSkMaskFilter_Type, |