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

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

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

Powered by Google App Engine
This is Rietveld 408576698