michael@0: michael@0: /* michael@0: * Copyright 2006 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #ifndef SkDisplayAdd_DEFINED michael@0: #define SkDisplayAdd_DEFINED michael@0: michael@0: #include "SkDrawable.h" michael@0: #include "SkMemberInfo.h" michael@0: michael@0: class SkAdd : public SkDrawable { michael@0: DECLARE_MEMBER_INFO(Add); michael@0: SkAdd(); michael@0: michael@0: enum Mode { michael@0: kMode_indirect, michael@0: kMode_immediate michael@0: }; michael@0: michael@0: virtual SkDisplayable* deepCopy(SkAnimateMaker* ); michael@0: virtual bool draw(SkAnimateMaker& ); michael@0: #ifdef SK_DUMP_ENABLED michael@0: virtual void dump(SkAnimateMaker* ); michael@0: #endif michael@0: virtual bool enable(SkAnimateMaker& ); michael@0: virtual bool hasEnable() const; michael@0: virtual void initialize(); michael@0: virtual bool isDrawable() const; michael@0: protected: michael@0: // struct _A { michael@0: Mode mode; michael@0: int32_t offset; michael@0: SkDrawable* use; michael@0: SkDrawable* where; // if NULL, offset becomes index michael@0: // } A; michael@0: private: michael@0: typedef SkDrawable INHERITED; michael@0: }; michael@0: michael@0: class SkClear : public SkDisplayable { michael@0: virtual bool enable(SkAnimateMaker& ); michael@0: }; michael@0: michael@0: class SkMove : public SkAdd { michael@0: DECLARE_MEMBER_INFO(Move); michael@0: private: michael@0: typedef SkAdd INHERITED; michael@0: }; michael@0: michael@0: class SkRemove : public SkAdd { michael@0: DECLARE_MEMBER_INFO(Remove); michael@0: SkRemove(); michael@0: protected: michael@0: SkBool fDelete; michael@0: private: michael@0: friend class SkAdd; michael@0: typedef SkAdd INHERITED; michael@0: }; michael@0: michael@0: class SkReplace : public SkAdd { michael@0: DECLARE_MEMBER_INFO(Replace); michael@0: private: michael@0: typedef SkAdd INHERITED; michael@0: }; michael@0: michael@0: #endif // SkDisplayAdd_DEFINED