blob: 4270da2298db73cfb119f94ad59e68f43342673a [file] [log] [blame]
John Reckacb6f072014-03-12 16:11:23 -07001/*
2 * Copyright (C) 2014 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 */
Chris Craikb49f4462014-03-20 12:44:20 -070016#ifndef RENDERNODEPROPERTIES_H
17#define RENDERNODEPROPERTIES_H
John Reckacb6f072014-03-12 16:11:23 -070018
19#include <stddef.h>
20#include <cutils/compiler.h>
21#include <androidfw/ResourceTypes.h>
22
23#include <SkCamera.h>
24#include <SkMatrix.h>
Chris Craik8c271ca2014-03-25 10:33:01 -070025#include <SkRegion.h>
Chris Craikb49f4462014-03-20 12:44:20 -070026
27#include "Rect.h"
Chris Craik8c271ca2014-03-25 10:33:01 -070028#include "RevealClip.h"
Chris Craikb49f4462014-03-20 12:44:20 -070029#include "Outline.h"
John Reckacb6f072014-03-12 16:11:23 -070030
John Reckacb6f072014-03-12 16:11:23 -070031class SkBitmap;
32class SkPaint;
John Reckacb6f072014-03-12 16:11:23 -070033
34namespace android {
35namespace uirenderer {
36
37class Matrix4;
38class RenderNode;
39
40/*
41 * Data structure that holds the properties for a RenderNode
42 */
43class RenderProperties {
44public:
45 RenderProperties();
46 virtual ~RenderProperties();
47
John Reckd0a0b2a2014-03-20 16:28:56 -070048 RenderProperties& operator=(const RenderProperties& other);
49
John Reckacb6f072014-03-12 16:11:23 -070050 void setClipToBounds(bool clipToBounds) {
John Reckd0a0b2a2014-03-20 16:28:56 -070051 mPrimitiveFields.mClipToBounds = clipToBounds;
John Reckacb6f072014-03-12 16:11:23 -070052 }
53
John Reckacb6f072014-03-12 16:11:23 -070054 void setProjectBackwards(bool shouldProject) {
John Reckd0a0b2a2014-03-20 16:28:56 -070055 mPrimitiveFields.mProjectBackwards = shouldProject;
John Reckacb6f072014-03-12 16:11:23 -070056 }
57
58 void setProjectionReceiver(bool shouldRecieve) {
John Reckd0a0b2a2014-03-20 16:28:56 -070059 mPrimitiveFields.mProjectionReceiver = shouldRecieve;
John Reckacb6f072014-03-12 16:11:23 -070060 }
61
John Reckd0a0b2a2014-03-20 16:28:56 -070062 bool isProjectionReceiver() const {
63 return mPrimitiveFields.mProjectionReceiver;
John Reckacb6f072014-03-12 16:11:23 -070064 }
65
John Reckd0a0b2a2014-03-20 16:28:56 -070066 void setStaticMatrix(const SkMatrix* matrix) {
John Reckacb6f072014-03-12 16:11:23 -070067 delete mStaticMatrix;
John Reckd0a0b2a2014-03-20 16:28:56 -070068 if (matrix) {
69 mStaticMatrix = new SkMatrix(*matrix);
70 } else {
71 mStaticMatrix = NULL;
72 }
John Reckacb6f072014-03-12 16:11:23 -070073 }
74
75 // Can return NULL
John Reckd0a0b2a2014-03-20 16:28:56 -070076 const SkMatrix* getStaticMatrix() const {
John Reckacb6f072014-03-12 16:11:23 -070077 return mStaticMatrix;
78 }
79
John Reckd0a0b2a2014-03-20 16:28:56 -070080 void setAnimationMatrix(const SkMatrix* matrix) {
John Reckacb6f072014-03-12 16:11:23 -070081 delete mAnimationMatrix;
82 if (matrix) {
83 mAnimationMatrix = new SkMatrix(*matrix);
84 } else {
85 mAnimationMatrix = NULL;
86 }
87 }
88
89 void setAlpha(float alpha) {
90 alpha = fminf(1.0f, fmaxf(0.0f, alpha));
John Reckd0a0b2a2014-03-20 16:28:56 -070091 if (alpha != mPrimitiveFields.mAlpha) {
92 mPrimitiveFields.mAlpha = alpha;
John Reckacb6f072014-03-12 16:11:23 -070093 }
94 }
95
96 float getAlpha() const {
John Reckd0a0b2a2014-03-20 16:28:56 -070097 return mPrimitiveFields.mAlpha;
John Reckacb6f072014-03-12 16:11:23 -070098 }
99
100 void setHasOverlappingRendering(bool hasOverlappingRendering) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700101 mPrimitiveFields.mHasOverlappingRendering = hasOverlappingRendering;
John Reckacb6f072014-03-12 16:11:23 -0700102 }
103
104 bool hasOverlappingRendering() const {
John Reckd0a0b2a2014-03-20 16:28:56 -0700105 return mPrimitiveFields.mHasOverlappingRendering;
John Reckacb6f072014-03-12 16:11:23 -0700106 }
107
108 void setTranslationX(float translationX) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700109 if (translationX != mPrimitiveFields.mTranslationX) {
110 mPrimitiveFields.mTranslationX = translationX;
John Reckf7483e32014-04-11 08:54:47 -0700111 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700112 }
113 }
114
115 float getTranslationX() const {
John Reckd0a0b2a2014-03-20 16:28:56 -0700116 return mPrimitiveFields.mTranslationX;
John Reckacb6f072014-03-12 16:11:23 -0700117 }
118
119 void setTranslationY(float translationY) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700120 if (translationY != mPrimitiveFields.mTranslationY) {
121 mPrimitiveFields.mTranslationY = translationY;
John Reckf7483e32014-04-11 08:54:47 -0700122 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700123 }
124 }
125
126 float getTranslationY() const {
John Reckd0a0b2a2014-03-20 16:28:56 -0700127 return mPrimitiveFields.mTranslationY;
John Reckacb6f072014-03-12 16:11:23 -0700128 }
129
130 void setTranslationZ(float translationZ) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700131 if (translationZ != mPrimitiveFields.mTranslationZ) {
132 mPrimitiveFields.mTranslationZ = translationZ;
John Reckf7483e32014-04-11 08:54:47 -0700133 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700134 }
135 }
136
137 float getTranslationZ() const {
John Reckd0a0b2a2014-03-20 16:28:56 -0700138 return mPrimitiveFields.mTranslationZ;
John Reckacb6f072014-03-12 16:11:23 -0700139 }
140
141 void setRotation(float rotation) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700142 if (rotation != mPrimitiveFields.mRotation) {
143 mPrimitiveFields.mRotation = rotation;
John Reckf7483e32014-04-11 08:54:47 -0700144 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700145 }
146 }
147
148 float getRotation() const {
John Reckd0a0b2a2014-03-20 16:28:56 -0700149 return mPrimitiveFields.mRotation;
John Reckacb6f072014-03-12 16:11:23 -0700150 }
151
152 void setRotationX(float rotationX) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700153 if (rotationX != mPrimitiveFields.mRotationX) {
154 mPrimitiveFields.mRotationX = rotationX;
John Reckf7483e32014-04-11 08:54:47 -0700155 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700156 }
157 }
158
159 float getRotationX() const {
John Reckd0a0b2a2014-03-20 16:28:56 -0700160 return mPrimitiveFields.mRotationX;
John Reckacb6f072014-03-12 16:11:23 -0700161 }
162
163 void setRotationY(float rotationY) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700164 if (rotationY != mPrimitiveFields.mRotationY) {
165 mPrimitiveFields.mRotationY = rotationY;
John Reckf7483e32014-04-11 08:54:47 -0700166 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700167 }
168 }
169
170 float getRotationY() const {
John Reckd0a0b2a2014-03-20 16:28:56 -0700171 return mPrimitiveFields.mRotationY;
John Reckacb6f072014-03-12 16:11:23 -0700172 }
173
174 void setScaleX(float scaleX) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700175 if (scaleX != mPrimitiveFields.mScaleX) {
176 mPrimitiveFields.mScaleX = scaleX;
John Reckf7483e32014-04-11 08:54:47 -0700177 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700178 }
179 }
180
181 float getScaleX() const {
John Reckd0a0b2a2014-03-20 16:28:56 -0700182 return mPrimitiveFields.mScaleX;
John Reckacb6f072014-03-12 16:11:23 -0700183 }
184
185 void setScaleY(float scaleY) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700186 if (scaleY != mPrimitiveFields.mScaleY) {
187 mPrimitiveFields.mScaleY = scaleY;
John Reckf7483e32014-04-11 08:54:47 -0700188 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700189 }
190 }
191
192 float getScaleY() const {
John Reckd0a0b2a2014-03-20 16:28:56 -0700193 return mPrimitiveFields.mScaleY;
John Reckacb6f072014-03-12 16:11:23 -0700194 }
195
196 void setPivotX(float pivotX) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700197 mPrimitiveFields.mPivotX = pivotX;
John Reckf7483e32014-04-11 08:54:47 -0700198 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckd0a0b2a2014-03-20 16:28:56 -0700199 mPrimitiveFields.mPivotExplicitlySet = true;
John Reckacb6f072014-03-12 16:11:23 -0700200 }
201
John Reckd0a0b2a2014-03-20 16:28:56 -0700202 /* Note that getPivotX and getPivotY are adjusted by updateMatrix(),
203 * so the value returned mPrimitiveFields.may be stale if the RenderProperties has been
204 * mPrimitiveFields.modified since the last call to updateMatrix()
205 */
206 float getPivotX() const {
207 return mPrimitiveFields.mPivotX;
208 }
John Reckacb6f072014-03-12 16:11:23 -0700209
210 void setPivotY(float pivotY) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700211 mPrimitiveFields.mPivotY = pivotY;
John Reckf7483e32014-04-11 08:54:47 -0700212 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckd0a0b2a2014-03-20 16:28:56 -0700213 mPrimitiveFields.mPivotExplicitlySet = true;
John Reckacb6f072014-03-12 16:11:23 -0700214 }
215
John Reckd0a0b2a2014-03-20 16:28:56 -0700216 float getPivotY() const {
217 return mPrimitiveFields.mPivotY;
218 }
John Reckacb6f072014-03-12 16:11:23 -0700219
Chris Craik49e6c732014-03-31 12:34:11 -0700220 bool isPivotExplicitlySet() const {
221 return mPrimitiveFields.mPivotExplicitlySet;
222 }
223
John Reckacb6f072014-03-12 16:11:23 -0700224 void setCameraDistance(float distance) {
Chris Craik49e6c732014-03-31 12:34:11 -0700225 if (distance != getCameraDistance()) {
John Reckf7483e32014-04-11 08:54:47 -0700226 mPrimitiveFields.mMatrixOrPivotDirty = true;
Chris Craik49e6c732014-03-31 12:34:11 -0700227 mComputedFields.mTransformCamera.setCameraLocation(0, 0, distance);
John Reckacb6f072014-03-12 16:11:23 -0700228 }
229 }
230
231 float getCameraDistance() const {
Chris Craik49e6c732014-03-31 12:34:11 -0700232 // TODO: update getCameraLocationZ() to be const
233 return const_cast<Sk3DView*>(&mComputedFields.mTransformCamera)->getCameraLocationZ();
John Reckacb6f072014-03-12 16:11:23 -0700234 }
235
236 void setLeft(int left) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700237 if (left != mPrimitiveFields.mLeft) {
238 mPrimitiveFields.mLeft = left;
239 mPrimitiveFields.mWidth = mPrimitiveFields.mRight - mPrimitiveFields.mLeft;
John Reckf7483e32014-04-11 08:54:47 -0700240 if (!mPrimitiveFields.mPivotExplicitlySet) {
241 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700242 }
243 }
244 }
245
246 float getLeft() const {
John Reckd0a0b2a2014-03-20 16:28:56 -0700247 return mPrimitiveFields.mLeft;
John Reckacb6f072014-03-12 16:11:23 -0700248 }
249
250 void setTop(int top) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700251 if (top != mPrimitiveFields.mTop) {
252 mPrimitiveFields.mTop = top;
253 mPrimitiveFields.mHeight = mPrimitiveFields.mBottom - mPrimitiveFields.mTop;
John Reckf7483e32014-04-11 08:54:47 -0700254 if (!mPrimitiveFields.mPivotExplicitlySet) {
255 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700256 }
257 }
258 }
259
260 float getTop() const {
John Reckd0a0b2a2014-03-20 16:28:56 -0700261 return mPrimitiveFields.mTop;
John Reckacb6f072014-03-12 16:11:23 -0700262 }
263
264 void setRight(int right) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700265 if (right != mPrimitiveFields.mRight) {
266 mPrimitiveFields.mRight = right;
267 mPrimitiveFields.mWidth = mPrimitiveFields.mRight - mPrimitiveFields.mLeft;
John Reckf7483e32014-04-11 08:54:47 -0700268 if (!mPrimitiveFields.mPivotExplicitlySet) {
269 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700270 }
271 }
272 }
273
274 float getRight() const {
John Reckd0a0b2a2014-03-20 16:28:56 -0700275 return mPrimitiveFields.mRight;
John Reckacb6f072014-03-12 16:11:23 -0700276 }
277
278 void setBottom(int bottom) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700279 if (bottom != mPrimitiveFields.mBottom) {
280 mPrimitiveFields.mBottom = bottom;
281 mPrimitiveFields.mHeight = mPrimitiveFields.mBottom - mPrimitiveFields.mTop;
John Reckf7483e32014-04-11 08:54:47 -0700282 if (!mPrimitiveFields.mPivotExplicitlySet) {
283 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700284 }
285 }
286 }
287
288 float getBottom() const {
John Reckd0a0b2a2014-03-20 16:28:56 -0700289 return mPrimitiveFields.mBottom;
John Reckacb6f072014-03-12 16:11:23 -0700290 }
291
292 void setLeftTop(int left, int top) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700293 if (left != mPrimitiveFields.mLeft || top != mPrimitiveFields.mTop) {
294 mPrimitiveFields.mLeft = left;
295 mPrimitiveFields.mTop = top;
296 mPrimitiveFields.mWidth = mPrimitiveFields.mRight - mPrimitiveFields.mLeft;
297 mPrimitiveFields.mHeight = mPrimitiveFields.mBottom - mPrimitiveFields.mTop;
John Reckf7483e32014-04-11 08:54:47 -0700298 if (!mPrimitiveFields.mPivotExplicitlySet) {
299 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700300 }
301 }
302 }
303
304 void setLeftTopRightBottom(int left, int top, int right, int bottom) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700305 if (left != mPrimitiveFields.mLeft || top != mPrimitiveFields.mTop || right != mPrimitiveFields.mRight || bottom != mPrimitiveFields.mBottom) {
306 mPrimitiveFields.mLeft = left;
307 mPrimitiveFields.mTop = top;
308 mPrimitiveFields.mRight = right;
309 mPrimitiveFields.mBottom = bottom;
310 mPrimitiveFields.mWidth = mPrimitiveFields.mRight - mPrimitiveFields.mLeft;
311 mPrimitiveFields.mHeight = mPrimitiveFields.mBottom - mPrimitiveFields.mTop;
John Reckf7483e32014-04-11 08:54:47 -0700312 if (!mPrimitiveFields.mPivotExplicitlySet) {
313 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700314 }
315 }
316 }
317
318 void offsetLeftRight(float offset) {
319 if (offset != 0) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700320 mPrimitiveFields.mLeft += offset;
321 mPrimitiveFields.mRight += offset;
John Reckf7483e32014-04-11 08:54:47 -0700322 if (!mPrimitiveFields.mPivotExplicitlySet) {
323 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700324 }
325 }
326 }
327
328 void offsetTopBottom(float offset) {
329 if (offset != 0) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700330 mPrimitiveFields.mTop += offset;
331 mPrimitiveFields.mBottom += offset;
John Reckf7483e32014-04-11 08:54:47 -0700332 if (!mPrimitiveFields.mPivotExplicitlySet) {
333 mPrimitiveFields.mMatrixOrPivotDirty = true;
John Reckacb6f072014-03-12 16:11:23 -0700334 }
335 }
336 }
337
338 void setCaching(bool caching) {
John Reckd0a0b2a2014-03-20 16:28:56 -0700339 mPrimitiveFields.mCaching = caching;
John Reckacb6f072014-03-12 16:11:23 -0700340 }
341
Chris Craikb49f4462014-03-20 12:44:20 -0700342 int getWidth() const {
John Reckd0a0b2a2014-03-20 16:28:56 -0700343 return mPrimitiveFields.mWidth;
John Reckacb6f072014-03-12 16:11:23 -0700344 }
345
Chris Craikb49f4462014-03-20 12:44:20 -0700346 int getHeight() const {
John Reckd0a0b2a2014-03-20 16:28:56 -0700347 return mPrimitiveFields.mHeight;
John Reckacb6f072014-03-12 16:11:23 -0700348 }
349
John Reckd0a0b2a2014-03-20 16:28:56 -0700350 const SkMatrix* getAnimationMatrix() const {
351 return mAnimationMatrix;
352 }
353
John Reckf7483e32014-04-11 08:54:47 -0700354 bool hasTransformMatrix() const {
355 return getTransformMatrix() && !getTransformMatrix()->isIdentity();
356 }
357
358 // May only call this if hasTransformMatrix() is true
359 bool isTransformTranslateOnly() const {
360 return getTransformMatrix()->getType() == SkMatrix::kTranslate_Mask;
John Reckd0a0b2a2014-03-20 16:28:56 -0700361 }
362
Chris Craik49e6c732014-03-31 12:34:11 -0700363 const SkMatrix* getTransformMatrix() const {
John Reckf7483e32014-04-11 08:54:47 -0700364 LOG_ALWAYS_FATAL_IF(mPrimitiveFields.mMatrixOrPivotDirty, "Cannot get a dirty matrix!");
John Reckd0a0b2a2014-03-20 16:28:56 -0700365 return mComputedFields.mTransformMatrix;
366 }
367
368 bool getCaching() const {
369 return mPrimitiveFields.mCaching;
370 }
371
372 bool getClipToBounds() const {
373 return mPrimitiveFields.mClipToBounds;
374 }
375
376 bool getHasOverlappingRendering() const {
377 return mPrimitiveFields.mHasOverlappingRendering;
378 }
379
380 const Outline& getOutline() const {
381 return mPrimitiveFields.mOutline;
382 }
383
Chris Craik8c271ca2014-03-25 10:33:01 -0700384 const RevealClip& getRevealClip() const {
385 return mPrimitiveFields.mRevealClip;
386 }
387
John Reckd0a0b2a2014-03-20 16:28:56 -0700388 bool getProjectBackwards() const {
389 return mPrimitiveFields.mProjectBackwards;
390 }
391
392 void debugOutputProperties(const int level) const;
393
394 ANDROID_API void updateMatrix();
395
Chris Craik8c271ca2014-03-25 10:33:01 -0700396 ANDROID_API void updateClipPath();
397
398 // signals that mComputedFields.mClipPath is up to date, and should be used for clipping
399 bool hasClippingPath() const {
400 return mPrimitiveFields.mOutline.willClip() || mPrimitiveFields.mRevealClip.willClip();
401 }
402
403 const SkPath* getClippingPath() const {
404 return hasClippingPath() ? mComputedFields.mClipPath : NULL;
405 }
406
407 SkRegion::Op getClippingPathOp() const {
408 return mComputedFields.mClipPathOp;
409 }
410
John Reckd0a0b2a2014-03-20 16:28:56 -0700411 Outline& mutableOutline() {
412 return mPrimitiveFields.mOutline;
Chris Craikb49f4462014-03-20 12:44:20 -0700413 }
414
Chris Craik8c271ca2014-03-25 10:33:01 -0700415 RevealClip& mutableRevealClip() {
416 return mPrimitiveFields.mRevealClip;
417 }
418
John Reckacb6f072014-03-12 16:11:23 -0700419private:
John Reckacb6f072014-03-12 16:11:23 -0700420
John Reckacb6f072014-03-12 16:11:23 -0700421 // Rendering properties
John Reckd0a0b2a2014-03-20 16:28:56 -0700422 struct PrimitiveFields {
423 PrimitiveFields();
John Reckacb6f072014-03-12 16:11:23 -0700424
John Reckd0a0b2a2014-03-20 16:28:56 -0700425 Outline mOutline;
Chris Craik8c271ca2014-03-25 10:33:01 -0700426 RevealClip mRevealClip;
John Reckd0a0b2a2014-03-20 16:28:56 -0700427 bool mClipToBounds;
428 bool mProjectBackwards;
429 bool mProjectionReceiver;
430 float mAlpha;
431 bool mHasOverlappingRendering;
432 float mTranslationX, mTranslationY, mTranslationZ;
433 float mRotation, mRotationX, mRotationY;
434 float mScaleX, mScaleY;
435 float mPivotX, mPivotY;
436 int mLeft, mTop, mRight, mBottom;
437 int mWidth, mHeight;
John Reckd0a0b2a2014-03-20 16:28:56 -0700438 bool mPivotExplicitlySet;
John Reckf7483e32014-04-11 08:54:47 -0700439 bool mMatrixOrPivotDirty;
John Reckd0a0b2a2014-03-20 16:28:56 -0700440 bool mCaching;
441 } mPrimitiveFields;
442
443 // mCameraDistance isn't in mPrimitiveFields as it has a complex setter
John Reckacb6f072014-03-12 16:11:23 -0700444 SkMatrix* mStaticMatrix;
445 SkMatrix* mAnimationMatrix;
John Reckacb6f072014-03-12 16:11:23 -0700446
John Reckd0a0b2a2014-03-20 16:28:56 -0700447 /**
448 * These fields are all generated from other properties and are not set directly.
449 */
450 struct ComputedFields {
451 ComputedFields();
452 ~ComputedFields();
453
454 /**
455 * Stores the total transformation of the DisplayList based upon its scalar
456 * translate/rotate/scale properties.
457 *
Chris Craik49e6c732014-03-31 12:34:11 -0700458 * In the common translation-only case, the matrix isn't necessarily allocated,
459 * and the mTranslation properties are used directly.
John Reckd0a0b2a2014-03-20 16:28:56 -0700460 */
Chris Craik49e6c732014-03-31 12:34:11 -0700461 SkMatrix* mTransformMatrix;
462
463 Sk3DView mTransformCamera;
Chris Craik8c271ca2014-03-25 10:33:01 -0700464 SkPath* mClipPath; // TODO: remove this, create new ops for efficient/special case clipping
465 SkRegion::Op mClipPathOp;
John Reckd0a0b2a2014-03-20 16:28:56 -0700466 } mComputedFields;
John Reckacb6f072014-03-12 16:11:23 -0700467};
468
469} /* namespace uirenderer */
470} /* namespace android */
471
Chris Craikb49f4462014-03-20 12:44:20 -0700472#endif /* RENDERNODEPROPERTIES_H */