blob: 0f3edc92bcda51cb69228875f5ffb1e9e5330dc8 [file] [log] [blame]
reed@android.com8a1c16f2008-12-17 15:59:43 +00001/* libs/graphics/animator/SkDisplayAdd.h
2**
3** Copyright 2006, The Android Open Source Project
4**
5** Licensed under the Apache License, Version 2.0 (the "License");
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
8**
9** http://www.apache.org/licenses/LICENSE-2.0
10**
11** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
15** limitations under the License.
16*/
17
18#ifndef SkDisplayAdd_DEFINED
19#define SkDisplayAdd_DEFINED
20
21#include "SkDrawable.h"
22#include "SkMemberInfo.h"
23
24class SkAdd : public SkDrawable {
25 DECLARE_MEMBER_INFO(Add);
26 SkAdd();
27
28 enum Mode {
29 kMode_indirect,
30 kMode_immediate
31 };
32
33 virtual SkDisplayable* deepCopy(SkAnimateMaker* );
34 virtual bool draw(SkAnimateMaker& );
35#ifdef SK_DUMP_ENABLED
36 virtual void dump(SkAnimateMaker* );
37#endif
38 virtual bool enable(SkAnimateMaker& );
39 virtual bool hasEnable() const;
40 virtual void initialize();
41 virtual bool isDrawable() const;
42protected:
43// struct _A {
44 Mode mode;
45 int32_t offset;
46 SkDrawable* use;
47 SkDrawable* where; // if NULL, offset becomes index
48// } A;
49private:
50 typedef SkDrawable INHERITED;
51};
52
53class SkClear : public SkDisplayable {
54 virtual bool enable(SkAnimateMaker& );
55};
56
57class SkMove : public SkAdd {
58 DECLARE_MEMBER_INFO(Move);
59private:
60 typedef SkAdd INHERITED;
61};
62
63class SkRemove : public SkAdd {
64 DECLARE_MEMBER_INFO(Remove);
65 SkRemove();
66protected:
67 SkBool fDelete;
68private:
69 friend class SkAdd;
70 typedef SkAdd INHERITED;
71};
72
73class SkReplace : public SkAdd {
74 DECLARE_MEMBER_INFO(Replace);
75private:
76 typedef SkAdd INHERITED;
77};
78
79#endif // SkDisplayAdd_DEFINED
80
81