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 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1539 } | 1539 } |
1540 | 1540 |
1541 layerRenderer->repaintRectangle(geometry.destRect()); | 1541 layerRenderer->repaintRectangle(geometry.destRect()); |
1542 if (geometry.destRect() == rendererRect) | 1542 if (geometry.destRect() == rendererRect) |
1543 return true; | 1543 return true; |
1544 } | 1544 } |
1545 } | 1545 } |
1546 return false; | 1546 return false; |
1547 } | 1547 } |
1548 | 1548 |
1549 void RenderBox::repaintTreeAfterLayout() | 1549 void RenderBox::repaintTreeAfterLayout(RenderLayerModelObject& repaintContainer) |
1550 { | 1550 { |
1551 // FIXME: Currently only using this logic for RenderBox and its ilk. Ideally , RenderBlockFlows with | 1551 // FIXME: Currently only using this logic for RenderBox and its ilk. Ideally , RenderBlockFlows with |
1552 // inline children should track a dirty rect in local coordinates for dirty lines instead of repainting | 1552 // inline children should track a dirty rect in local coordinates for dirty lines instead of repainting |
1553 // the world. | 1553 // the world. |
1554 // FIXME: We should still be recursing through inline's children, as they ca n have boxes, but we don't | 1554 // FIXME: We should still be recursing through inline's children, as they ca n have boxes, but we don't |
1555 // appear to have tests for this? | 1555 // appear to have tests for this? |
1556 // FIXME: SVG should probably also go through this unified repaint system. | 1556 // FIXME: SVG should probably also go through this unified repaint system. |
1557 | 1557 |
1558 ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled()); | 1558 ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled()); |
1559 ASSERT(!needsLayout()); | 1559 ASSERT(!needsLayout()); |
1560 | 1560 |
1561 if (!shouldCheckForInvalidationAfterLayout()) | 1561 if (!shouldCheckForInvalidationAfterLayout()) |
1562 return; | 1562 return; |
1563 | 1563 |
1564 bool establishesNewRepaintContainer = isRepaintContainer(); | |
1565 RenderLayerModelObject& newRepaintContainer = *adjustCompositedContainerForS pecialAncestors(establishesNewRepaintContainer ? this : &repaintContainer); | |
1566 // FIXME: This assert should be re-enabled when we move repaint to after com positing update. crbug.com/360286 | |
1567 // ASSERT(&newRepaintContainer == containerForRepaint()); | |
1568 | |
1564 const LayoutRect oldRepaintRect = previousRepaintRect(); | 1569 const LayoutRect oldRepaintRect = previousRepaintRect(); |
1565 const LayoutPoint oldPositionFromRepaintContainer = previousPositionFromRepa intContainer(); | 1570 const LayoutPoint oldPositionFromRepaintContainer = previousPositionFromRepa intContainer(); |
1566 RenderLayerModelObject* repaintContainer = containerForRepaint(); | 1571 setPreviousRepaintRect(clippedOverflowRectForRepaint(&newRepaintContainer)); |
1567 setPreviousRepaintRect(clippedOverflowRectForRepaint(repaintContainer)); | 1572 setPreviousPositionFromRepaintContainer(positionFromRepaintContainer(&newRep aintContainer)); |
1568 setPreviousPositionFromRepaintContainer(positionFromRepaintContainer(repaint Container)); | |
1569 | 1573 |
1570 // If we are set to do a full repaint that means the RenderView will be | 1574 // If we are set to do a full repaint that means the RenderView will be |
1571 // invalidated. We can then skip issuing of invalidations for the child | 1575 // invalidated. We can then skip issuing of invalidations for the child |
1572 // renderers as they'll be covered by the RenderView. | 1576 // renderers as they'll be covered by the RenderView. |
1573 if (view()->doingFullRepaint() && this != view()) { | 1577 if (view()->doingFullRepaint() && this != view()) { |
1574 LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : l ocationOffset()); | 1578 // FIXME: LayoutState should be enabled for other repaint containers tha n the RenderView. crbug.com/363834 |
1575 RenderObject::repaintTreeAfterLayout(); | 1579 if (establishesNewRepaintContainer) { |
1580 LayoutStateDisabler disabler(*this); | |
1581 RenderObject::repaintTreeAfterLayout(newRepaintContainer); | |
1582 } else { | |
1583 LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : locationOffset()); | |
1584 RenderObject::repaintTreeAfterLayout(newRepaintContainer); | |
1585 } | |
1576 return; | 1586 return; |
1577 } | 1587 } |
1578 | 1588 |
1579 if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsInt oOwnBacking) | 1589 if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsInt oOwnBacking) |
1580 || (shouldDoFullRepaintIfSelfPaintingLayer() | 1590 || (shouldDoFullRepaintIfSelfPaintingLayer() |
1581 && hasLayer() | 1591 && hasLayer() |
1582 && layer()->isSelfPaintingLayer())) { | 1592 && layer()->isSelfPaintingLayer())) { |
1583 setShouldDoFullRepaintAfterLayout(true); | 1593 setShouldDoFullRepaintAfterLayout(true); |
1584 } | 1594 } |
1585 | 1595 |
1586 const LayoutRect& newRepaintRect = previousRepaintRect(); | 1596 const LayoutRect& newRepaintRect = previousRepaintRect(); |
1587 const LayoutPoint& newPositionFromRepaintContainer = previousPositionFromRep aintContainer(); | 1597 const LayoutPoint& newPositionFromRepaintContainer = previousPositionFromRep aintContainer(); |
1588 bool didFullRepaint = repaintAfterLayoutIfNeeded(containerForRepaint(), | 1598 bool didFullRepaint = repaintAfterLayoutIfNeeded(&newRepaintContainer, |
1589 shouldDoFullRepaintAfterLayout(), oldRepaintRect, oldPositionFromRepaint Container, &newRepaintRect, &newPositionFromRepaintContainer); | 1599 shouldDoFullRepaintAfterLayout(), oldRepaintRect, oldPositionFromRepaint Container, &newRepaintRect, &newPositionFromRepaintContainer); |
1590 | 1600 |
1591 if (!didFullRepaint) | 1601 if (!didFullRepaint) |
1592 repaintOverflowIfNeeded(); | 1602 repaintOverflowIfNeeded(); |
1593 | 1603 |
1594 // Repaint any scrollbars if there is a scrollable area for this renderer. | 1604 // Repaint any scrollbars if there is a scrollable area for this renderer. |
1595 if (enclosingLayer()) { | 1605 if (enclosingLayer()) { |
1596 if (RenderLayerScrollableArea* area = enclosingLayer()->scrollableArea() ) { | 1606 if (RenderLayerScrollableArea* area = enclosingLayer()->scrollableArea() ) { |
1597 if (area->hasVerticalBarDamage()) | 1607 if (area->hasVerticalBarDamage()) |
1598 repaintRectangle(area->verticalBarDamage()); | 1608 repaintRectangle(area->verticalBarDamage()); |
1599 if (area->hasHorizontalBarDamage()) | 1609 if (area->hasHorizontalBarDamage()) |
1600 repaintRectangle(area->horizontalBarDamage()); | 1610 repaintRectangle(area->horizontalBarDamage()); |
1601 area->resetScrollbarDamage(); | 1611 area->resetScrollbarDamage(); |
1602 } | 1612 } |
1603 } | 1613 } |
1604 | 1614 |
1605 // FIXME: This concept of a tree walking state for fast lookups should be ge neralized away from | 1615 // FIXME: LayoutState should be enabled for other repaint containers than th e RenderView. crbug.com/363834 |
Julien - ping for review
2014/05/07 17:50:03
I choked on this line but Levi pointed out that we
leviw_travelin_and_unemployed
2014/05/07 17:58:48
As we discussed, I have a plan to fix this (which
| |
1606 // just layout. | 1616 if (establishesNewRepaintContainer) { |
1607 // FIXME: Table rows shouldn't be special-cased. | 1617 LayoutStateDisabler disabler(*this); |
1608 LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : locat ionOffset()); | 1618 RenderObject::repaintTreeAfterLayout(newRepaintContainer); |
1609 RenderObject::repaintTreeAfterLayout(); | 1619 } else { |
1620 // FIXME: This concept of a tree walking state for fast lookups should b e generalized away from | |
1621 // just layout. | |
1622 // FIXME: Table rows shouldn't be special-cased. | |
1623 LayoutStateMaintainer statePusher(*this, isTableRow() ? LayoutSize() : l ocationOffset()); | |
1624 RenderObject::repaintTreeAfterLayout(newRepaintContainer); | |
1625 } | |
1610 } | 1626 } |
1611 | 1627 |
1612 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu latedOffset, ContentsClipBehavior contentsClipBehavior) | 1628 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu latedOffset, ContentsClipBehavior contentsClipBehavior) |
1613 { | 1629 { |
1614 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == Paint PhaseSelfOutline || paintInfo.phase == PaintPhaseMask) | 1630 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == Paint PhaseSelfOutline || paintInfo.phase == PaintPhaseMask) |
1615 return false; | 1631 return false; |
1616 | 1632 |
1617 bool isControlClip = hasControlClip(); | 1633 bool isControlClip = hasControlClip(); |
1618 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); | 1634 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); |
1619 | 1635 |
(...skipping 3049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4669 return 0; | 4685 return 0; |
4670 | 4686 |
4671 if (!layoutState && !flowThreadContainingBlock()) | 4687 if (!layoutState && !flowThreadContainingBlock()) |
4672 return 0; | 4688 return 0; |
4673 | 4689 |
4674 RenderBlock* containerBlock = containingBlock(); | 4690 RenderBlock* containerBlock = containingBlock(); |
4675 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4691 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
4676 } | 4692 } |
4677 | 4693 |
4678 } // namespace WebCore | 4694 } // namespace WebCore |
OLD | NEW |