Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: Source/core/rendering/RenderBox.cpp

Issue 204843002: Reduce invalidation on children-needs-layout containers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined and updated awesomeness! Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 return; 1593 return;
1594 } 1594 }
1595 1595
1596 if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsInt oOwnBacking) 1596 if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsInt oOwnBacking)
1597 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer() 1597 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer()
1598 && hasLayer() 1598 && hasLayer()
1599 && layer()->isSelfPaintingLayer())) { 1599 && layer()->isSelfPaintingLayer())) {
1600 setShouldDoFullPaintInvalidationAfterLayout(true); 1600 setShouldDoFullPaintInvalidationAfterLayout(true);
1601 } 1601 }
1602 1602
1603 const LayoutRect& newPaintInvalidationRect = previousPaintInvalidationRect() ; 1603 if ((layoutDidGetCalled() && !skipInvalidationWhenLaidOutChildren()) || mayN eedPaintInvalidation()) {
1604 const LayoutPoint& newPositionFromPaintInvalidationContainer = previousPosit ionFromPaintInvalidationContainer(); 1604 const LayoutRect& newPaintInvalidationRect = previousPaintInvalidationRe ct();
1605 bool didFullPaintInvalidation = invalidatePaintAfterLayoutIfNeeded(&newPaint InvalidationContainer, 1605 const LayoutPoint& newPositionFromPaintInvalidationContainer = previousP ositionFromPaintInvalidationContainer();
1606 shouldDoFullPaintInvalidationAfterLayout(), oldPaintInvalidationRect, ol dPositionFromPaintInvalidationContainer, 1606 bool didFullPaintInvalidation = invalidatePaintAfterLayoutIfNeeded(&newP aintInvalidationContainer,
1607 &newPaintInvalidationRect, &newPositionFromPaintInvalidationContainer); 1607 shouldDoFullPaintInvalidationAfterLayout(), oldPaintInvalidationRect , oldPositionFromPaintInvalidationContainer,
1608 &newPaintInvalidationRect, &newPositionFromPaintInvalidationContaine r);
1608 1609
1609 if (!didFullPaintInvalidation) 1610 if (!didFullPaintInvalidation)
1610 invalidatePaintForOverflowIfNeeded(); 1611 invalidatePaintForOverflowIfNeeded();
1612 }
1611 1613
1612 // Issue paint invalidations for any scrollbars if there is a scrollable are a for this renderer. 1614 // Issue paint invalidations for any scrollbars if there is a scrollable are a for this renderer.
1613 if (enclosingLayer()) { 1615 if (enclosingLayer()) {
1614 if (RenderLayerScrollableArea* area = enclosingLayer()->scrollableArea() ) { 1616 if (RenderLayerScrollableArea* area = enclosingLayer()->scrollableArea() ) {
1615 if (area->hasVerticalBarDamage()) 1617 if (area->hasVerticalBarDamage())
1616 invalidatePaintRectangle(area->verticalBarDamage()); 1618 invalidatePaintRectangle(area->verticalBarDamage());
1617 if (area->hasHorizontalBarDamage()) 1619 if (area->hasHorizontalBarDamage())
1618 invalidatePaintRectangle(area->horizontalBarDamage()); 1620 invalidatePaintRectangle(area->horizontalBarDamage());
1619 area->resetScrollbarDamage(); 1621 area->resetScrollbarDamage();
1620 } 1622 }
(...skipping 2514 matching lines...) Expand 10 before | Expand all | Expand 10 after
4135 { 4137 {
4136 ASSERT(!needsLayout()); 4138 ASSERT(!needsLayout());
4137 // If fragmentation height has changed, we need to lay out. No need to enter the renderer if it 4139 // If fragmentation height has changed, we need to lay out. No need to enter the renderer if it
4138 // is childless, though. 4140 // is childless, though.
4139 if (view()->layoutState()->pageLogicalHeightChanged() && slowFirstChild()) 4141 if (view()->layoutState()->pageLogicalHeightChanged() && slowFirstChild())
4140 layoutScope.setChildNeedsLayout(this); 4142 layoutScope.setChildNeedsLayout(this);
4141 } 4143 }
4142 4144
4143 void RenderBox::addVisualEffectOverflow() 4145 void RenderBox::addVisualEffectOverflow()
4144 { 4146 {
4145 if (!style()->boxShadow() && !style()->hasBorderImageOutsets() && !style()-> hasOutline()) 4147 if (!style()->hasVisualOverflowingEffect())
4146 return; 4148 return;
4147 4149
4148 bool isFlipped = style()->isFlippedBlocksWritingMode(); 4150 bool isFlipped = style()->isFlippedBlocksWritingMode();
4149 bool isHorizontal = isHorizontalWritingMode(); 4151 bool isHorizontal = isHorizontalWritingMode();
4150 4152
4151 LayoutRect borderBox = borderBoxRect(); 4153 LayoutRect borderBox = borderBoxRect();
4152 LayoutUnit overflowMinX = borderBox.x(); 4154 LayoutUnit overflowMinX = borderBox.x();
4153 LayoutUnit overflowMaxX = borderBox.maxX(); 4155 LayoutUnit overflowMaxX = borderBox.maxX();
4154 LayoutUnit overflowMinY = borderBox.y(); 4156 LayoutUnit overflowMinY = borderBox.y();
4155 LayoutUnit overflowMaxY = borderBox.maxY(); 4157 LayoutUnit overflowMaxY = borderBox.maxY();
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
4685 return 0; 4687 return 0;
4686 4688
4687 if (!layoutState && !flowThreadContainingBlock()) 4689 if (!layoutState && !flowThreadContainingBlock())
4688 return 0; 4690 return 0;
4689 4691
4690 RenderBlock* containerBlock = containingBlock(); 4692 RenderBlock* containerBlock = containingBlock();
4691 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); 4693 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop();
4692 } 4694 }
4693 4695
4694 } // namespace WebCore 4696 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698