Chromium Code Reviews| 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 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1540 } | 1540 } |
| 1541 | 1541 |
| 1542 layerRenderer->invalidatePaintRectangle(geometry.destRect()); | 1542 layerRenderer->invalidatePaintRectangle(geometry.destRect()); |
| 1543 if (geometry.destRect() == rendererRect) | 1543 if (geometry.destRect() == rendererRect) |
| 1544 return true; | 1544 return true; |
| 1545 } | 1545 } |
| 1546 } | 1546 } |
| 1547 return false; | 1547 return false; |
| 1548 } | 1548 } |
| 1549 | 1549 |
| 1550 void RenderBox::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvali dationState) | |
| 1551 { | |
| 1552 // FIXME: Currently only using this logic for RenderBox and its ilk. Ideally , RenderBlockFlows with | |
| 1553 // inline children should track a dirty rect in local coordinates for dirty lines instead of invalidating | |
| 1554 // the world. | |
| 1555 // FIXME: We should still be recursing through inline's children, as they ca n have boxes, but we don't | |
| 1556 // appear to have tests for this? | |
| 1557 // FIXME: SVG should probably also go through this unified paint invalidatio n system. | |
| 1558 ASSERT(!needsLayout()); | |
| 1559 | |
| 1560 if (!shouldCheckForPaintInvalidation()) | |
| 1561 return; | |
| 1562 | |
| 1563 bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer (); | |
| 1564 const RenderLayerModelObject& newPaintInvalidationContainer = *adjustComposi tedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this : &paintInvalidationState.paintInvalidationContainer()); | |
| 1565 ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation()); | |
| 1566 | |
| 1567 invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContaine r); | |
| 1568 | |
| 1569 // This is for the next invalidatePaintIfNeeded so must be after invalidateP aintIfNeeded. | |
| 1570 savePreviousBorderBoxSizeIfNeeded(); | |
| 1571 | |
| 1572 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new PaintInvalidationContainer); | |
| 1573 RenderObject::invalidateTreeIfNeeded(childTreeWalkState); | |
| 1574 } | |
| 1575 | |
| 1576 void RenderBox::invalidatePaintIfNeeded(const PaintInvalidationState& paintInval idationState, const RenderLayerModelObject& newPaintInvalidationContainer) | 1550 void RenderBox::invalidatePaintIfNeeded(const PaintInvalidationState& paintInval idationState, const RenderLayerModelObject& newPaintInvalidationContainer) |
| 1577 { | 1551 { |
| 1578 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); | 1552 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); |
| 1579 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi onFromPaintInvalidationContainer(); | 1553 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi onFromPaintInvalidationContainer(); |
| 1580 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv alidationContainer, &paintInvalidationState)); | 1554 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv alidationContainer, &paintInvalidationState)); |
| 1581 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati onState)); | 1555 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati onState)); |
| 1582 | 1556 |
| 1583 // If we are set to do a full paint invalidation that means the RenderView w ill be | 1557 // If we are set to do a full paint invalidation that means the RenderView w ill be |
| 1584 // issue paint invalidations. We can then skip issuing of paint invalidation s for the child | 1558 // issue paint invalidations. We can then skip issuing of paint invalidation s for the child |
| 1585 // renderers as they'll be covered by the RenderView. | 1559 // renderers as they'll be covered by the RenderView. |
| 1586 if (view()->doingFullPaintInvalidation()) | 1560 if (!view()->doingFullPaintInvalidation()) { |
| 1587 return; | 1561 if ((onlyNeededPositionedMovementLayout() && compositingState() != Paint sIntoOwnBacking) |
| 1562 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer() | |
| 1563 && hasLayer() | |
| 1564 && layer()->isSelfPaintingLayer())) { | |
| 1565 setShouldDoFullPaintInvalidation(true, MarkOnlyThis); | |
| 1566 } | |
| 1588 | 1567 |
| 1589 if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsInt oOwnBacking) | 1568 if (!RenderObject::invalidatePaintIfNeeded(newPaintInvalidationContainer , oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInva lidationState)) |
| 1590 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer() | 1569 invalidatePaintForOverflowIfNeeded(); |
| 1591 && hasLayer() | 1570 |
| 1592 && layer()->isSelfPaintingLayer())) { | 1571 // Issue paint invalidations for any scrollbars if there is a scrollable area for this renderer. |
| 1593 setShouldDoFullPaintInvalidation(true, MarkOnlyThis); | 1572 if (enclosingLayer()) { |
| 1573 if (RenderLayerScrollableArea* area = enclosingLayer()->scrollableAr ea()) { | |
| 1574 if (area->hasVerticalBarDamage()) | |
| 1575 invalidatePaintRectangle(area->verticalBarDamage()); | |
| 1576 if (area->hasHorizontalBarDamage()) | |
| 1577 invalidatePaintRectangle(area->horizontalBarDamage()); | |
| 1578 area->resetScrollbarDamage(); | |
| 1579 } | |
| 1580 } | |
| 1594 } | 1581 } |
| 1595 | 1582 |
| 1596 if (!RenderObject::invalidatePaintIfNeeded(newPaintInvalidationContainer, ol dPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInvalida tionState)) | 1583 savePreviousBorderBoxSizeIfNeeded(); |
|
dsinclair
2014/08/05 15:09:47
Should we keep the comment that this has to be aft
leviw_travelin_and_unemployed
2014/08/05 22:34:44
Done.
| |
| 1597 invalidatePaintForOverflowIfNeeded(); | |
| 1598 | |
| 1599 // Issue paint invalidations for any scrollbars if there is a scrollable are a for this renderer. | |
| 1600 if (enclosingLayer()) { | |
| 1601 if (RenderLayerScrollableArea* area = enclosingLayer()->scrollableArea() ) { | |
| 1602 if (area->hasVerticalBarDamage()) | |
| 1603 invalidatePaintRectangle(area->verticalBarDamage()); | |
| 1604 if (area->hasHorizontalBarDamage()) | |
| 1605 invalidatePaintRectangle(area->horizontalBarDamage()); | |
| 1606 area->resetScrollbarDamage(); | |
| 1607 } | |
| 1608 } | |
| 1609 } | 1584 } |
| 1610 | 1585 |
| 1611 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu latedOffset, ContentsClipBehavior contentsClipBehavior) | 1586 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu latedOffset, ContentsClipBehavior contentsClipBehavior) |
| 1612 { | 1587 { |
| 1613 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == Paint PhaseSelfOutline || paintInfo.phase == PaintPhaseMask) | 1588 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == Paint PhaseSelfOutline || paintInfo.phase == PaintPhaseMask) |
| 1614 return false; | 1589 return false; |
| 1615 | 1590 |
| 1616 bool isControlClip = hasControlClip(); | 1591 bool isControlClip = hasControlClip(); |
| 1617 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); | 1592 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); |
| 1618 | 1593 |
| (...skipping 3060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4679 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) | 4654 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) |
| 4680 { | 4655 { |
| 4681 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor); | 4656 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor); |
| 4682 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); | 4657 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); |
| 4683 ASSERT(hasBackground == style.hasBackground()); | 4658 ASSERT(hasBackground == style.hasBackground()); |
| 4684 hasBorder = style.hasBorder(); | 4659 hasBorder = style.hasBorder(); |
| 4685 hasAppearance = style.hasAppearance(); | 4660 hasAppearance = style.hasAppearance(); |
| 4686 } | 4661 } |
| 4687 | 4662 |
| 4688 } // namespace blink | 4663 } // namespace blink |
| OLD | NEW |