blob: a856413def34f416c63ffa57e35733ef814ed5a4 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001/*
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.com8a1c16f2008-12-17 15:59:43 +00008#ifndef SkDisplayList_DEFINED
9#define SkDisplayList_DEFINED
10
11#include "SkOperand.h"
12#include "SkIntArray.h"
reed@android.com8a1c16f2008-12-17 15:59:43 +000013#include "SkRect.h"
reed868074b2014-06-03 10:53:59 -070014#include "SkRefCnt.h"
reed@android.com8a1c16f2008-12-17 15:59:43 +000015
16class SkAnimateMaker;
17class SkActive;
18class SkApply;
19class SkDrawable;
20class SkGroup;
21
reed868074b2014-06-03 10:53:59 -070022class SkDisplayList : public SkRefCnt {
reed@android.com8a1c16f2008-12-17 15:59:43 +000023public:
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.comd6176b02012-08-23 18:14:13 +000036 int findGroup(SkDrawable* match, SkTDDrawableArray** list,
37 SkGroup** parent, SkGroup** found, SkTDDrawableArray** grandList);
reed@android.com8a1c16f2008-12-17 15:59:43 +000038 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.comd6176b02012-08-23 18:14:13 +000052 static bool SearchGroupForMatch(SkDrawable* draw, SkDrawable* match,
53 SkTDDrawableArray** list, SkGroup** parent, SkGroup** found, SkTDDrawableArray** grandList,
reed@android.com8a1c16f2008-12-17 15:59:43 +000054 int &index);
55public:
56 SkIRect fBounds;
57 SkIRect fInvalBounds;
58 bool fDrawBounds;
59 bool fHasUnion;
60 bool fUnionBounds;
61private:
62 SkTDDrawableArray fDrawList;
63 SkTDActiveArray fActiveList;
64 SkMSec fInTime;
65 friend class SkEvents;
66};
67
68#endif // SkDisplayList_DEFINED