blob: 5399185e6e44c0568946a519d9b8eb74e7ff48da [file] [log] [blame]
Chris Craik0776a602013-02-14 15:36:01 -08001/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_HWUI_DISPLAY_LIST_H
18#define ANDROID_HWUI_DISPLAY_LIST_H
19
Romain Guy7031ff62013-02-22 11:48:16 -080020#ifndef LOG_TAG
21 #define LOG_TAG "OpenGLRenderer"
22#endif
23
Chris Craik0776a602013-02-14 15:36:01 -080024#include <SkCamera.h>
25#include <SkMatrix.h>
26
Chris Craikff785832013-03-08 13:12:16 -080027#include <private/hwui/DrawGlInfo.h>
28
Chris Craikf57776b2013-10-25 18:30:17 -070029#include <utils/KeyedVector.h>
Chris Craikc1c5f082013-09-11 16:23:37 -070030#include <utils/LinearAllocator.h>
Chris Craik0776a602013-02-14 15:36:01 -080031#include <utils/RefBase.h>
32#include <utils/SortedVector.h>
33#include <utils/String8.h>
34#include <utils/Vector.h>
Romain Guye3b0a012013-06-26 15:45:41 -070035
Chris Craik0776a602013-02-14 15:36:01 -080036#include <cutils/compiler.h>
37
Romain Guye3b0a012013-06-26 15:45:41 -070038#include <androidfw/ResourceTypes.h>
39
Chris Craik0776a602013-02-14 15:36:01 -080040#include "Debug.h"
Chris Craikf57776b2013-10-25 18:30:17 -070041#include "Matrix.h"
42#include "DeferredDisplayList.h"
Chris Craik0776a602013-02-14 15:36:01 -080043
44#define TRANSLATION 0x0001
45#define ROTATION 0x0002
46#define ROTATION_3D 0x0004
47#define SCALE 0x0008
48#define PIVOT 0x0010
49
50class SkBitmap;
51class SkPaint;
52class SkPath;
53class SkRegion;
54
55namespace android {
56namespace uirenderer {
57
Chris Craikc3566d02013-02-04 16:16:33 -080058class DeferredDisplayList;
Chris Craik0776a602013-02-14 15:36:01 -080059class DisplayListOp;
60class DisplayListRenderer;
61class OpenGLRenderer;
62class Rect;
63class Layer;
64class SkiaColorFilter;
65class SkiaShader;
66
Chris Craikff785832013-03-08 13:12:16 -080067class ClipRectOp;
68class SaveLayerOp;
69class SaveOp;
70class RestoreToCountOp;
Chris Craikf57776b2013-10-25 18:30:17 -070071class DrawDisplayListOp;
Chris Craikff785832013-03-08 13:12:16 -080072
Chris Craikf57776b2013-10-25 18:30:17 -070073/**
74 * Holds data used in the playback a tree of DisplayLists.
75 */
76class PlaybackStateStruct {
77protected:
78 PlaybackStateStruct(OpenGLRenderer& renderer, int replayFlags, LinearAllocator* allocator)
79 : mRenderer(renderer), mReplayFlags(replayFlags), mAllocator(allocator){}
80
81public:
Chris Craikff785832013-03-08 13:12:16 -080082 OpenGLRenderer& mRenderer;
83 const int mReplayFlags;
Chris Craikf57776b2013-10-25 18:30:17 -070084
85 // Allocator with the lifetime of a single frame.
86 // replay uses an Allocator owned by the struct, while defer shares the DeferredDisplayList's Allocator
87 LinearAllocator * const mAllocator;
Chris Craikff785832013-03-08 13:12:16 -080088};
89
Chris Craikf57776b2013-10-25 18:30:17 -070090class DeferStateStruct : public PlaybackStateStruct {
91public:
92 DeferStateStruct(DeferredDisplayList& deferredList, OpenGLRenderer& renderer, int replayFlags)
Chris Craik9f68c092014-01-10 10:30:57 -080093 : PlaybackStateStruct(renderer, replayFlags, &(deferredList.mAllocator)),
94 mDeferredList(deferredList) {}
Chris Craikf57776b2013-10-25 18:30:17 -070095
96 DeferredDisplayList& mDeferredList;
97};
98
99class ReplayStateStruct : public PlaybackStateStruct {
100public:
Chris Craikff785832013-03-08 13:12:16 -0800101 ReplayStateStruct(OpenGLRenderer& renderer, Rect& dirty, int replayFlags)
Chris Craikf57776b2013-10-25 18:30:17 -0700102 : PlaybackStateStruct(renderer, replayFlags, &mReplayAllocator),
103 mDirty(dirty), mDrawGlStatus(DrawGlInfo::kStatusDone) {}
104
Chris Craikff785832013-03-08 13:12:16 -0800105 Rect& mDirty;
Chris Craikff785832013-03-08 13:12:16 -0800106 status_t mDrawGlStatus;
Chris Craikf57776b2013-10-25 18:30:17 -0700107 LinearAllocator mReplayAllocator;
Chris Craikff785832013-03-08 13:12:16 -0800108};
109
Chris Craik0776a602013-02-14 15:36:01 -0800110/**
Chris Craikf57776b2013-10-25 18:30:17 -0700111 * Refcounted structure that holds the list of commands used in display list stream.
Chris Craik0776a602013-02-14 15:36:01 -0800112 */
Chris Craikff785832013-03-08 13:12:16 -0800113class DisplayListData : public LightRefBase<DisplayListData> {
Chris Craik0776a602013-02-14 15:36:01 -0800114public:
Chris Craikf533e942014-01-14 22:35:37 -0800115 DisplayListData() : projectionIndex(-1) {}
Chris Craikf57776b2013-10-25 18:30:17 -0700116 // allocator into which all ops were allocated
Chris Craik0776a602013-02-14 15:36:01 -0800117 LinearAllocator allocator;
Chris Craikf57776b2013-10-25 18:30:17 -0700118
119 // pointers to all ops within display list, pointing into allocator data
Chris Craik0776a602013-02-14 15:36:01 -0800120 Vector<DisplayListOp*> displayListOps;
Chris Craikf57776b2013-10-25 18:30:17 -0700121
122 // list of children display lists for quick, non-drawing traversal
123 Vector<DrawDisplayListOp*> children;
Chris Craikf533e942014-01-14 22:35:37 -0800124
125 // index of DisplayListOp restore, after which projected descendents should be drawn
126 int projectionIndex;
127 Matrix4 projectionTransform;
Chris Craik0776a602013-02-14 15:36:01 -0800128};
129
130/**
Chris Craikf57776b2013-10-25 18:30:17 -0700131 * Primary class for storing recorded canvas commands, as well as per-View/ViewGroup display properties.
132 *
133 * Recording of canvas commands is somewhat similar to SkPicture, except the canvas-recording
134 * functionality is split between DisplayListRenderer (which manages the recording), DisplayListData
135 * (which holds the actual data), and DisplayList (which holds properties and performs playback onto
136 * a renderer).
137 *
138 * Note that DisplayListData is swapped out from beneath an individual DisplayList when a view's
139 * recorded stream of canvas operations is refreshed. The DisplayList (and its properties) stay
140 * attached.
Chris Craik0776a602013-02-14 15:36:01 -0800141 */
142class DisplayList {
143public:
144 DisplayList(const DisplayListRenderer& recorder);
145 ANDROID_API ~DisplayList();
146
147 // See flags defined in DisplayList.java
148 enum ReplayFlag {
149 kReplayFlag_ClipChildren = 0x1
150 };
151
Chris Craik0776a602013-02-14 15:36:01 -0800152 ANDROID_API size_t getSize();
153 ANDROID_API static void destroyDisplayListDeferred(DisplayList* displayList);
154 ANDROID_API static void outputLogBuffer(int fd);
155
156 void initFromDisplayListRenderer(const DisplayListRenderer& recorder, bool reusing = false);
157
Chris Craikf57776b2013-10-25 18:30:17 -0700158 void computeOrdering();
Chris Craikff785832013-03-08 13:12:16 -0800159 void defer(DeferStateStruct& deferStruct, const int level);
160 void replay(ReplayStateStruct& replayStruct, const int level);
Chris Craik0776a602013-02-14 15:36:01 -0800161
John Reck63049192013-12-10 15:22:01 -0800162 ANDROID_API void output(uint32_t level = 1);
Chris Craik0776a602013-02-14 15:36:01 -0800163
164 ANDROID_API void reset();
165
166 void setRenderable(bool renderable) {
167 mIsRenderable = renderable;
168 }
169
170 bool isRenderable() const {
171 return mIsRenderable;
172 }
173
174 void setName(const char* name) {
175 if (name) {
Romain Guy450dc752013-06-05 14:14:03 -0700176 char* lastPeriod = strrchr(name, '.');
177 if (lastPeriod) {
178 mName.setTo(lastPeriod + 1);
179 } else {
180 mName.setTo(name);
181 }
Chris Craik0776a602013-02-14 15:36:01 -0800182 }
183 }
184
Romain Guy52036b12013-02-14 18:03:37 -0800185 const char* getName() const {
186 return mName.string();
187 }
188
Chet Haasedd671592013-04-19 14:54:34 -0700189 void setClipToBounds(bool clipToBounds) {
190 mClipToBounds = clipToBounds;
Chris Craik0776a602013-02-14 15:36:01 -0800191 }
192
Chris Craikd863a102013-12-19 13:31:15 -0800193 void setIsContainedVolume(bool isContainedVolume) {
194 mIsContainedVolume = isContainedVolume;
195 }
196
Alan Viverette58f09b32014-01-08 17:18:19 -0800197 void setProjectToContainedVolume(bool shouldProject) {
198 mProjectToContainedVolume = shouldProject;
199 }
200
Chris Craik0776a602013-02-14 15:36:01 -0800201 void setStaticMatrix(SkMatrix* matrix) {
202 delete mStaticMatrix;
203 mStaticMatrix = new SkMatrix(*matrix);
204 }
205
Romain Guy52036b12013-02-14 18:03:37 -0800206 // Can return NULL
207 SkMatrix* getStaticMatrix() {
208 return mStaticMatrix;
209 }
210
Chris Craik0776a602013-02-14 15:36:01 -0800211 void setAnimationMatrix(SkMatrix* matrix) {
212 delete mAnimationMatrix;
213 if (matrix) {
214 mAnimationMatrix = new SkMatrix(*matrix);
215 } else {
216 mAnimationMatrix = NULL;
217 }
218 }
219
220 void setAlpha(float alpha) {
221 alpha = fminf(1.0f, fmaxf(0.0f, alpha));
222 if (alpha != mAlpha) {
223 mAlpha = alpha;
Chris Craik0776a602013-02-14 15:36:01 -0800224 }
225 }
226
Romain Guy52036b12013-02-14 18:03:37 -0800227 float getAlpha() const {
228 return mAlpha;
229 }
230
Chris Craik0776a602013-02-14 15:36:01 -0800231 void setHasOverlappingRendering(bool hasOverlappingRendering) {
232 mHasOverlappingRendering = hasOverlappingRendering;
233 }
234
Romain Guy52036b12013-02-14 18:03:37 -0800235 bool hasOverlappingRendering() const {
236 return mHasOverlappingRendering;
237 }
238
Chris Craik0776a602013-02-14 15:36:01 -0800239 void setTranslationX(float translationX) {
240 if (translationX != mTranslationX) {
241 mTranslationX = translationX;
Chris Craikf57776b2013-10-25 18:30:17 -0700242 onTranslationUpdate();
Chris Craik0776a602013-02-14 15:36:01 -0800243 }
244 }
245
Romain Guy52036b12013-02-14 18:03:37 -0800246 float getTranslationX() const {
247 return mTranslationX;
248 }
249
Chris Craik0776a602013-02-14 15:36:01 -0800250 void setTranslationY(float translationY) {
251 if (translationY != mTranslationY) {
252 mTranslationY = translationY;
Chris Craikf57776b2013-10-25 18:30:17 -0700253 onTranslationUpdate();
Chris Craik0776a602013-02-14 15:36:01 -0800254 }
255 }
256
Romain Guy52036b12013-02-14 18:03:37 -0800257 float getTranslationY() const {
258 return mTranslationY;
259 }
260
Chris Craikf57776b2013-10-25 18:30:17 -0700261 void setTranslationZ(float translationZ) {
262 if (translationZ != mTranslationZ) {
263 mTranslationZ = translationZ;
264 onTranslationUpdate();
265 }
266 }
267
268 float getTranslationZ() const {
269 return mTranslationZ;
270 }
271
Chris Craik0776a602013-02-14 15:36:01 -0800272 void setRotation(float rotation) {
273 if (rotation != mRotation) {
274 mRotation = rotation;
275 mMatrixDirty = true;
276 if (mRotation == 0.0f) {
277 mMatrixFlags &= ~ROTATION;
278 } else {
279 mMatrixFlags |= ROTATION;
280 }
281 }
282 }
283
Romain Guy52036b12013-02-14 18:03:37 -0800284 float getRotation() const {
285 return mRotation;
286 }
287
Chris Craik0776a602013-02-14 15:36:01 -0800288 void setRotationX(float rotationX) {
289 if (rotationX != mRotationX) {
290 mRotationX = rotationX;
291 mMatrixDirty = true;
292 if (mRotationX == 0.0f && mRotationY == 0.0f) {
293 mMatrixFlags &= ~ROTATION_3D;
294 } else {
295 mMatrixFlags |= ROTATION_3D;
296 }
297 }
298 }
299
Romain Guy52036b12013-02-14 18:03:37 -0800300 float getRotationX() const {
301 return mRotationX;
302 }
303
Chris Craik0776a602013-02-14 15:36:01 -0800304 void setRotationY(float rotationY) {
305 if (rotationY != mRotationY) {
306 mRotationY = rotationY;
307 mMatrixDirty = true;
308 if (mRotationX == 0.0f && mRotationY == 0.0f) {
309 mMatrixFlags &= ~ROTATION_3D;
310 } else {
311 mMatrixFlags |= ROTATION_3D;
312 }
313 }
314 }
315
Romain Guy52036b12013-02-14 18:03:37 -0800316 float getRotationY() const {
317 return mRotationY;
318 }
319
Chris Craik0776a602013-02-14 15:36:01 -0800320 void setScaleX(float scaleX) {
321 if (scaleX != mScaleX) {
322 mScaleX = scaleX;
323 mMatrixDirty = true;
324 if (mScaleX == 1.0f && mScaleY == 1.0f) {
325 mMatrixFlags &= ~SCALE;
326 } else {
327 mMatrixFlags |= SCALE;
328 }
329 }
330 }
331
Romain Guy52036b12013-02-14 18:03:37 -0800332 float getScaleX() const {
333 return mScaleX;
334 }
335
Chris Craik0776a602013-02-14 15:36:01 -0800336 void setScaleY(float scaleY) {
337 if (scaleY != mScaleY) {
338 mScaleY = scaleY;
339 mMatrixDirty = true;
340 if (mScaleX == 1.0f && mScaleY == 1.0f) {
341 mMatrixFlags &= ~SCALE;
342 } else {
343 mMatrixFlags |= SCALE;
344 }
345 }
346 }
347
Romain Guy52036b12013-02-14 18:03:37 -0800348 float getScaleY() const {
349 return mScaleY;
350 }
351
Chris Craik0776a602013-02-14 15:36:01 -0800352 void setPivotX(float pivotX) {
353 mPivotX = pivotX;
354 mMatrixDirty = true;
355 if (mPivotX == 0.0f && mPivotY == 0.0f) {
356 mMatrixFlags &= ~PIVOT;
357 } else {
358 mMatrixFlags |= PIVOT;
359 }
360 mPivotExplicitlySet = true;
361 }
362
Romain Guy52036b12013-02-14 18:03:37 -0800363 ANDROID_API float getPivotX();
364
Chris Craik0776a602013-02-14 15:36:01 -0800365 void setPivotY(float pivotY) {
366 mPivotY = pivotY;
367 mMatrixDirty = true;
368 if (mPivotX == 0.0f && mPivotY == 0.0f) {
369 mMatrixFlags &= ~PIVOT;
370 } else {
371 mMatrixFlags |= PIVOT;
372 }
373 mPivotExplicitlySet = true;
374 }
375
Romain Guy52036b12013-02-14 18:03:37 -0800376 ANDROID_API float getPivotY();
377
Chris Craik0776a602013-02-14 15:36:01 -0800378 void setCameraDistance(float distance) {
379 if (distance != mCameraDistance) {
380 mCameraDistance = distance;
381 mMatrixDirty = true;
382 if (!mTransformCamera) {
383 mTransformCamera = new Sk3DView();
384 mTransformMatrix3D = new SkMatrix();
385 }
386 mTransformCamera->setCameraLocation(0, 0, distance);
387 }
388 }
389
Romain Guy52036b12013-02-14 18:03:37 -0800390 float getCameraDistance() const {
391 return mCameraDistance;
392 }
393
Chris Craik0776a602013-02-14 15:36:01 -0800394 void setLeft(int left) {
395 if (left != mLeft) {
396 mLeft = left;
397 mWidth = mRight - mLeft;
398 if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
399 mMatrixDirty = true;
400 }
401 }
402 }
403
Romain Guy52036b12013-02-14 18:03:37 -0800404 float getLeft() const {
405 return mLeft;
406 }
407
Chris Craik0776a602013-02-14 15:36:01 -0800408 void setTop(int top) {
409 if (top != mTop) {
410 mTop = top;
411 mHeight = mBottom - mTop;
412 if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
413 mMatrixDirty = true;
414 }
415 }
416 }
417
Romain Guy52036b12013-02-14 18:03:37 -0800418 float getTop() const {
419 return mTop;
420 }
421
Chris Craik0776a602013-02-14 15:36:01 -0800422 void setRight(int right) {
423 if (right != mRight) {
424 mRight = right;
425 mWidth = mRight - mLeft;
426 if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
427 mMatrixDirty = true;
428 }
429 }
430 }
431
Romain Guy52036b12013-02-14 18:03:37 -0800432 float getRight() const {
433 return mRight;
434 }
435
Chris Craik0776a602013-02-14 15:36:01 -0800436 void setBottom(int bottom) {
437 if (bottom != mBottom) {
438 mBottom = bottom;
439 mHeight = mBottom - mTop;
440 if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
441 mMatrixDirty = true;
442 }
443 }
444 }
445
Romain Guy52036b12013-02-14 18:03:37 -0800446 float getBottom() const {
447 return mBottom;
448 }
449
Chris Craik0776a602013-02-14 15:36:01 -0800450 void setLeftTop(int left, int top) {
451 if (left != mLeft || top != mTop) {
452 mLeft = left;
453 mTop = top;
454 mWidth = mRight - mLeft;
455 mHeight = mBottom - mTop;
456 if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
457 mMatrixDirty = true;
458 }
459 }
460 }
461
462 void setLeftTopRightBottom(int left, int top, int right, int bottom) {
463 if (left != mLeft || top != mTop || right != mRight || bottom != mBottom) {
464 mLeft = left;
465 mTop = top;
466 mRight = right;
467 mBottom = bottom;
468 mWidth = mRight - mLeft;
469 mHeight = mBottom - mTop;
470 if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
471 mMatrixDirty = true;
472 }
473 }
474 }
475
Romain Guy52036b12013-02-14 18:03:37 -0800476 void offsetLeftRight(float offset) {
Chris Craik0776a602013-02-14 15:36:01 -0800477 if (offset != 0) {
478 mLeft += offset;
479 mRight += offset;
480 if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
481 mMatrixDirty = true;
482 }
483 }
484 }
485
Romain Guy52036b12013-02-14 18:03:37 -0800486 void offsetTopBottom(float offset) {
Chris Craik0776a602013-02-14 15:36:01 -0800487 if (offset != 0) {
488 mTop += offset;
489 mBottom += offset;
490 if (mMatrixFlags > TRANSLATION && !mPivotExplicitlySet) {
491 mMatrixDirty = true;
492 }
493 }
494 }
495
496 void setCaching(bool caching) {
497 mCaching = caching;
498 }
499
500 int getWidth() {
501 return mWidth;
502 }
503
504 int getHeight() {
505 return mHeight;
506 }
507
508private:
Chris Craik9f68c092014-01-10 10:30:57 -0800509 typedef key_value_pair_t<float, DrawDisplayListOp*> ZDrawDisplayListOpPair;
510
Chris Craikf57776b2013-10-25 18:30:17 -0700511 enum ChildrenSelectMode {
512 kNegativeZChildren,
513 kPositiveZChildren
514 };
515
516 void onTranslationUpdate() {
517 mMatrixDirty = true;
518 if (mTranslationX == 0.0f && mTranslationY == 0.0f && mTranslationZ == 0.0f) {
519 mMatrixFlags &= ~TRANSLATION;
520 } else {
521 mMatrixFlags |= TRANSLATION;
522 }
523 }
524
Chris Craikff785832013-03-08 13:12:16 -0800525 void outputViewProperties(const int level);
526
Chris Craikf57776b2013-10-25 18:30:17 -0700527 void applyViewPropertyTransforms(mat4& matrix);
528
529 void computeOrderingImpl(DrawDisplayListOp* opState,
Chris Craikf533e942014-01-14 22:35:37 -0800530 Vector<ZDrawDisplayListOpPair>* compositedChildrenOf3dRoot,
531 const mat4* transformFrom3dRoot,
532 Vector<DrawDisplayListOp*>* compositedChildrenOfProjectionSurface,
533 const mat4* transformFromProjectionSurface);
Chris Craikf57776b2013-10-25 18:30:17 -0700534
Chris Craikff785832013-03-08 13:12:16 -0800535 template <class T>
536 inline void setViewProperties(OpenGLRenderer& renderer, T& handler, const int level);
537
538 template <class T>
Chris Craikf57776b2013-10-25 18:30:17 -0700539 inline void iterate3dChildren(ChildrenSelectMode mode, OpenGLRenderer& renderer,
540 T& handler, const int level);
541
542 template <class T>
Chris Craikf533e942014-01-14 22:35:37 -0800543 inline void iterateProjectedChildren(OpenGLRenderer& renderer, T& handler, const int level);
544
545 template <class T>
Chris Craikff785832013-03-08 13:12:16 -0800546 inline void iterate(OpenGLRenderer& renderer, T& handler, const int level);
547
Chris Craik0776a602013-02-14 15:36:01 -0800548 void init();
549
550 void clearResources();
551
552 void updateMatrix();
553
554 class TextContainer {
555 public:
556 size_t length() const {
557 return mByteLength;
558 }
559
560 const char* text() const {
561 return (const char*) mText;
562 }
563
564 size_t mByteLength;
565 const char* mText;
566 };
567
Chris Craikd218a922014-01-02 17:13:34 -0800568 Vector<const SkBitmap*> mBitmapResources;
569 Vector<const SkBitmap*> mOwnedBitmapResources;
Chris Craik0776a602013-02-14 15:36:01 -0800570 Vector<SkiaColorFilter*> mFilterResources;
Chris Craikd218a922014-01-02 17:13:34 -0800571 Vector<const Res_png_9patch*> mPatchResources;
Chris Craik0776a602013-02-14 15:36:01 -0800572
Chris Craikd218a922014-01-02 17:13:34 -0800573 Vector<const SkPaint*> mPaints;
574 Vector<const SkPath*> mPaths;
575 SortedVector<const SkPath*> mSourcePaths;
576 Vector<const SkRegion*> mRegions;
577 Vector<const SkMatrix*> mMatrices;
Chris Craik0776a602013-02-14 15:36:01 -0800578 Vector<SkiaShader*> mShaders;
579 Vector<Layer*> mLayers;
580
581 sp<DisplayListData> mDisplayListData;
582
583 size_t mSize;
584
585 bool mIsRenderable;
586 uint32_t mFunctorCount;
587
588 String8 mName;
Chris Craik9846de62013-06-12 16:23:00 -0700589 bool mDestroyed; // used for debugging crash, TODO: remove once invalid state crash fixed
Chris Craik0776a602013-02-14 15:36:01 -0800590
Alan Viverette58f09b32014-01-08 17:18:19 -0800591 // Rendering properties
Chet Haasedd671592013-04-19 14:54:34 -0700592 bool mClipToBounds;
Chris Craikd863a102013-12-19 13:31:15 -0800593 bool mIsContainedVolume;
Alan Viverette58f09b32014-01-08 17:18:19 -0800594 bool mProjectToContainedVolume;
Chris Craik0776a602013-02-14 15:36:01 -0800595 float mAlpha;
Chris Craik0776a602013-02-14 15:36:01 -0800596 bool mHasOverlappingRendering;
Chris Craikf57776b2013-10-25 18:30:17 -0700597 float mTranslationX, mTranslationY, mTranslationZ;
Chris Craik0776a602013-02-14 15:36:01 -0800598 float mRotation, mRotationX, mRotationY;
599 float mScaleX, mScaleY;
600 float mPivotX, mPivotY;
601 float mCameraDistance;
602 int mLeft, mTop, mRight, mBottom;
603 int mWidth, mHeight;
604 int mPrevWidth, mPrevHeight;
605 bool mPivotExplicitlySet;
606 bool mMatrixDirty;
607 bool mMatrixIsIdentity;
608 uint32_t mMatrixFlags;
609 SkMatrix* mTransformMatrix;
610 Sk3DView* mTransformCamera;
611 SkMatrix* mTransformMatrix3D;
612 SkMatrix* mStaticMatrix;
613 SkMatrix* mAnimationMatrix;
Chris Craikf57776b2013-10-25 18:30:17 -0700614 Matrix4 mTransform;
Chris Craik0776a602013-02-14 15:36:01 -0800615 bool mCaching;
Chris Craikff785832013-03-08 13:12:16 -0800616
617 /**
Chris Craikf57776b2013-10-25 18:30:17 -0700618 * Draw time state - these properties are only set and used during rendering
Chris Craikff785832013-03-08 13:12:16 -0800619 */
Chris Craikf57776b2013-10-25 18:30:17 -0700620
621 // for 3d roots, contains a z sorted list of all children items
Chris Craik9f68c092014-01-10 10:30:57 -0800622 Vector<ZDrawDisplayListOpPair> m3dNodes;
Chris Craikf533e942014-01-14 22:35:37 -0800623
624 // for projection surfaces, contains a list of all children items
625 Vector<DrawDisplayListOp*> mProjectedNodes;
Chris Craik0776a602013-02-14 15:36:01 -0800626}; // class DisplayList
627
628}; // namespace uirenderer
629}; // namespace android
630
631#endif // ANDROID_HWUI_OPENGL_RENDERER_H