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
diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h
index 061e469..dd68210 100644
--- a/libs/hwui/RenderProperties.h
+++ b/libs/hwui/RenderProperties.h
@@ -258,20 +258,20 @@
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 @@
return mPrimitiveFields.mMatrixFlags;
}
- const Matrix4* getTransformMatrix() const {
+ const SkMatrix* getTransformMatrix() const {
return mComputedFields.mTransformMatrix;
}
@@ -481,13 +481,11 @@
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 @@
* 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;