Commit 6dad4dfd authored by esprehn@chromium.org's avatar esprehn@chromium.org

RenderLayer::clipParent() should avoid calling clippedByAncestor unless needed

Calling clippedByAncestor is not free, we should avoid calling it unless
the compositingReasons() say we need to.

R=ojan@chromium.org,vollick@chromium.org,abarth@chromium.org

Review URL: https://codereview.chromium.org/183263003

git-svn-id: svn://svn.chromium.org/blink/trunk@168234 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 864bade1
......@@ -1680,15 +1680,11 @@ RenderLayer* RenderLayer::scrollParent() const
RenderLayer* RenderLayer::clipParent() const
{
const bool needsAncestorClip = compositor()->clippedByAncestor(this);
RenderLayer* clipParent = 0;
if ((compositingReasons() & CompositingReasonOutOfFlowClipping) && !needsAncestorClip) {
if (compositingReasons() & CompositingReasonOutOfFlowClipping && !compositor()->clippedByAncestor(this)) {
if (RenderObject* containingBlock = renderer()->containingBlock())
clipParent = containingBlock->enclosingLayer()->enclosingCompositingLayer();
return containingBlock->enclosingLayer()->enclosingCompositingLayer();
}
return clipParent;
return 0;
}
void RenderLayer::didUpdateNeedsCompositedScrolling()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment