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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 if (PaintLayer* paintingLayer = this->paintingLayer()) | 1252 if (PaintLayer* paintingLayer = this->paintingLayer()) |
1253 paintingLayer->setNeedsRepaint(); | 1253 paintingLayer->setNeedsRepaint(); |
1254 } | 1254 } |
1255 | 1255 |
1256 void LayoutObject::invalidateDisplayItemClients(const LayoutBoxModelObject& pain
tInvalidationContainer, PaintInvalidationReason invalidationReason) const | 1256 void LayoutObject::invalidateDisplayItemClients(const LayoutBoxModelObject& pain
tInvalidationContainer, PaintInvalidationReason invalidationReason) const |
1257 { | 1257 { |
1258 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs
Repaint is set. | 1258 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs
Repaint is set. |
1259 // Don't set the flag here because getting enclosingSelfPaintLayer has cost
and the caller can use | 1259 // Don't set the flag here because getting enclosingSelfPaintLayer has cost
and the caller can use |
1260 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t
o reduce the cost. | 1260 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t
o reduce the cost. |
1261 ASSERT(!paintingLayer() || paintingLayer()->needsRepaint()); | 1261 ASSERT(!paintingLayer() || paintingLayer()->needsRepaint()); |
1262 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*this, inval
idationReason, this); | 1262 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*this, inval
idationReason); |
1263 } | 1263 } |
1264 | 1264 |
1265 void LayoutObject::invalidateDisplayItemClientsWithPaintInvalidationState(const
LayoutBoxModelObject& paintInvalidationContainer, const PaintInvalidationState&
paintInvalidationState, PaintInvalidationReason invalidationReason) const | 1265 void LayoutObject::invalidateDisplayItemClientsWithPaintInvalidationState(const
LayoutBoxModelObject& paintInvalidationContainer, const PaintInvalidationState&
paintInvalidationState, PaintInvalidationReason invalidationReason) const |
1266 { | 1266 { |
1267 paintInvalidationState.paintingLayer().setNeedsRepaint(); | 1267 paintInvalidationState.paintingLayer().setNeedsRepaint(); |
1268 invalidateDisplayItemClients(paintInvalidationContainer, invalidationReason)
; | 1268 invalidateDisplayItemClients(paintInvalidationContainer, invalidationReason)
; |
1269 } | 1269 } |
1270 | 1270 |
1271 const LayoutBoxModelObject* LayoutObject::invalidatePaintRectangleInternal(const
LayoutRect& dirtyRect) const | 1271 const LayoutBoxModelObject* LayoutObject::invalidatePaintRectangleInternal(const
LayoutRect& dirtyRect) const |
1272 { | 1272 { |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1553 setPreviousPaintInvalidationRect(LayoutRect()); | 1553 setPreviousPaintInvalidationRect(LayoutRect()); |
1554 } | 1554 } |
1555 | 1555 |
1556 void LayoutObject::incrementallyInvalidatePaint(const LayoutBoxModelObject& pain
tInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds
, const LayoutPoint& positionFromPaintInvalidationBacking) | 1556 void LayoutObject::incrementallyInvalidatePaint(const LayoutBoxModelObject& pain
tInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds
, const LayoutPoint& positionFromPaintInvalidationBacking) |
1557 { | 1557 { |
1558 ASSERT(oldBounds.location() == newBounds.location()); | 1558 ASSERT(oldBounds.location() == newBounds.location()); |
1559 | 1559 |
1560 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX(); | 1560 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX(); |
1561 if (deltaRight > 0) { | 1561 if (deltaRight > 0) { |
1562 LayoutRect invalidationRect(oldBounds.maxX(), newBounds.y(), deltaRight,
newBounds.height()); | 1562 LayoutRect invalidationRect(oldBounds.maxX(), newBounds.y(), deltaRight,
newBounds.height()); |
| 1563 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInva
lidationContainer); |
1563 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe
ct, PaintInvalidationIncremental); | 1564 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe
ct, PaintInvalidationIncremental); |
1564 } else if (deltaRight < 0) { | 1565 } else if (deltaRight < 0) { |
1565 LayoutRect invalidationRect(newBounds.maxX(), oldBounds.y(), -deltaRight
, oldBounds.height()); | 1566 LayoutRect invalidationRect(newBounds.maxX(), oldBounds.y(), -deltaRight
, oldBounds.height()); |
| 1567 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInva
lidationContainer); |
1566 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe
ct, PaintInvalidationIncremental); | 1568 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe
ct, PaintInvalidationIncremental); |
1567 } | 1569 } |
1568 | 1570 |
1569 LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY(); | 1571 LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY(); |
1570 if (deltaBottom > 0) { | 1572 if (deltaBottom > 0) { |
1571 LayoutRect invalidationRect(newBounds.x(), oldBounds.maxY(), newBounds.w
idth(), deltaBottom); | 1573 LayoutRect invalidationRect(newBounds.x(), oldBounds.maxY(), newBounds.w
idth(), deltaBottom); |
| 1574 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInva
lidationContainer); |
1572 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe
ct, PaintInvalidationIncremental); | 1575 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe
ct, PaintInvalidationIncremental); |
1573 } else if (deltaBottom < 0) { | 1576 } else if (deltaBottom < 0) { |
1574 LayoutRect invalidationRect(oldBounds.x(), newBounds.maxY(), oldBounds.w
idth(), -deltaBottom); | 1577 LayoutRect invalidationRect(oldBounds.x(), newBounds.maxY(), oldBounds.w
idth(), -deltaBottom); |
| 1578 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInva
lidationContainer); |
1575 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe
ct, PaintInvalidationIncremental); | 1579 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe
ct, PaintInvalidationIncremental); |
1576 } | 1580 } |
1577 } | 1581 } |
1578 | 1582 |
1579 void LayoutObject::fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalid
ationContainer, PaintInvalidationReason invalidationReason, const LayoutRect& ol
dBounds, const LayoutRect& newBounds) | 1583 void LayoutObject::fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalid
ationContainer, PaintInvalidationReason invalidationReason, const LayoutRect& ol
dBounds, const LayoutRect& newBounds) |
1580 { | 1584 { |
1581 // The following logic avoids invalidating twice if one set of bounds contai
ns the other. | 1585 // The following logic avoids invalidating twice if one set of bounds contai
ns the other. |
1582 if (!newBounds.contains(oldBounds)) { | 1586 if (!newBounds.contains(oldBounds)) { |
1583 LayoutRect invalidationRect = oldBounds; | 1587 LayoutRect invalidationRect = oldBounds; |
| 1588 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInva
lidationContainer); |
1584 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe
ct, invalidationReason); | 1589 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe
ct, invalidationReason); |
1585 | 1590 |
1586 if (oldBounds.contains(newBounds)) | 1591 if (oldBounds.contains(newBounds)) |
1587 return; | 1592 return; |
1588 } | 1593 } |
1589 | 1594 |
1590 LayoutRect invalidationRect = newBounds; | 1595 LayoutRect invalidationRect = newBounds; |
| 1596 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInvalida
tionContainer); |
1591 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect,
invalidationReason); | 1597 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect,
invalidationReason); |
1592 } | 1598 } |
1593 | 1599 |
1594 void LayoutObject::invalidatePaintForOverflow() | 1600 void LayoutObject::invalidatePaintForOverflow() |
1595 { | 1601 { |
1596 } | 1602 } |
1597 | 1603 |
1598 void LayoutObject::invalidatePaintForOverflowIfNeeded() | 1604 void LayoutObject::invalidatePaintForOverflowIfNeeded() |
1599 { | 1605 { |
1600 if (shouldInvalidateOverflowForPaint()) | 1606 if (shouldInvalidateOverflowForPaint()) |
(...skipping 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3571 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs
Repaint is set. | 3577 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs
Repaint is set. |
3572 // Don't set the flag here because getting enclosingSelfPaintLayer has cost
and the caller can use | 3578 // Don't set the flag here because getting enclosingSelfPaintLayer has cost
and the caller can use |
3573 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t
o reduce the cost. | 3579 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t
o reduce the cost. |
3574 ASSERT(!paintingLayer() || paintingLayer()->needsRepaint()); | 3580 ASSERT(!paintingLayer() || paintingLayer()->needsRepaint()); |
3575 | 3581 |
3576 // These disablers are valid because we want to use the current compositing/
invalidation status. | 3582 // These disablers are valid because we want to use the current compositing/
invalidation status. |
3577 DisablePaintInvalidationStateAsserts invalidationDisabler; | 3583 DisablePaintInvalidationStateAsserts invalidationDisabler; |
3578 DisableCompositingQueryAsserts compositingDisabler; | 3584 DisableCompositingQueryAsserts compositingDisabler; |
3579 | 3585 |
3580 LayoutRect invalidationRect = previousPaintInvalidationRect(); | 3586 LayoutRect invalidationRect = previousPaintInvalidationRect(); |
| 3587 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInvalida
tionContainer); |
3581 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect,
reason); | 3588 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect,
reason); |
3582 invalidateDisplayItemClients(paintInvalidationContainer, reason); | 3589 invalidateDisplayItemClients(paintInvalidationContainer, reason); |
3583 | 3590 |
3584 // This method may be used to invalidate paint of an object changing paint i
nvalidation container. | 3591 // This method may be used to invalidate paint of an object changing paint i
nvalidation container. |
3585 // Clear previous paint invalidation rect on the original paint invalidation
container to avoid | 3592 // Clear previous paint invalidation rect on the original paint invalidation
container to avoid |
3586 // under-invalidation if the new paint invalidation rect on the new paint in
validation container | 3593 // under-invalidation if the new paint invalidation rect on the new paint in
validation container |
3587 // happens to be the same as the old one. | 3594 // happens to be the same as the old one. |
3588 clearPreviousPaintInvalidationRects(); | 3595 clearPreviousPaintInvalidationRects(); |
3589 } | 3596 } |
3590 | 3597 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3687 const blink::LayoutObject* root = object1; | 3694 const blink::LayoutObject* root = object1; |
3688 while (root->parent()) | 3695 while (root->parent()) |
3689 root = root->parent(); | 3696 root = root->parent(); |
3690 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3697 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3691 } else { | 3698 } else { |
3692 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3699 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
3693 } | 3700 } |
3694 } | 3701 } |
3695 | 3702 |
3696 #endif | 3703 #endif |
OLD | NEW |