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) 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 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1572 LayoutRect invalidationRect(newBounds.x(), oldBounds.maxY(), newBounds.w idth(), deltaBottom); | 1572 LayoutRect invalidationRect(newBounds.x(), oldBounds.maxY(), newBounds.w idth(), deltaBottom); |
| 1573 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInva lidationContainer); | 1573 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInva lidationContainer); |
| 1574 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe ct, PaintInvalidationIncremental); | 1574 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe ct, PaintInvalidationIncremental); |
| 1575 } else if (deltaBottom < 0) { | 1575 } else if (deltaBottom < 0) { |
| 1576 LayoutRect invalidationRect(oldBounds.x(), newBounds.maxY(), oldBounds.w idth(), -deltaBottom); | 1576 LayoutRect invalidationRect(oldBounds.x(), newBounds.maxY(), oldBounds.w idth(), -deltaBottom); |
| 1577 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInva lidationContainer); | 1577 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInva lidationContainer); |
| 1578 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe ct, PaintInvalidationIncremental); | 1578 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe ct, PaintInvalidationIncremental); |
| 1579 } | 1579 } |
| 1580 } | 1580 } |
| 1581 | 1581 |
| 1582 void LayoutObject::fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalid ationContainer, PaintInvalidationReason invalidationReason, const LayoutRect& ol dBounds, const LayoutRect& newBounds) | 1582 void LayoutObject::fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalid ationContainer, PaintInvalidationReason invalidationReason, const LayoutRect& ol dBounds, const LayoutRect& newBounds) |
|
pdr.
2016/04/12 03:01:22
This logic took me a while to reason through. It's
Xianzhu
2016/04/12 16:47:50
Done (except that oldBounds and newBounds inversed
| |
| 1583 { | 1583 { |
| 1584 // Otherwise do full paint invalidation. | |
| 1585 LayoutRect invalidationRect = oldBounds; | 1584 LayoutRect invalidationRect = oldBounds; |
| 1585 bool oneRectContainsTheOther = true; | |
| 1586 if (newBounds.contains(oldBounds)) | |
| 1587 invalidationRect = newBounds; | |
| 1588 else if (!oldBounds.contains(newBounds)) | |
| 1589 oneRectContainsTheOther = false; | |
| 1590 | |
| 1586 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInvalida tionContainer); | 1591 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInvalida tionContainer); |
| 1587 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect, invalidationReason); | 1592 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect, invalidationReason); |
| 1588 if (newBounds != oldBounds) { | 1593 if (!oneRectContainsTheOther) { |
| 1589 invalidationRect = newBounds; | 1594 invalidationRect = newBounds; |
| 1590 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInva lidationContainer); | 1595 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInva lidationContainer); |
| 1591 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe ct, invalidationReason); | 1596 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRe ct, invalidationReason); |
| 1592 } | 1597 } |
| 1593 } | 1598 } |
| 1594 | 1599 |
| 1595 void LayoutObject::invalidatePaintForOverflow() | 1600 void LayoutObject::invalidatePaintForOverflow() |
| 1596 { | 1601 { |
| 1597 } | 1602 } |
| 1598 | 1603 |
| (...skipping 2080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3679 const blink::LayoutObject* root = object1; | 3684 const blink::LayoutObject* root = object1; |
| 3680 while (root->parent()) | 3685 while (root->parent()) |
| 3681 root = root->parent(); | 3686 root = root->parent(); |
| 3682 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3687 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3683 } else { | 3688 } else { |
| 3684 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3689 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3685 } | 3690 } |
| 3686 } | 3691 } |
| 3687 | 3692 |
| 3688 #endif | 3693 #endif |
| OLD | NEW |