summaryrefslogtreecommitdiff
path: root/libs/hwui/FrameBuilder.cpp
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2016-03-01 18:48:37 -0800
committer Chris Craik <ccraik@google.com> 2016-03-02 10:48:15 -0800
commita748c08241e43fc68c7c34767d819aef5183936e (patch)
tree4763e36325f2a1c558d7a0d08a277b52f1e831d6 /libs/hwui/FrameBuilder.cpp
parent678ff81105753656aa4822f4f675ef96dc9d2b83 (diff)
Fix ripple positioning within scrolled node
bug:27275799 Skip applying clip/matrix properties from projected node op, since we don't want to respect the clip, and matrix is already baked into transformFromCompositedAncestor. This skips op clips in the new pipeline, and fixed a double application of scroll on ripple backgrounds. Change-Id: I4f72448fe0463ab666564ca538d8b6bf525d98de
Diffstat (limited to 'libs/hwui/FrameBuilder.cpp')
-rw-r--r--libs/hwui/FrameBuilder.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/libs/hwui/FrameBuilder.cpp b/libs/hwui/FrameBuilder.cpp
index b586a0109c27..1bc37e25f934 100644
--- a/libs/hwui/FrameBuilder.cpp
+++ b/libs/hwui/FrameBuilder.cpp
@@ -406,13 +406,20 @@ void FrameBuilder::deferProjectedChildren(const RenderNode& renderNode) {
for (size_t i = 0; i < renderNode.mProjectedNodes.size(); i++) {
RenderNodeOp* childOp = renderNode.mProjectedNodes[i];
- int restoreTo = mCanvasState.save(SaveFlags::Matrix);
+ RenderNode& childNode = *childOp->renderNode;
- // Apply transform between ancestor and projected descendant
- mCanvasState.concatMatrix(childOp->transformFromCompositingAncestor);
+ // Draw child if it has content, but ignore state in childOp - matrix already applied to
+ // transformFromCompositingAncestor, and record-time clip is ignored when projecting
+ if (!childNode.nothingToDraw()) {
+ int restoreTo = mCanvasState.save(SaveFlags::MatrixClip);
- deferRenderNodeOpImpl(*childOp);
- mCanvasState.restoreToCount(restoreTo);
+ // Apply transform between ancestor and projected descendant
+ mCanvasState.concatMatrix(childOp->transformFromCompositingAncestor);
+
+ deferNodePropsAndOps(childNode);
+
+ mCanvasState.restoreToCount(restoreTo);
+ }
}
mCanvasState.restoreToCount(count);
}