diff options
author | Chris Craik <ccraik@google.com> | 2014-04-25 18:34:11 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2014-04-28 14:33:33 -0700 |
commit | cc39e16cb98855f35079941b5e7e6eac2b7bc388 (patch) | |
tree | f37cb0ce9da11a018446adfb83c756f5e76e77f1 /libs/hwui/RenderNode.cpp | |
parent | 802667b20b2170ddce94d70a022b68b64b9a7493 (diff) | |
download | frameworks_base-cc39e16cb98855f35079941b5e7e6eac2b7bc388.zip frameworks_base-cc39e16cb98855f35079941b5e7e6eac2b7bc388.tar.gz frameworks_base-cc39e16cb98855f35079941b5e7e6eac2b7bc388.tar.bz2 |
Add elevation, Z properties to View
Change-Id: I3dd3b683a66e248a0fdf2ca69d1e962615b0daf9
Diffstat (limited to 'libs/hwui/RenderNode.cpp')
-rw-r--r-- | libs/hwui/RenderNode.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp index 2008f02..838e5ac 100644 --- a/libs/hwui/RenderNode.cpp +++ b/libs/hwui/RenderNode.cpp @@ -219,11 +219,11 @@ void RenderNode::applyViewPropertyTransforms(mat4& matrix, bool true3dTransform) matrix.multiply(anim); } - bool applyTranslationZ = true3dTransform && !MathUtils::isZero(properties().getTranslationZ()); + bool applyTranslationZ = true3dTransform && !MathUtils::isZero(properties().getZ()); if (properties().hasTransformMatrix() || applyTranslationZ) { if (properties().isTransformTranslateOnly()) { matrix.translate(properties().getTranslationX(), properties().getTranslationY(), - true3dTransform ? properties().getTranslationZ() : 0.0f); + true3dTransform ? properties().getZ() : 0.0f); } else { if (!true3dTransform) { matrix.multiply(*properties().getTransformMatrix()); @@ -232,7 +232,7 @@ void RenderNode::applyViewPropertyTransforms(mat4& matrix, bool true3dTransform) true3dMat.loadTranslate( properties().getPivotX() + properties().getTranslationX(), properties().getPivotY() + properties().getTranslationY(), - properties().getTranslationZ()); + properties().getZ()); true3dMat.rotate(properties().getRotationX(), 1, 0, 0); true3dMat.rotate(properties().getRotationY(), 0, 1, 0); true3dMat.rotate(properties().getRotation(), 0, 0, 1); @@ -344,7 +344,9 @@ private: void RenderNode::deferNodeTree(DeferStateStruct& deferStruct) { DeferOperationHandler handler(deferStruct, 0); - if (properties().getTranslationZ() > 0.0f) issueDrawShadowOperation(Matrix4::identity(), handler); + if (MathUtils::isPositive(properties().getZ())) { + issueDrawShadowOperation(Matrix4::identity(), handler); + } issueOperations<DeferOperationHandler>(deferStruct.mRenderer, handler); } @@ -380,7 +382,9 @@ private: void RenderNode::replayNodeTree(ReplayStateStruct& replayStruct) { ReplayOperationHandler handler(replayStruct, 0); - if (properties().getTranslationZ() > 0.0f) issueDrawShadowOperation(Matrix4::identity(), handler); + if (MathUtils::isPositive(properties().getZ())) { + issueDrawShadowOperation(Matrix4::identity(), handler); + } issueOperations<ReplayOperationHandler>(replayStruct.mRenderer, handler); } @@ -395,7 +399,7 @@ void RenderNode::buildZSortedChildList(Vector<ZDrawDisplayListOpPair>& zTranslat for (unsigned int i = 0; i < mDisplayListData->children().size(); i++) { DrawDisplayListOp* childOp = mDisplayListData->children()[i]; RenderNode* child = childOp->mDisplayList; - float childZ = child->properties().getTranslationZ(); + float childZ = child->properties().getZ(); if (!MathUtils::isZero(childZ)) { zTranslatedNodes.add(ZDrawDisplayListOpPair(childZ, childOp)); |