RenderNode.h revision e4267ea4f20740c37c01bfb6aefcf61fddc4566a
1113e0824d6bddf4376240681f9cf6a2deded9498John Reck/*
2113e0824d6bddf4376240681f9cf6a2deded9498John Reck * Copyright (C) 2014 The Android Open Source Project
3113e0824d6bddf4376240681f9cf6a2deded9498John Reck *
4113e0824d6bddf4376240681f9cf6a2deded9498John Reck * Licensed under the Apache License, Version 2.0 (the "License");
5113e0824d6bddf4376240681f9cf6a2deded9498John Reck * you may not use this file except in compliance with the License.
6113e0824d6bddf4376240681f9cf6a2deded9498John Reck * You may obtain a copy of the License at
7113e0824d6bddf4376240681f9cf6a2deded9498John Reck *
8113e0824d6bddf4376240681f9cf6a2deded9498John Reck *      http://www.apache.org/licenses/LICENSE-2.0
9113e0824d6bddf4376240681f9cf6a2deded9498John Reck *
10113e0824d6bddf4376240681f9cf6a2deded9498John Reck * Unless required by applicable law or agreed to in writing, software
11113e0824d6bddf4376240681f9cf6a2deded9498John Reck * distributed under the License is distributed on an "AS IS" BASIS,
12113e0824d6bddf4376240681f9cf6a2deded9498John Reck * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13113e0824d6bddf4376240681f9cf6a2deded9498John Reck * See the License for the specific language governing permissions and
14113e0824d6bddf4376240681f9cf6a2deded9498John Reck * limitations under the License.
15113e0824d6bddf4376240681f9cf6a2deded9498John Reck */
16113e0824d6bddf4376240681f9cf6a2deded9498John Reck#ifndef RENDERNODE_H
17113e0824d6bddf4376240681f9cf6a2deded9498John Reck#define RENDERNODE_H
18113e0824d6bddf4376240681f9cf6a2deded9498John Reck
19113e0824d6bddf4376240681f9cf6a2deded9498John Reck#ifndef LOG_TAG
20113e0824d6bddf4376240681f9cf6a2deded9498John Reck    #define LOG_TAG "OpenGLRenderer"
21113e0824d6bddf4376240681f9cf6a2deded9498John Reck#endif
22113e0824d6bddf4376240681f9cf6a2deded9498John Reck
23e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck#include <set>
24e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck#include <vector>
25e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck
26113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include <SkCamera.h>
27113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include <SkMatrix.h>
28113e0824d6bddf4376240681f9cf6a2deded9498John Reck
29113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include <private/hwui/DrawGlInfo.h>
30113e0824d6bddf4376240681f9cf6a2deded9498John Reck
31113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include <utils/KeyedVector.h>
32113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include <utils/LinearAllocator.h>
33113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include <utils/RefBase.h>
34113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include <utils/SortedVector.h>
35113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include <utils/String8.h>
36113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include <utils/Vector.h>
37113e0824d6bddf4376240681f9cf6a2deded9498John Reck
38113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include <cutils/compiler.h>
39113e0824d6bddf4376240681f9cf6a2deded9498John Reck
40113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include <androidfw/ResourceTypes.h>
41113e0824d6bddf4376240681f9cf6a2deded9498John Reck
42113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include "Debug.h"
43113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include "Matrix.h"
44113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include "DeferredDisplayList.h"
45113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include "DisplayList.h"
46113e0824d6bddf4376240681f9cf6a2deded9498John Reck#include "RenderProperties.h"
47e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck#include "TreeInfo.h"
48113e0824d6bddf4376240681f9cf6a2deded9498John Reck
49113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass SkBitmap;
50113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass SkPaint;
51113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass SkPath;
52113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass SkRegion;
53113e0824d6bddf4376240681f9cf6a2deded9498John Reck
54113e0824d6bddf4376240681f9cf6a2deded9498John Recknamespace android {
55113e0824d6bddf4376240681f9cf6a2deded9498John Recknamespace uirenderer {
56113e0824d6bddf4376240681f9cf6a2deded9498John Reck
57113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass DeferredDisplayList;
58113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass DisplayListOp;
59113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass DisplayListRenderer;
60113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass OpenGLRenderer;
61113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass Rect;
62113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass Layer;
63113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass SkiaShader;
64113e0824d6bddf4376240681f9cf6a2deded9498John Reck
65113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass ClipRectOp;
66113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass SaveLayerOp;
67113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass SaveOp;
68113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass RestoreToCountOp;
69113e0824d6bddf4376240681f9cf6a2deded9498John Reckclass DrawDisplayListOp;
70113e0824d6bddf4376240681f9cf6a2deded9498John Reck
71113e0824d6bddf4376240681f9cf6a2deded9498John Reck/**
72113e0824d6bddf4376240681f9cf6a2deded9498John Reck * Primary class for storing recorded canvas commands, as well as per-View/ViewGroup display properties.
73113e0824d6bddf4376240681f9cf6a2deded9498John Reck *
74113e0824d6bddf4376240681f9cf6a2deded9498John Reck * Recording of canvas commands is somewhat similar to SkPicture, except the canvas-recording
75113e0824d6bddf4376240681f9cf6a2deded9498John Reck * functionality is split between DisplayListRenderer (which manages the recording), DisplayListData
76113e0824d6bddf4376240681f9cf6a2deded9498John Reck * (which holds the actual data), and DisplayList (which holds properties and performs playback onto
77113e0824d6bddf4376240681f9cf6a2deded9498John Reck * a renderer).
78113e0824d6bddf4376240681f9cf6a2deded9498John Reck *
79113e0824d6bddf4376240681f9cf6a2deded9498John Reck * Note that DisplayListData is swapped out from beneath an individual DisplayList when a view's
80113e0824d6bddf4376240681f9cf6a2deded9498John Reck * recorded stream of canvas operations is refreshed. The DisplayList (and its properties) stay
81113e0824d6bddf4376240681f9cf6a2deded9498John Reck * attached.
82113e0824d6bddf4376240681f9cf6a2deded9498John Reck */
83087bc0c14bdccf7c258dce0cdef46a69a839b427John Reckclass RenderNode : public VirtualLightRefBase {
84113e0824d6bddf4376240681f9cf6a2deded9498John Reckpublic:
85ff941dcd815021bb20d6504eb486acb1e50592c3John Reck    enum DirtyPropertyMask {
86ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        GENERIC         = 1 << 1,
87ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        TRANSLATION_X   = 1 << 2,
88ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        TRANSLATION_Y   = 1 << 3,
89ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        TRANSLATION_Z   = 1 << 4,
90ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        SCALE_X         = 1 << 5,
91ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        SCALE_Y         = 1 << 6,
92ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        ROTATION        = 1 << 7,
93ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        ROTATION_X      = 1 << 8,
94ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        ROTATION_Y      = 1 << 9,
95ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        X               = 1 << 10,
96ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        Y               = 1 << 11,
97ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        Z               = 1 << 12,
98ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        ALPHA           = 1 << 13,
99ff941dcd815021bb20d6504eb486acb1e50592c3John Reck    };
100ff941dcd815021bb20d6504eb486acb1e50592c3John Reck
101113e0824d6bddf4376240681f9cf6a2deded9498John Reck    ANDROID_API RenderNode();
102e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    ANDROID_API virtual ~RenderNode();
103113e0824d6bddf4376240681f9cf6a2deded9498John Reck
104113e0824d6bddf4376240681f9cf6a2deded9498John Reck    // See flags defined in DisplayList.java
105113e0824d6bddf4376240681f9cf6a2deded9498John Reck    enum ReplayFlag {
106113e0824d6bddf4376240681f9cf6a2deded9498John Reck        kReplayFlag_ClipChildren = 0x1
107113e0824d6bddf4376240681f9cf6a2deded9498John Reck    };
108113e0824d6bddf4376240681f9cf6a2deded9498John Reck
109113e0824d6bddf4376240681f9cf6a2deded9498John Reck    ANDROID_API static void outputLogBuffer(int fd);
110113e0824d6bddf4376240681f9cf6a2deded9498John Reck
1118de65a8e05285df52a1e6f0c1d5616dd233298a7John Reck    ANDROID_API void setStagingDisplayList(DisplayListData* newData);
112113e0824d6bddf4376240681f9cf6a2deded9498John Reck
113113e0824d6bddf4376240681f9cf6a2deded9498John Reck    void computeOrdering();
114b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik
115b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik    void deferNodeTree(DeferStateStruct& deferStruct);
116b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik    void deferNodeInParent(DeferStateStruct& deferStruct, const int level);
117b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik
118b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik    void replayNodeTree(ReplayStateStruct& replayStruct);
119b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik    void replayNodeInParent(ReplayStateStruct& replayStruct, const int level);
120113e0824d6bddf4376240681f9cf6a2deded9498John Reck
121113e0824d6bddf4376240681f9cf6a2deded9498John Reck    ANDROID_API void output(uint32_t level = 1);
122fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck    ANDROID_API int getDebugSize();
123113e0824d6bddf4376240681f9cf6a2deded9498John Reck
124113e0824d6bddf4376240681f9cf6a2deded9498John Reck    bool isRenderable() const {
125113e0824d6bddf4376240681f9cf6a2deded9498John Reck        return mDisplayListData && mDisplayListData->hasDrawOps;
126113e0824d6bddf4376240681f9cf6a2deded9498John Reck    }
127113e0824d6bddf4376240681f9cf6a2deded9498John Reck
128defb7f37fe67ef2389666f7adc5da1260df87017Chris Craik    const char* getName() const {
129defb7f37fe67ef2389666f7adc5da1260df87017Chris Craik        return mName.string();
130defb7f37fe67ef2389666f7adc5da1260df87017Chris Craik    }
131defb7f37fe67ef2389666f7adc5da1260df87017Chris Craik
132113e0824d6bddf4376240681f9cf6a2deded9498John Reck    void setName(const char* name) {
133113e0824d6bddf4376240681f9cf6a2deded9498John Reck        if (name) {
134113e0824d6bddf4376240681f9cf6a2deded9498John Reck            char* lastPeriod = strrchr(name, '.');
135113e0824d6bddf4376240681f9cf6a2deded9498John Reck            if (lastPeriod) {
136113e0824d6bddf4376240681f9cf6a2deded9498John Reck                mName.setTo(lastPeriod + 1);
137113e0824d6bddf4376240681f9cf6a2deded9498John Reck            } else {
138113e0824d6bddf4376240681f9cf6a2deded9498John Reck                mName.setTo(name);
139113e0824d6bddf4376240681f9cf6a2deded9498John Reck            }
140113e0824d6bddf4376240681f9cf6a2deded9498John Reck        }
141113e0824d6bddf4376240681f9cf6a2deded9498John Reck    }
142113e0824d6bddf4376240681f9cf6a2deded9498John Reck
143ff941dcd815021bb20d6504eb486acb1e50592c3John Reck    bool isPropertyFieldDirty(DirtyPropertyMask field) const {
144ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        return mDirtyPropertyFields & field;
145ff941dcd815021bb20d6504eb486acb1e50592c3John Reck    }
146ff941dcd815021bb20d6504eb486acb1e50592c3John Reck
147ff941dcd815021bb20d6504eb486acb1e50592c3John Reck    void setPropertyFieldsDirty(uint32_t fields) {
148ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        mDirtyPropertyFields |= fields;
149ff941dcd815021bb20d6504eb486acb1e50592c3John Reck    }
150ff941dcd815021bb20d6504eb486acb1e50592c3John Reck
151e4267ea4f20740c37c01bfb6aefcf61fddc4566aJohn Reck    const RenderProperties& properties() const {
152113e0824d6bddf4376240681f9cf6a2deded9498John Reck        return mProperties;
153113e0824d6bddf4376240681f9cf6a2deded9498John Reck    }
154113e0824d6bddf4376240681f9cf6a2deded9498John Reck
15552244fff29042926e21fa897ef5ab11148e35299John Reck    RenderProperties& animatorProperties() {
15652244fff29042926e21fa897ef5ab11148e35299John Reck        return mProperties;
15752244fff29042926e21fa897ef5ab11148e35299John Reck    }
15852244fff29042926e21fa897ef5ab11148e35299John Reck
159d0a0b2a3140bfb1819a116413ce9d81886697a07John Reck    const RenderProperties& stagingProperties() {
160d0a0b2a3140bfb1819a116413ce9d81886697a07John Reck        return mStagingProperties;
161d0a0b2a3140bfb1819a116413ce9d81886697a07John Reck    }
162d0a0b2a3140bfb1819a116413ce9d81886697a07John Reck
163d0a0b2a3140bfb1819a116413ce9d81886697a07John Reck    RenderProperties& mutateStagingProperties() {
164d0a0b2a3140bfb1819a116413ce9d81886697a07John Reck        return mStagingProperties;
165d0a0b2a3140bfb1819a116413ce9d81886697a07John Reck    }
166d0a0b2a3140bfb1819a116413ce9d81886697a07John Reck
167113e0824d6bddf4376240681f9cf6a2deded9498John Reck    int getWidth() {
168113e0824d6bddf4376240681f9cf6a2deded9498John Reck        return properties().getWidth();
169113e0824d6bddf4376240681f9cf6a2deded9498John Reck    }
170113e0824d6bddf4376240681f9cf6a2deded9498John Reck
171113e0824d6bddf4376240681f9cf6a2deded9498John Reck    int getHeight() {
172113e0824d6bddf4376240681f9cf6a2deded9498John Reck        return properties().getHeight();
173113e0824d6bddf4376240681f9cf6a2deded9498John Reck    }
174113e0824d6bddf4376240681f9cf6a2deded9498John Reck
175e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    ANDROID_API virtual void prepareTree(TreeInfo& info);
176e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck
177e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    // UI thread only!
17852244fff29042926e21fa897ef5ab11148e35299John Reck    ANDROID_API void addAnimator(const sp<BaseRenderNodeAnimator>& animator) {
179ff941dcd815021bb20d6504eb486acb1e50592c3John Reck        animator->onAttached(this);
180e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck        mStagingAnimators.insert(animator);
181e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck        mNeedsAnimatorsSync = true;
182e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    }
183e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck
184e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    // UI thread only!
18552244fff29042926e21fa897ef5ab11148e35299John Reck    ANDROID_API void removeAnimator(const sp<BaseRenderNodeAnimator>& animator) {
186e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck        mStagingAnimators.erase(animator);
187e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck        mNeedsAnimatorsSync = true;
188e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    }
189668f0e38ef0277d55d3118af37e17b8c435df85cJohn Reck
190e4267ea4f20740c37c01bfb6aefcf61fddc4566aJohn Reckprotected:
191e4267ea4f20740c37c01bfb6aefcf61fddc4566aJohn Reck    virtual void damageSelf(TreeInfo& info);
192e4267ea4f20740c37c01bfb6aefcf61fddc4566aJohn Reck
193113e0824d6bddf4376240681f9cf6a2deded9498John Reckprivate:
194113e0824d6bddf4376240681f9cf6a2deded9498John Reck    typedef key_value_pair_t<float, DrawDisplayListOp*> ZDrawDisplayListOpPair;
195113e0824d6bddf4376240681f9cf6a2deded9498John Reck
196113e0824d6bddf4376240681f9cf6a2deded9498John Reck    static size_t findNonNegativeIndex(const Vector<ZDrawDisplayListOpPair>& nodes) {
197113e0824d6bddf4376240681f9cf6a2deded9498John Reck        for (size_t i = 0; i < nodes.size(); i++) {
198113e0824d6bddf4376240681f9cf6a2deded9498John Reck            if (nodes[i].key >= 0.0f) return i;
199113e0824d6bddf4376240681f9cf6a2deded9498John Reck        }
200113e0824d6bddf4376240681f9cf6a2deded9498John Reck        return nodes.size();
201113e0824d6bddf4376240681f9cf6a2deded9498John Reck    }
202113e0824d6bddf4376240681f9cf6a2deded9498John Reck
203113e0824d6bddf4376240681f9cf6a2deded9498John Reck    enum ChildrenSelectMode {
204113e0824d6bddf4376240681f9cf6a2deded9498John Reck        kNegativeZChildren,
205113e0824d6bddf4376240681f9cf6a2deded9498John Reck        kPositiveZChildren
206113e0824d6bddf4376240681f9cf6a2deded9498John Reck    };
207113e0824d6bddf4376240681f9cf6a2deded9498John Reck
208113e0824d6bddf4376240681f9cf6a2deded9498John Reck    void applyViewPropertyTransforms(mat4& matrix, bool true3dTransform = false);
209113e0824d6bddf4376240681f9cf6a2deded9498John Reck
210113e0824d6bddf4376240681f9cf6a2deded9498John Reck    void computeOrderingImpl(DrawDisplayListOp* opState,
2113f085429fd47ebd32ac2463b3eae2a5a6c17be25Chris Craik            const SkPath* outlineOfProjectionSurface,
212113e0824d6bddf4376240681f9cf6a2deded9498John Reck            Vector<DrawDisplayListOp*>* compositedChildrenOfProjectionSurface,
213113e0824d6bddf4376240681f9cf6a2deded9498John Reck            const mat4* transformFromProjectionSurface);
214113e0824d6bddf4376240681f9cf6a2deded9498John Reck
215113e0824d6bddf4376240681f9cf6a2deded9498John Reck    template <class T>
216b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik    inline void setViewProperties(OpenGLRenderer& renderer, T& handler);
217113e0824d6bddf4376240681f9cf6a2deded9498John Reck
218113e0824d6bddf4376240681f9cf6a2deded9498John Reck    void buildZSortedChildList(Vector<ZDrawDisplayListOpPair>& zTranslatedNodes);
219113e0824d6bddf4376240681f9cf6a2deded9498John Reck
220b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik    template<class T>
221b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik    inline void issueDrawShadowOperation(const Matrix4& transformFromParent, T& handler);
222b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik
223113e0824d6bddf4376240681f9cf6a2deded9498John Reck    template <class T>
224b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik    inline void issueOperationsOf3dChildren(const Vector<ZDrawDisplayListOpPair>& zTranslatedNodes,
225113e0824d6bddf4376240681f9cf6a2deded9498John Reck            ChildrenSelectMode mode, OpenGLRenderer& renderer, T& handler);
226113e0824d6bddf4376240681f9cf6a2deded9498John Reck
227113e0824d6bddf4376240681f9cf6a2deded9498John Reck    template <class T>
228b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik    inline void issueOperationsOfProjectedChildren(OpenGLRenderer& renderer, T& handler);
229113e0824d6bddf4376240681f9cf6a2deded9498John Reck
230b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik    /**
231b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik     * Issue the RenderNode's operations into a handler, recursing for subtrees through
232b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik     * DrawDisplayListOp's defer() or replay() methods
233b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik     */
234113e0824d6bddf4376240681f9cf6a2deded9498John Reck    template <class T>
235b265e2ca50b6ceb2fd2987ef1f7d063b1bde19aeChris Craik    inline void issueOperations(OpenGLRenderer& renderer, T& handler);
236113e0824d6bddf4376240681f9cf6a2deded9498John Reck
237113e0824d6bddf4376240681f9cf6a2deded9498John Reck    class TextContainer {
238113e0824d6bddf4376240681f9cf6a2deded9498John Reck    public:
239113e0824d6bddf4376240681f9cf6a2deded9498John Reck        size_t length() const {
240113e0824d6bddf4376240681f9cf6a2deded9498John Reck            return mByteLength;
241113e0824d6bddf4376240681f9cf6a2deded9498John Reck        }
242113e0824d6bddf4376240681f9cf6a2deded9498John Reck
243113e0824d6bddf4376240681f9cf6a2deded9498John Reck        const char* text() const {
244113e0824d6bddf4376240681f9cf6a2deded9498John Reck            return (const char*) mText;
245113e0824d6bddf4376240681f9cf6a2deded9498John Reck        }
246113e0824d6bddf4376240681f9cf6a2deded9498John Reck
247113e0824d6bddf4376240681f9cf6a2deded9498John Reck        size_t mByteLength;
248113e0824d6bddf4376240681f9cf6a2deded9498John Reck        const char* mText;
249113e0824d6bddf4376240681f9cf6a2deded9498John Reck    };
250113e0824d6bddf4376240681f9cf6a2deded9498John Reck
251f4198b713e43c0c0f9adac74203cf24c2a49b802John Reck    void prepareTreeImpl(TreeInfo& info);
252f4198b713e43c0c0f9adac74203cf24c2a49b802John Reck    void pushStagingChanges(TreeInfo& info);
253e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    void evaluateAnimations(TreeInfo& info);
254f4198b713e43c0c0f9adac74203cf24c2a49b802John Reck    void prepareSubTree(TreeInfo& info, DisplayListData* subtree);
2558de65a8e05285df52a1e6f0c1d5616dd233298a7John Reck
256113e0824d6bddf4376240681f9cf6a2deded9498John Reck    String8 mName;
257113e0824d6bddf4376240681f9cf6a2deded9498John Reck
258ff941dcd815021bb20d6504eb486acb1e50592c3John Reck    uint32_t mDirtyPropertyFields;
259113e0824d6bddf4376240681f9cf6a2deded9498John Reck    RenderProperties mProperties;
260d0a0b2a3140bfb1819a116413ce9d81886697a07John Reck    RenderProperties mStagingProperties;
261d0a0b2a3140bfb1819a116413ce9d81886697a07John Reck
2628de65a8e05285df52a1e6f0c1d5616dd233298a7John Reck    bool mNeedsDisplayListDataSync;
263113e0824d6bddf4376240681f9cf6a2deded9498John Reck    DisplayListData* mDisplayListData;
2648de65a8e05285df52a1e6f0c1d5616dd233298a7John Reck    DisplayListData* mStagingDisplayListData;
265113e0824d6bddf4376240681f9cf6a2deded9498John Reck
266e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    bool mNeedsAnimatorsSync;
26752244fff29042926e21fa897ef5ab11148e35299John Reck    std::set< sp<BaseRenderNodeAnimator> > mStagingAnimators;
26852244fff29042926e21fa897ef5ab11148e35299John Reck    std::vector< sp<BaseRenderNodeAnimator> > mAnimators;
269e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck
270113e0824d6bddf4376240681f9cf6a2deded9498John Reck    /**
271113e0824d6bddf4376240681f9cf6a2deded9498John Reck     * Draw time state - these properties are only set and used during rendering
272113e0824d6bddf4376240681f9cf6a2deded9498John Reck     */
273113e0824d6bddf4376240681f9cf6a2deded9498John Reck
274113e0824d6bddf4376240681f9cf6a2deded9498John Reck    // for projection surfaces, contains a list of all children items
275113e0824d6bddf4376240681f9cf6a2deded9498John Reck    Vector<DrawDisplayListOp*> mProjectedNodes;
276113e0824d6bddf4376240681f9cf6a2deded9498John Reck}; // class RenderNode
277113e0824d6bddf4376240681f9cf6a2deded9498John Reck
278113e0824d6bddf4376240681f9cf6a2deded9498John Reck} /* namespace uirenderer */
279113e0824d6bddf4376240681f9cf6a2deded9498John Reck} /* namespace android */
280113e0824d6bddf4376240681f9cf6a2deded9498John Reck
281113e0824d6bddf4376240681f9cf6a2deded9498John Reck#endif /* RENDERNODE_H */
282