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 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1550 void RenderBox::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvali
dationState) | 1550 void RenderBox::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvali
dationState) |
1551 { | 1551 { |
1552 // FIXME: Currently only using this logic for RenderBox and its ilk. Ideally
, RenderBlockFlows with | 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 | 1553 // inline children should track a dirty rect in local coordinates for dirty
lines instead of invalidating |
1554 // the world. | 1554 // the world. |
1555 // FIXME: We should still be recursing through inline's children, as they ca
n have boxes, but we don't | 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? | 1556 // appear to have tests for this? |
1557 // FIXME: SVG should probably also go through this unified paint invalidatio
n system. | 1557 // FIXME: SVG should probably also go through this unified paint invalidatio
n system. |
1558 ASSERT(!needsLayout()); | 1558 ASSERT(!needsLayout()); |
1559 | 1559 |
1560 if (!shouldCheckForPaintInvalidation()) | 1560 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) |
1561 return; | 1561 return; |
1562 | 1562 |
1563 bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer
(); | 1563 bool establishesNewPaintInvalidationContainer = isPaintInvalidationContainer
(); |
1564 const RenderLayerModelObject& newPaintInvalidationContainer = *adjustComposi
tedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this
: &paintInvalidationState.paintInvalidationContainer()); | 1564 const RenderLayerModelObject& newPaintInvalidationContainer = *adjustComposi
tedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? this
: &paintInvalidationState.paintInvalidationContainer()); |
1565 ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation()); | 1565 ASSERT(&newPaintInvalidationContainer == containerForPaintInvalidation()); |
1566 | 1566 |
1567 invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContaine
r); | 1567 InvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState,
newPaintInvalidationContainer); |
1568 | 1568 |
1569 // This is for the next invalidatePaintIfNeeded so must be after invalidateP
aintIfNeeded. | 1569 // This is for the next invalidatePaintIfNeeded so must be after invalidateP
aintIfNeeded. |
1570 savePreviousBorderBoxSizeIfNeeded(); | 1570 savePreviousBorderBoxSizeIfNeeded(); |
1571 | 1571 |
1572 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new
PaintInvalidationContainer); | 1572 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, new
PaintInvalidationContainer); |
| 1573 if (reason == InvalidationLocationChange || reason == InvalidationFull) |
| 1574 childTreeWalkState.setForceCheckForPaintInvalidation(); |
1573 RenderObject::invalidateTreeIfNeeded(childTreeWalkState); | 1575 RenderObject::invalidateTreeIfNeeded(childTreeWalkState); |
1574 } | 1576 } |
1575 | 1577 |
1576 void RenderBox::invalidatePaintIfNeeded(const PaintInvalidationState& paintInval
idationState, const RenderLayerModelObject& newPaintInvalidationContainer) | 1578 InvalidationReason RenderBox::invalidatePaintIfNeeded(const PaintInvalidationSta
te& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidationCo
ntainer) |
1577 { | 1579 { |
1578 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); | 1580 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); |
1579 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi
onFromPaintInvalidationContainer(); | 1581 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi
onFromPaintInvalidationContainer(); |
1580 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv
alidationContainer, &paintInvalidationState)); | 1582 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv
alidationContainer, &paintInvalidationState)); |
1581 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP
aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati
onState)); | 1583 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP
aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati
onState)); |
1582 | 1584 |
1583 // If we are set to do a full paint invalidation that means the RenderView w
ill be | 1585 // 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 | 1586 // 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. | 1587 // renderers as they'll be covered by the RenderView. |
1586 if (view()->doingFullPaintInvalidation()) | 1588 if (view()->doingFullPaintInvalidation()) |
1587 return; | 1589 return InvalidationNone; |
1588 | 1590 |
1589 if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsInt
oOwnBacking) | 1591 if ((onlyNeededPositionedMovementLayout() && compositingState() != PaintsInt
oOwnBacking) |
1590 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer() | 1592 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer() |
1591 && hasLayer() | 1593 && hasLayer() |
1592 && layer()->isSelfPaintingLayer())) { | 1594 && layer()->isSelfPaintingLayer())) { |
1593 setShouldDoFullPaintInvalidation(true, MarkOnlyThis); | 1595 setShouldDoFullPaintInvalidation(true, MarkOnlyThis); |
1594 } | 1596 } |
1595 | 1597 |
1596 if (!RenderObject::invalidatePaintIfNeeded(newPaintInvalidationContainer, ol
dPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paintInvalida
tionState)) | 1598 InvalidationReason reason = RenderObject::invalidatePaintIfNeeded(newPaintIn
validationContainer, oldPaintInvalidationRect, oldPositionFromPaintInvalidationC
ontainer, paintInvalidationState); |
| 1599 if (reason == InvalidationNone || reason == InvalidationIncremental) |
1597 invalidatePaintForOverflowIfNeeded(); | 1600 invalidatePaintForOverflowIfNeeded(); |
1598 | 1601 |
1599 // Issue paint invalidations for any scrollbars if there is a scrollable are
a for this renderer. | 1602 // Issue paint invalidations for any scrollbars if there is a scrollable are
a for this renderer. |
1600 if (enclosingLayer()) { | 1603 if (RenderLayer* layer = enclosingLayer()) { |
1601 if (RenderLayerScrollableArea* area = enclosingLayer()->scrollableArea()
) { | 1604 if (RenderLayerScrollableArea* area = layer->scrollableArea()) { |
1602 if (area->hasVerticalBarDamage()) | 1605 if (area->hasVerticalBarDamage()) |
1603 invalidatePaintRectangle(area->verticalBarDamage()); | 1606 invalidatePaintRectangle(area->verticalBarDamage()); |
1604 if (area->hasHorizontalBarDamage()) | 1607 if (area->hasHorizontalBarDamage()) |
1605 invalidatePaintRectangle(area->horizontalBarDamage()); | 1608 invalidatePaintRectangle(area->horizontalBarDamage()); |
1606 area->resetScrollbarDamage(); | 1609 area->resetScrollbarDamage(); |
1607 } | 1610 } |
1608 } | 1611 } |
| 1612 |
| 1613 return reason; |
1609 } | 1614 } |
1610 | 1615 |
1611 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu
latedOffset, ContentsClipBehavior contentsClipBehavior) | 1616 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu
latedOffset, ContentsClipBehavior contentsClipBehavior) |
1612 { | 1617 { |
1613 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == Paint
PhaseSelfOutline || paintInfo.phase == PaintPhaseMask) | 1618 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == Paint
PhaseSelfOutline || paintInfo.phase == PaintPhaseMask) |
1614 return false; | 1619 return false; |
1615 | 1620 |
1616 bool isControlClip = hasControlClip(); | 1621 bool isControlClip = hasControlClip(); |
1617 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); | 1622 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); |
1618 | 1623 |
(...skipping 3087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4706 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) | 4711 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) |
4707 { | 4712 { |
4708 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor); | 4713 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor); |
4709 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); | 4714 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); |
4710 ASSERT(hasBackground == style.hasBackground()); | 4715 ASSERT(hasBackground == style.hasBackground()); |
4711 hasBorder = style.hasBorder(); | 4716 hasBorder = style.hasBorder(); |
4712 hasAppearance = style.hasAppearance(); | 4717 hasAppearance = style.hasAppearance(); |
4713 } | 4718 } |
4714 | 4719 |
4715 } // namespace blink | 4720 } // namespace blink |
OLD | NEW |