aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-04-25 06:40:26 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-25 06:40:26 -0700
commitedf7fcd8b9e339800edb61ae422f8b6c1b77c3e8 (patch)
tree93be6103d394984eab3984a9ab5f32ff08ea69d8 /include
parent5d36360c47ed48c93e6928cc5de1a5ebd65b6eea (diff)
Make SkDrawable an SkFlattenable
Diffstat (limited to 'include')
-rw-r--r--include/core/SkDrawable.h8
-rw-r--r--include/core/SkFlattenable.h1
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,