Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 1882473002: Invalidate the bigger rect if one rect contains the other in LayoutObject::fullyInvalidateRect() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698