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 9 10 #ifndef SkDisplayAdd_DEFINED 11 #define SkDisplayAdd_DEFINED 12 13 #include "SkADrawable.h" 14 #include "SkMemberInfo.h" 15 16 class SkAdd : public SkADrawable { 17 DECLARE_MEMBER_INFO(Add); 18 SkAdd(); 19 20 enum Mode { 21 kMode_indirect, 22 kMode_immediate 23 }; 24 25 SkDisplayable* deepCopy(SkAnimateMaker* ) override; 26 bool draw(SkAnimateMaker& ) override; 27 #ifdef SK_DUMP_ENABLED 28 void dump(SkAnimateMaker* ) override; 29 #endif 30 bool enable(SkAnimateMaker& ) override; 31 bool hasEnable() const override; 32 void initialize() override; 33 bool isDrawable() const override; 34 protected: 35 // struct _A { 36 Mode mode; 37 int32_t offset; 38 SkADrawable* use; 39 SkADrawable* where; // if nullptr, offset becomes index 40 // } A; 41 private: 42 typedef SkADrawable INHERITED; 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 72