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