| 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 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1639 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject:
:invalidatePaintIfNeeded()", | 1639 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject:
:invalidatePaintIfNeeded()", |
| 1640 "object", this->debugName().ascii(), | 1640 "object", this->debugName().ascii(), |
| 1641 "info", jsonObjectForOldAndNewRects(oldBounds, newBounds)); | 1641 "info", jsonObjectForOldAndNewRects(oldBounds, newBounds)); |
| 1642 | 1642 |
| 1643 InvalidationReason invalidationReason = getPaintInvalidationReason(paintInva
lidationContainer, oldBounds, oldLocation, newBounds, newLocation); | 1643 InvalidationReason invalidationReason = getPaintInvalidationReason(paintInva
lidationContainer, oldBounds, oldLocation, newBounds, newLocation); |
| 1644 | 1644 |
| 1645 if (invalidationReason == InvalidationNone) | 1645 if (invalidationReason == InvalidationNone) |
| 1646 return false; | 1646 return false; |
| 1647 | 1647 |
| 1648 if (invalidationReason == InvalidationIncremental) { | 1648 if (invalidationReason == InvalidationIncremental) { |
| 1649 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB
ounds); | 1649 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB
ounds, newLocation); |
| 1650 return false; | 1650 return false; |
| 1651 } | 1651 } |
| 1652 | 1652 |
| 1653 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, oldBoun
ds, newBounds); | 1653 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, oldBoun
ds, newBounds); |
| 1654 return true; | 1654 return true; |
| 1655 } | 1655 } |
| 1656 | 1656 |
| 1657 InvalidationReason RenderObject::getPaintInvalidationReason(const RenderLayerMod
elObject& paintInvalidationContainer, | 1657 InvalidationReason RenderObject::getPaintInvalidationReason(const RenderLayerMod
elObject& paintInvalidationContainer, |
| 1658 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec
t& newBounds, const LayoutPoint& newLocation) | 1658 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec
t& newBounds, const LayoutPoint& newLocation) |
| 1659 { | 1659 { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1688 // This covers the case where we mark containing blocks for layout | 1688 // This covers the case where we mark containing blocks for layout |
| 1689 // and they change size but don't have anything to paint. This is | 1689 // and they change size but don't have anything to paint. This is |
| 1690 // a pretty common case for <body> as we add / remove children | 1690 // a pretty common case for <body> as we add / remove children |
| 1691 // (and the default background is done by FrameView). | 1691 // (and the default background is done by FrameView). |
| 1692 if (skipInvalidationWhenLaidOutChildren() && !mayNeedPaintInvalidation()) | 1692 if (skipInvalidationWhenLaidOutChildren() && !mayNeedPaintInvalidation()) |
| 1693 return InvalidationNone; | 1693 return InvalidationNone; |
| 1694 | 1694 |
| 1695 return InvalidationIncremental; | 1695 return InvalidationIncremental; |
| 1696 } | 1696 } |
| 1697 | 1697 |
| 1698 void RenderObject::incrementallyInvalidatePaint(const RenderLayerModelObject& pa
intInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBoun
ds) | 1698 void RenderObject::incrementallyInvalidatePaint(const RenderLayerModelObject& pa
intInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBoun
ds, const LayoutPoint& positionFromPaintInvalidationContainer) |
| 1699 { | 1699 { |
| 1700 ASSERT(oldBounds.location() == newBounds.location()); | 1700 ASSERT(oldBounds.location() == newBounds.location()); |
| 1701 | 1701 |
| 1702 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX(); | 1702 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX(); |
| 1703 if (deltaRight > 0) | 1703 if (deltaRight > 0) |
| 1704 invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(ol
dBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()), InvalidationIncr
emental); | 1704 invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(ol
dBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()), InvalidationIncr
emental); |
| 1705 else if (deltaRight < 0) | 1705 else if (deltaRight < 0) |
| 1706 invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(ne
wBounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height()), InvalidationInc
remental); | 1706 invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(ne
wBounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height()), InvalidationInc
remental); |
| 1707 | 1707 |
| 1708 LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY(); | 1708 LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY(); |
| (...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3453 { | 3453 { |
| 3454 if (object1) { | 3454 if (object1) { |
| 3455 const blink::RenderObject* root = object1; | 3455 const blink::RenderObject* root = object1; |
| 3456 while (root->parent()) | 3456 while (root->parent()) |
| 3457 root = root->parent(); | 3457 root = root->parent(); |
| 3458 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3458 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
| 3459 } | 3459 } |
| 3460 } | 3460 } |
| 3461 | 3461 |
| 3462 #endif | 3462 #endif |
| OLD | NEW |