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 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 return invalidationRect; | 1510 return invalidationRect; |
1511 } | 1511 } |
1512 | 1512 |
1513 void LayoutObject::adjustPreviousPaintInvalidationForScrollIfNeeded(const Double
Size& scrollDelta) | 1513 void LayoutObject::adjustPreviousPaintInvalidationForScrollIfNeeded(const Double
Size& scrollDelta) |
1514 { | 1514 { |
1515 if (containerForPaintInvalidation().usesCompositedScrolling()) | 1515 if (containerForPaintInvalidation().usesCompositedScrolling()) |
1516 return; | 1516 return; |
1517 m_previousPaintInvalidationRect.move(LayoutSize(scrollDelta)); | 1517 m_previousPaintInvalidationRect.move(LayoutSize(scrollDelta)); |
1518 } | 1518 } |
1519 | 1519 |
| 1520 void LayoutObject::clearPreviousPaintInvalidationRects() |
| 1521 { |
| 1522 setPreviousPaintInvalidationRect(LayoutRect()); |
| 1523 } |
| 1524 |
1520 void LayoutObject::incrementallyInvalidatePaint(const LayoutBoxModelObject& pain
tInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds
, const LayoutPoint& positionFromPaintInvalidationBacking) | 1525 void LayoutObject::incrementallyInvalidatePaint(const LayoutBoxModelObject& pain
tInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds
, const LayoutPoint& positionFromPaintInvalidationBacking) |
1521 { | 1526 { |
1522 ASSERT(oldBounds.location() == newBounds.location()); | 1527 ASSERT(oldBounds.location() == newBounds.location()); |
1523 | 1528 |
1524 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX(); | 1529 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX(); |
1525 if (deltaRight > 0) { | 1530 if (deltaRight > 0) { |
1526 LayoutRect invalidationRect(oldBounds.maxX(), newBounds.y(), deltaRight,
newBounds.height()); | 1531 LayoutRect invalidationRect(oldBounds.maxX(), newBounds.y(), deltaRight,
newBounds.height()); |
1527 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInva
lidationContainer); | 1532 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInva
lidationContainer); |
1528 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe
ct, PaintInvalidationIncremental); | 1533 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe
ct, PaintInvalidationIncremental); |
1529 } else if (deltaRight < 0) { | 1534 } else if (deltaRight < 0) { |
(...skipping 1886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3416 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect,
PaintInvalidationLayer); | 3421 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect,
PaintInvalidationLayer); |
3417 | 3422 |
3418 // The PaintController may have changed. Pass the previous paint invalidatio
n rect to the new PaintController. | 3423 // The PaintController may have changed. Pass the previous paint invalidatio
n rect to the new PaintController. |
3419 // The rect will be updated if it changes during the next paint invalidation
. | 3424 // The rect will be updated if it changes during the next paint invalidation
. |
3420 invalidateDisplayItemClients(paintInvalidationContainer, PaintInvalidationLa
yer, &invalidationRect); | 3425 invalidateDisplayItemClients(paintInvalidationContainer, PaintInvalidationLa
yer, &invalidationRect); |
3421 | 3426 |
3422 // This method may be used to invalidate paint of an object changing paint i
nvalidation container. | 3427 // This method may be used to invalidate paint of an object changing paint i
nvalidation container. |
3423 // Clear previous paint invalidation rect on the original paint invalidation
container to avoid | 3428 // Clear previous paint invalidation rect on the original paint invalidation
container to avoid |
3424 // under-invalidation if the new paint invalidation rect on the new paint in
validation container | 3429 // under-invalidation if the new paint invalidation rect on the new paint in
validation container |
3425 // happens to be the same as the old one. | 3430 // happens to be the same as the old one. |
3426 setPreviousPaintInvalidationRect(LayoutRect()); | 3431 clearPreviousPaintInvalidationRects(); |
3427 } | 3432 } |
3428 | 3433 |
3429 void LayoutObject::invalidatePaintIncludingNonCompositingDescendants() | 3434 void LayoutObject::invalidatePaintIncludingNonCompositingDescendants() |
3430 { | 3435 { |
3431 // Since we're only painting non-composited layers, we know that they all sh
are the same paintInvalidationContainer. | 3436 // Since we're only painting non-composited layers, we know that they all sh
are the same paintInvalidationContainer. |
3432 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn
validation(); | 3437 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn
validation(); |
3433 traverseNonCompositingDescendants(*this, [&paintInvalidationContainer](Layou
tObject& object) { | 3438 traverseNonCompositingDescendants(*this, [&paintInvalidationContainer](Layou
tObject& object) { |
3434 object.invalidatePaintOfPreviousPaintInvalidationRect(paintInvalidationC
ontainer, PaintInvalidationLayer); | 3439 object.invalidatePaintOfPreviousPaintInvalidationRect(paintInvalidationC
ontainer, PaintInvalidationLayer); |
3435 }); | 3440 }); |
3436 } | 3441 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3515 const blink::LayoutObject* root = object1; | 3520 const blink::LayoutObject* root = object1; |
3516 while (root->parent()) | 3521 while (root->parent()) |
3517 root = root->parent(); | 3522 root = root->parent(); |
3518 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3523 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3519 } else { | 3524 } else { |
3520 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3525 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
3521 } | 3526 } |
3522 } | 3527 } |
3523 | 3528 |
3524 #endif | 3529 #endif |
OLD | NEW |