epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2006 The Android Open Source Project |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
| 8 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 9 | |
| 10 | #ifndef SkDisplayAdd_DEFINED |
| 11 | #define SkDisplayAdd_DEFINED |
| 12 | |
reed | 986ca61 | 2014-11-26 08:50:45 -0800 | [diff] [blame] | 13 | #include "SkADrawable.h" |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 14 | #include "SkMemberInfo.h" |
| 15 | |
reed | 986ca61 | 2014-11-26 08:50:45 -0800 | [diff] [blame] | 16 | class SkAdd : public SkADrawable { |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 17 | DECLARE_MEMBER_INFO(Add); |
| 18 | SkAdd(); |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 19 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 20 | enum Mode { |
| 21 | kMode_indirect, |
| 22 | kMode_immediate |
| 23 | }; |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 24 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 25 | SkDisplayable* deepCopy(SkAnimateMaker* ) override; |
| 26 | bool draw(SkAnimateMaker& ) override; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 27 | #ifdef SK_DUMP_ENABLED |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 28 | void dump(SkAnimateMaker* ) override; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 29 | #endif |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 30 | bool enable(SkAnimateMaker& ) override; |
| 31 | bool hasEnable() const override; |
| 32 | void initialize() override; |
| 33 | bool isDrawable() const override; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 34 | protected: |
| 35 | // struct _A { |
| 36 | Mode mode; |
| 37 | int32_t offset; |
reed | 986ca61 | 2014-11-26 08:50:45 -0800 | [diff] [blame] | 38 | SkADrawable* use; |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 39 | SkADrawable* where; // if nullptr, offset becomes index |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 40 | // } A; |
| 41 | private: |
reed | 986ca61 | 2014-11-26 08:50:45 -0800 | [diff] [blame] | 42 | typedef SkADrawable INHERITED; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | class SkClear : public SkDisplayable { |
| 46 | virtual bool enable(SkAnimateMaker& ); |
| 47 | }; |
| 48 | |
| 49 | class SkMove : public SkAdd { |
| 50 | DECLARE_MEMBER_INFO(Move); |
| 51 | private: |
| 52 | typedef SkAdd INHERITED; |
| 53 | }; |
| 54 | |
| 55 | class SkRemove : public SkAdd { |
| 56 | DECLARE_MEMBER_INFO(Remove); |
| 57 | SkRemove(); |
| 58 | protected: |
| 59 | SkBool fDelete; |
| 60 | private: |
| 61 | friend class SkAdd; |
| 62 | typedef SkAdd INHERITED; |
| 63 | }; |
| 64 | |
| 65 | class SkReplace : public SkAdd { |
| 66 | DECLARE_MEMBER_INFO(Replace); |
| 67 | private: |
| 68 | typedef SkAdd INHERITED; |
| 69 | }; |
| 70 | |
| 71 | #endif // SkDisplayAdd_DEFINED |