epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2006 The Android Open Source Project |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 8 | #ifndef SkDisplayList_DEFINED |
| 9 | #define SkDisplayList_DEFINED |
| 10 | |
| 11 | #include "SkOperand.h" |
| 12 | #include "SkIntArray.h" |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 13 | #include "SkRect.h" |
reed | 868074b | 2014-06-03 10:53:59 -0700 | [diff] [blame] | 14 | #include "SkRefCnt.h" |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 15 | |
| 16 | class SkAnimateMaker; |
| 17 | class SkActive; |
| 18 | class SkApply; |
| 19 | class SkDrawable; |
| 20 | class SkGroup; |
| 21 | |
reed | 868074b | 2014-06-03 10:53:59 -0700 | [diff] [blame] | 22 | class SkDisplayList : public SkRefCnt { |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 23 | public: |
| 24 | SkDisplayList(); |
| 25 | virtual ~SkDisplayList(); |
| 26 | void append(SkActive* ); |
| 27 | void clear() { fDrawList.reset(); } |
| 28 | int count() { return fDrawList.count(); } |
| 29 | bool draw(SkAnimateMaker& , SkMSec time); |
| 30 | #ifdef SK_DUMP_ENABLED |
| 31 | void dump(SkAnimateMaker* maker); |
| 32 | void dumpInner(SkAnimateMaker* maker); |
| 33 | static int fIndent; |
| 34 | static int fDumpIndex; |
| 35 | #endif |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 36 | int findGroup(SkDrawable* match, SkTDDrawableArray** list, |
| 37 | SkGroup** parent, SkGroup** found, SkTDDrawableArray** grandList); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 38 | SkDrawable* get(int index) { return fDrawList[index]; } |
| 39 | SkMSec getTime() { return fInTime; } |
| 40 | SkTDDrawableArray* getDrawList() { return &fDrawList; } |
| 41 | void hardReset(); |
| 42 | virtual bool onIRect(const SkIRect& r); |
| 43 | void reset(); |
| 44 | void remove(SkActive* ); |
| 45 | #ifdef SK_DEBUG |
| 46 | void validate(); |
| 47 | #else |
| 48 | void validate() {} |
| 49 | #endif |
| 50 | static int SearchForMatch(SkDrawable* match, SkTDDrawableArray** list, |
| 51 | SkGroup** parent, SkGroup** found, SkTDDrawableArray**grandList); |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 52 | static bool SearchGroupForMatch(SkDrawable* draw, SkDrawable* match, |
| 53 | SkTDDrawableArray** list, SkGroup** parent, SkGroup** found, SkTDDrawableArray** grandList, |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 54 | int &index); |
| 55 | public: |
| 56 | SkIRect fBounds; |
| 57 | SkIRect fInvalBounds; |
| 58 | bool fDrawBounds; |
| 59 | bool fHasUnion; |
| 60 | bool fUnionBounds; |
| 61 | private: |
| 62 | SkTDDrawableArray fDrawList; |
| 63 | SkTDActiveArray fActiveList; |
| 64 | SkMSec fInTime; |
| 65 | friend class SkEvents; |
| 66 | }; |
| 67 | |
| 68 | #endif // SkDisplayList_DEFINED |