Home | History | Annotate | Download | only in animator
      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 SkDisplayList_DEFINED
     11 #define SkDisplayList_DEFINED
     12 
     13 #include "SkOperand.h"
     14 #include "SkIntArray.h"
     15 #include "SkBounder.h"
     16 #include "SkRect.h"
     17 
     18 class SkAnimateMaker;
     19 class SkActive;
     20 class SkApply;
     21 class SkDrawable;
     22 class SkGroup;
     23 
     24 class SkDisplayList : public SkBounder {
     25 public:
     26     SkDisplayList();
     27     virtual ~SkDisplayList();
     28     void append(SkActive* );
     29     void clear() { fDrawList.reset(); }
     30     int count() { return fDrawList.count(); }
     31     bool draw(SkAnimateMaker& , SkMSec time);
     32 #ifdef SK_DUMP_ENABLED
     33     void dump(SkAnimateMaker* maker);
     34     void dumpInner(SkAnimateMaker* maker);
     35     static int fIndent;
     36     static int fDumpIndex;
     37 #endif
     38     int findGroup(SkDrawable* match, SkTDDrawableArray** list,
     39         SkGroup** parent, SkGroup** found, SkTDDrawableArray** grandList);
     40     SkDrawable* get(int index) { return fDrawList[index]; }
     41     SkMSec getTime() { return fInTime; }
     42     SkTDDrawableArray* getDrawList() { return &fDrawList; }
     43     void hardReset();
     44     virtual bool onIRect(const SkIRect& r);
     45     void reset();
     46     void remove(SkActive* );
     47 #ifdef SK_DEBUG
     48     void validate();
     49 #else
     50     void validate() {}
     51 #endif
     52     static int SearchForMatch(SkDrawable* match, SkTDDrawableArray** list,
     53         SkGroup** parent, SkGroup** found, SkTDDrawableArray**grandList);
     54     static bool SearchGroupForMatch(SkDrawable* draw, SkDrawable* match,
     55         SkTDDrawableArray** list, SkGroup** parent, SkGroup** found, SkTDDrawableArray** grandList,
     56         int &index);
     57 public:
     58     SkIRect fBounds;
     59     SkIRect fInvalBounds;
     60     bool fDrawBounds;
     61     bool fHasUnion;
     62     bool fUnionBounds;
     63 private:
     64     SkTDDrawableArray fDrawList;
     65     SkTDActiveArray fActiveList;
     66     SkMSec fInTime;
     67     friend class SkEvents;
     68 };
     69 
     70 #endif // SkDisplayList_DEFINED
     71