summaryrefslogtreecommitdiff
path: root/libs/hwui/RenderProperties.h
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2014-03-31 12:34:11 -0700
committer Chris Craik <ccraik@google.com> 2014-04-02 18:38:25 -0700
commit49e6c73913e9bee58ea5e3984be151ee8e033163 (patch)
treedb10cba6a686b5a2435eee07b18dfb285b2cb972 /libs/hwui/RenderProperties.h
parent8754b73bf81aa0164f3e2a1a429ba0fda39202de (diff)
Move most TransformationInfo properties to RenderNode
This change dedupes the various properties that were represented both in TransformationInfo, and RenderProperties on the native side. RenderNode (and its associated properties) are now permanently attached to a View in SW or HW. The native copy of these properties are their sole representation. Alpha to come in a later CL. Also fixed issue with copying RenderNode's transform, and added support of deleting RenderNodes in software rendering. Change-Id: Ideb6e7f32b780e87aa1c32637c368356b3eee3a1
Diffstat (limited to 'libs/hwui/RenderProperties.h')
-rw-r--r--libs/hwui/RenderProperties.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h
index 061e469abe3b..dd6821059490 100644
--- a/libs/hwui/RenderProperties.h
+++ b/libs/hwui/RenderProperties.h
@@ -258,20 +258,20 @@ public:
return mPrimitiveFields.mPivotY;
}
+ bool isPivotExplicitlySet() const {
+ return mPrimitiveFields.mPivotExplicitlySet;
+ }
+
void setCameraDistance(float distance) {
- if (distance != mCameraDistance) {
- mCameraDistance = distance;
+ if (distance != getCameraDistance()) {
mPrimitiveFields.mMatrixDirty = true;
- if (!mComputedFields.mTransformCamera) {
- mComputedFields.mTransformCamera = new Sk3DView();
- mComputedFields.mTransformMatrix3D = new SkMatrix();
- }
- mComputedFields.mTransformCamera->setCameraLocation(0, 0, distance);
+ mComputedFields.mTransformCamera.setCameraLocation(0, 0, distance);
}
}
float getCameraDistance() const {
- return mCameraDistance;
+ // TODO: update getCameraLocationZ() to be const
+ return const_cast<Sk3DView*>(&mComputedFields.mTransformCamera)->getCameraLocationZ();
}
void setLeft(int left) {
@@ -396,7 +396,7 @@ public:
return mPrimitiveFields.mMatrixFlags;
}
- const Matrix4* getTransformMatrix() const {
+ const SkMatrix* getTransformMatrix() const {
return mComputedFields.mTransformMatrix;
}
@@ -481,13 +481,11 @@ private:
int mPrevWidth, mPrevHeight;
bool mPivotExplicitlySet;
bool mMatrixDirty;
- bool mMatrixIsIdentity;
uint32_t mMatrixFlags;
bool mCaching;
} mPrimitiveFields;
// mCameraDistance isn't in mPrimitiveFields as it has a complex setter
- float mCameraDistance;
SkMatrix* mStaticMatrix;
SkMatrix* mAnimationMatrix;
@@ -502,11 +500,12 @@ private:
* Stores the total transformation of the DisplayList based upon its scalar
* translate/rotate/scale properties.
*
- * In the common translation-only case, the matrix isn't allocated and the mTranslation
- * properties are used directly.
+ * In the common translation-only case, the matrix isn't necessarily allocated,
+ * and the mTranslation properties are used directly.
*/
- Matrix4* mTransformMatrix;
- Sk3DView* mTransformCamera;
+ SkMatrix* mTransformMatrix;
+
+ Sk3DView mTransformCamera;
SkMatrix* mTransformMatrix3D;
SkPath* mClipPath; // TODO: remove this, create new ops for efficient/special case clipping
SkRegion::Op mClipPathOp;