1ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com/*
2ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Copyright 2006 The Android Open Source Project
3ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com *
4ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Use of this source code is governed by a BSD-style license that can be
5ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * found in the LICENSE file.
6ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com */
7ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com
88a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#ifndef SkDisplayList_DEFINED
98a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#define SkDisplayList_DEFINED
108a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
118a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkOperand.h"
128a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkIntArray.h"
138a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkRect.h"
14868074b50b0fc3e460d2aa97c1096827fe0a1935reed#include "SkRefCnt.h"
158a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
168a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkAnimateMaker;
178a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkActive;
188a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkApply;
198a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkDrawable;
208a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkGroup;
218a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
22868074b50b0fc3e460d2aa97c1096827fe0a1935reedclass SkDisplayList : public SkRefCnt {
238a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.compublic:
248a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkDisplayList();
258a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual ~SkDisplayList();
268a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    void append(SkActive* );
278a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    void clear() { fDrawList.reset(); }
288a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    int count() { return fDrawList.count(); }
298a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    bool draw(SkAnimateMaker& , SkMSec time);
308a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#ifdef SK_DUMP_ENABLED
318a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    void dump(SkAnimateMaker* maker);
328a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    void dumpInner(SkAnimateMaker* maker);
338a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    static int fIndent;
348a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    static int fDumpIndex;
358a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif
36d6176b0dcacb124539e0cfd051e6d93a9782f020rmistry@google.com    int findGroup(SkDrawable* match, SkTDDrawableArray** list,
37d6176b0dcacb124539e0cfd051e6d93a9782f020rmistry@google.com        SkGroup** parent, SkGroup** found, SkTDDrawableArray** grandList);
388a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkDrawable* get(int index) { return fDrawList[index]; }
398a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkMSec getTime() { return fInTime; }
408a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkTDDrawableArray* getDrawList() { return &fDrawList; }
418a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    void hardReset();
428a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual bool onIRect(const SkIRect& r);
438a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    void reset();
448a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    void remove(SkActive* );
458a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#ifdef SK_DEBUG
468a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    void validate();
478a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#else
488a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    void validate() {}
498a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif
508a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    static int SearchForMatch(SkDrawable* match, SkTDDrawableArray** list,
518a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com        SkGroup** parent, SkGroup** found, SkTDDrawableArray**grandList);
52d6176b0dcacb124539e0cfd051e6d93a9782f020rmistry@google.com    static bool SearchGroupForMatch(SkDrawable* draw, SkDrawable* match,
53d6176b0dcacb124539e0cfd051e6d93a9782f020rmistry@google.com        SkTDDrawableArray** list, SkGroup** parent, SkGroup** found, SkTDDrawableArray** grandList,
548a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com        int &index);
558a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.compublic:
568a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkIRect fBounds;
578a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkIRect fInvalBounds;
588a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    bool fDrawBounds;
598a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    bool fHasUnion;
608a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    bool fUnionBounds;
618a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comprivate:
628a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkTDDrawableArray fDrawList;
638a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkTDActiveArray fActiveList;
648a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkMSec fInTime;
658a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    friend class SkEvents;
668a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com};
678a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
688a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif // SkDisplayList_DEFINED
69