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

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

Issue 403033002: Extract RenderBox::invalidatePaintIfNeeded() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 ASSERT(!needsLayout()); 1555 ASSERT(!needsLayout());
1556 1556
1557 if (!shouldCheckForPaintInvalidation()) 1557 if (!shouldCheckForPaintInvalidation())
1558 return; 1558 return;
1559 1559
1560 bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer (); 1560 bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer ();
1561 const RenderLayerModelObject& newPaintInvalidationContainer = *adjustComposi tedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer()); 1561 const RenderLayerModelObject& newPaintInvalidationContainer = *adjustComposi tedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer());
1562 // FIXME: This assert should be re-enabled when we move paint invalidation t o after compositing update. crbug.com/360286 1562 // FIXME: This assert should be re-enabled when we move paint invalidation t o after compositing update. crbug.com/360286
1563 // ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation()) ; 1563 // ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation()) ;
1564 1564
1565 invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContaine r);
1566
1567 // This is for the next invalidatePaintIfNeeded so must be after invalidateP aintIfNeeded.
1568 savePreviousBorderBoxSizeIfNeeded();
dsinclair 2014/07/21 17:10:56 Just to verify, this is the ordering we want? It l
Xianzhu 2014/07/21 17:18:54 Yes. saveBorderBoxSizeIfNeeded() is only required
1569
1570 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new PaintInvalidationContainer);
1571 RenderObject::invalidateTreeIfNeeded(childTreeWalkState);
1572 }
1573
1574 void RenderBox::invalidatePaintIfNeeded(const PaintInvalidationState& paintInval idationState, const RenderLayerModelObject& newPaintInvalidationContainer)
1575 {
1565 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); 1576 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect();
1566 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi onFromPaintInvalidationContainer(); 1577 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi onFromPaintInvalidationContainer();
1567 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv alidationContainer, &paintInvalidationState)); 1578 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv alidationContainer, &paintInvalidationState));
1568 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati onState)); 1579 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati onState));
1569 1580
1570 // If we are set to do a full paint invalidation that means the RenderView w ill be 1581 // If we are set to do a full paint invalidation that means the RenderView w ill be
1571 // issue paint invalidations. We can then skip issuing of paint invalidation s for the child 1582 // issue paint invalidations. We can then skip issuing of paint invalidation s for the child
1572 // renderers as they'll be covered by the RenderView. 1583 // renderers as they'll be covered by the RenderView.
1573 if (view()->doingFullRepaint()) { 1584 if (view()->doingFullRepaint())
1574 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, newPaintInvalidationContainer);
1575 RenderObject::invalidateTreeIfNeeded(childTreeWalkState);
1576 // For the next invalidatePaintIfNeeded.
1577 savePreviousBorderBoxSizeIfNeeded();
1578 return; 1585 return;
1579 }
1580 1586
1581 if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsInt oOwnBacking) 1587 if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsInt oOwnBacking)
1582 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer() 1588 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer()
1583 && hasLayer() 1589 && hasLayer()
1584 && layer()->isSelfPaintingLayer())) { 1590 && layer()->isSelfPaintingLayer())) {
1585 setShouldDoFullPaintInvalidation(true); 1591 setShouldDoFullPaintInvalidation(true);
1586 } 1592 }
1587 1593
1588 if (!invalidatePaintIfNeeded(newPaintInvalidationContainer, oldPaintInvalida tionRect, oldPositionFromPaintInvalidationContainer, paintInvalidationState)) 1594 if (!RenderObject::invalidatePaintIfNeeded(newPaintInvalidationContainer, ol dPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInvalida tionState))
1589 invalidatePaintForOverflowIfNeeded(); 1595 invalidatePaintForOverflowIfNeeded();
1590 1596
1591 // This is for the next invalidatePaintIfNeeded so must be after invalidateP aintIfNeeded.
1592 savePreviousBorderBoxSizeIfNeeded();
1593
1594 // Issue paint invalidations for any scrollbars if there is a scrollable are a for this renderer. 1597 // Issue paint invalidations for any scrollbars if there is a scrollable are a for this renderer.
1595 if (enclosingLayer()) { 1598 if (enclosingLayer()) {
1596 if (RenderLayerScrollableArea* area = enclosingLayer()->scrollableArea() ) { 1599 if (RenderLayerScrollableArea* area = enclosingLayer()->scrollableArea() ) {
1597 if (area->hasVerticalBarDamage()) 1600 if (area->hasVerticalBarDamage())
1598 invalidatePaintRectangle(area->verticalBarDamage()); 1601 invalidatePaintRectangle(area->verticalBarDamage());
1599 if (area->hasHorizontalBarDamage()) 1602 if (area->hasHorizontalBarDamage())
1600 invalidatePaintRectangle(area->horizontalBarDamage()); 1603 invalidatePaintRectangle(area->horizontalBarDamage());
1601 area->resetScrollbarDamage(); 1604 area->resetScrollbarDamage();
1602 } 1605 }
1603 } 1606 }
1604
1605 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new PaintInvalidationContainer);
1606 RenderObject::invalidateTreeIfNeeded(childTreeWalkState);
1607 } 1607 }
1608 1608
1609 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu latedOffset, ContentsClipBehavior contentsClipBehavior) 1609 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu latedOffset, ContentsClipBehavior contentsClipBehavior)
1610 { 1610 {
1611 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == Paint PhaseSelfOutline || paintInfo.phase == PaintPhaseMask) 1611 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == Paint PhaseSelfOutline || paintInfo.phase == PaintPhaseMask)
1612 return false; 1612 return false;
1613 1613
1614 bool isControlClip = hasControlClip(); 1614 bool isControlClip = hasControlClip();
1615 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); 1615 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer();
1616 1616
(...skipping 3050 matching lines...) Expand 10 before | Expand all | Expand 10 after
4667 4667
4668 // We need the old border box size only when the box has background or b ox decorations. 4668 // We need the old border box size only when the box has background or b ox decorations.
4669 if (!style()->hasBackground() && !style()->hasBoxDecorations()) 4669 if (!style()->hasBackground() && !style()->hasBoxDecorations())
4670 return; 4670 return;
4671 } 4671 }
4672 4672
4673 ensureRareData().m_previousBorderBoxSize = size(); 4673 ensureRareData().m_previousBorderBoxSize = size();
4674 } 4674 }
4675 4675
4676 } // namespace WebCore 4676 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698