Fix DA bugs
* Now aware of transform of DrawDisplayListOp
* Supports projection
Bug: 15539677
Bug: 15506680
Change-Id: Ic16f482cd48c3add12e49eca529281be12b93491
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index c2f6df8..83ad76f 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -15,6 +15,7 @@
*/
#define ATRACE_TAG ATRACE_TAG_VIEW
+#define LOG_TAG "RenderNode"
#include "RenderNode.h"
@@ -111,26 +112,20 @@
prepareTreeImpl(info);
}
-static inline void pushNode(RenderNode* self, TreeInfo& info) {
- if (info.damageAccumulator) {
- info.damageAccumulator->pushNode(self);
- }
-}
-
-static inline void popNode(TreeInfo& info) {
- if (info.damageAccumulator) {
- info.damageAccumulator->popNode();
- }
-}
-
void RenderNode::damageSelf(TreeInfo& info) {
- if (info.damageAccumulator && isRenderable() && properties().getAlpha() > 0) {
- info.damageAccumulator->dirty(0, 0, properties().getWidth(), properties().getHeight());
+ if (isRenderable() && properties().getAlpha() > 0) {
+ if (properties().getClipToBounds()) {
+ info.damageAccumulator->dirty(0, 0, properties().getWidth(), properties().getHeight());
+ } else {
+ // Hope this is big enough?
+ // TODO: Get this from the display list ops or something
+ info.damageAccumulator->dirty(INT_MIN, INT_MIN, INT_MAX, INT_MAX);
+ }
}
}
void RenderNode::prepareTreeImpl(TreeInfo& info) {
- pushNode(this, info);
+ info.damageAccumulator->pushTransform(this);
if (info.mode == TreeInfo::MODE_FULL) {
pushStagingChanges(info);
evaluateAnimations(info);
@@ -140,7 +135,7 @@
evaluateAnimations(info);
}
prepareSubTree(info, mDisplayListData);
- popNode(info);
+ info.damageAccumulator->popTransform();
}
class PushAnimatorsFunctor {
@@ -173,14 +168,14 @@
if (mDirtyPropertyFields) {
mDirtyPropertyFields = 0;
damageSelf(info);
- popNode(info);
+ info.damageAccumulator->popTransform();
mProperties = mStagingProperties;
- pushNode(this, info);
// We could try to be clever and only re-damage if the matrix changed.
// However, we don't need to worry about that. The cost of over-damaging
// here is only going to be a single additional map rect of this node
// plus a rect join(). The parent's transform (and up) will only be
// performed once.
+ info.damageAccumulator->pushTransform(this);
damageSelf(info);
}
if (mNeedsDisplayListDataSync) {
@@ -217,7 +212,7 @@
// property push and just damage self before and after animators are run
damageSelf(info);
- popNode(info);
+ info.damageAccumulator->popTransform();
AnimateFunctor functor(this, info);
std::vector< sp<BaseRenderNodeAnimator> >::iterator newEnd;
@@ -226,7 +221,7 @@
mProperties.updateMatrix();
info.out.hasAnimations |= mAnimators.size();
- pushNode(this, info);
+ info.damageAccumulator->pushTransform(this);
damageSelf(info);
}
@@ -243,8 +238,11 @@
info.prepareTextures = cache.prefetchAndMarkInUse(subtree->bitmapResources[i]);
}
for (size_t i = 0; i < subtree->children().size(); i++) {
- RenderNode* childNode = subtree->children()[i]->mDisplayList;
+ DrawDisplayListOp* op = subtree->children()[i];
+ RenderNode* childNode = op->mDisplayList;
+ info.damageAccumulator->pushTransform(&op->mTransformFromParent);
childNode->prepareTreeImpl(info);
+ info.damageAccumulator->popTransform();
}
}
}