OLD | NEW |
---|---|
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 Loading... | |
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(); | |
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 { | |
1576 if (!shouldCheckForSelfPaintInvalidation()) | |
1577 return; | |
1578 | |
1565 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); | 1579 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); |
1566 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi onFromPaintInvalidationContainer(); | 1580 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi onFromPaintInvalidationContainer(); |
1567 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv alidationContainer, &paintInvalidationState)); | 1581 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv alidationContainer, &paintInvalidationState)); |
1568 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati onState)); | 1582 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati onState)); |
1569 | 1583 |
1570 // If we are set to do a full paint invalidation that means the RenderView w ill be | 1584 // 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 | 1585 // 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. | 1586 // renderers as they'll be covered by the RenderView. |
1573 if (view()->doingFullRepaint()) { | 1587 if (view()->doingFullRepaint()) |
1574 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, newPaintInvalidationContainer); | |
1575 RenderObject::invalidateTreeIfNeeded(childTreeWalkState); | |
1576 // For the next invalidatePaintIfNeeded. | |
1577 savePreviousBorderBoxSizeIfNeeded(); | |
dsinclair
2014/07/17 18:36:01
Does the ordering of these two methods matter? In
Xianzhu
2014/07/17 21:57:34
They are actually equivalent. There were two calls
| |
1578 return; | 1588 return; |
1579 } | |
1580 | 1589 |
1581 if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsInt oOwnBacking) | 1590 if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsInt oOwnBacking) |
1582 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer() | 1591 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer() |
1583 && hasLayer() | 1592 && hasLayer() |
1584 && layer()->isSelfPaintingLayer())) { | 1593 && layer()->isSelfPaintingLayer())) { |
1585 setShouldDoFullPaintInvalidation(true); | 1594 setShouldDoFullPaintInvalidation(true); |
1586 } | 1595 } |
1587 | 1596 |
1588 if (!invalidatePaintIfNeeded(newPaintInvalidationContainer, oldPaintInvalida tionRect, oldPositionFromPaintInvalidationContainer, paintInvalidationState)) | 1597 if (!RenderObject::invalidatePaintIfNeeded(newPaintInvalidationContainer, ol dPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInvalida tionState)) |
1589 invalidatePaintForOverflowIfNeeded(); | 1598 invalidatePaintForOverflowIfNeeded(); |
1590 | 1599 |
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. | 1600 // Issue paint invalidations for any scrollbars if there is a scrollable are a for this renderer. |
1595 if (enclosingLayer()) { | 1601 if (enclosingLayer()) { |
1596 if (RenderLayerScrollableArea* area = enclosingLayer()->scrollableArea() ) { | 1602 if (RenderLayerScrollableArea* area = enclosingLayer()->scrollableArea() ) { |
1597 if (area->hasVerticalBarDamage()) | 1603 if (area->hasVerticalBarDamage()) |
1598 invalidatePaintRectangle(area->verticalBarDamage()); | 1604 invalidatePaintRectangle(area->verticalBarDamage()); |
1599 if (area->hasHorizontalBarDamage()) | 1605 if (area->hasHorizontalBarDamage()) |
1600 invalidatePaintRectangle(area->horizontalBarDamage()); | 1606 invalidatePaintRectangle(area->horizontalBarDamage()); |
1601 area->resetScrollbarDamage(); | 1607 area->resetScrollbarDamage(); |
1602 } | 1608 } |
1603 } | 1609 } |
1604 | |
1605 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new PaintInvalidationContainer); | |
1606 RenderObject::invalidateTreeIfNeeded(childTreeWalkState); | |
1607 } | 1610 } |
1608 | 1611 |
1609 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu latedOffset, ContentsClipBehavior contentsClipBehavior) | 1612 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu latedOffset, ContentsClipBehavior contentsClipBehavior) |
1610 { | 1613 { |
1611 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == Paint PhaseSelfOutline || paintInfo.phase == PaintPhaseMask) | 1614 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == Paint PhaseSelfOutline || paintInfo.phase == PaintPhaseMask) |
1612 return false; | 1615 return false; |
1613 | 1616 |
1614 bool isControlClip = hasControlClip(); | 1617 bool isControlClip = hasControlClip(); |
1615 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); | 1618 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); |
1616 | 1619 |
(...skipping 3008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4625 | 4628 |
4626 // We need the old border box size only when the box has background or b ox decorations. | 4629 // We need the old border box size only when the box has background or b ox decorations. |
4627 if (!style()->hasBackground() && !style()->hasBoxDecorations()) | 4630 if (!style()->hasBackground() && !style()->hasBoxDecorations()) |
4628 return; | 4631 return; |
4629 } | 4632 } |
4630 | 4633 |
4631 ensureRareData().m_previousBorderBoxSize = size(); | 4634 ensureRareData().m_previousBorderBoxSize = size(); |
4632 } | 4635 } |
4633 | 4636 |
4634 } // namespace WebCore | 4637 } // namespace WebCore |
OLD | NEW |