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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 1406133005: Calculate paint invalidation rect for scrollbars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index c2464543b3ab9518d900671862dcfd1dfa5be0ca..80c7de4745b6e5ccc483acaf4bcc33de4f2a9ce3 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1429,7 +1429,7 @@ bool LayoutBox::intersectsVisibleViewport()
return rect.intersects(LayoutRect(layoutView->frameView()->scrollableArea()->visibleContentRectDouble()));
}
-PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(PaintInvalidationState& paintInvalidationState, const LayoutBoxModelObject& newPaintInvalidationContainer)
+PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(PaintInvalidationState& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationContainer)
{
PaintInvalidationReason fullInvalidationReason = fullPaintInvalidationReason();
// If the current paint invalidation reason is PaintInvalidationDelayedFull, then this paint invalidation can delayed if the
@@ -1443,54 +1443,19 @@ PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(PaintInvalidationStat
setShouldDoFullPaintInvalidation(PaintInvalidationFull);
}
- PaintInvalidationReason reason = LayoutBoxModelObject::invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer);
+ PaintInvalidationReason reason = LayoutBoxModelObject::invalidatePaintIfNeeded(paintInvalidationState, paintInvalidationContainer);
- bool willDoFullInvalidation = view()->doingFullPaintInvalidation() || isFullPaintInvalidationReason(reason);
- if (!willDoFullInvalidation)
+ if (!view()->doingFullPaintInvalidation() && !isFullPaintInvalidationReason(reason))
invalidatePaintForOverflowIfNeeded();
- // Issue paint invalidations for any scrollbars if there is a scrollable area for this layoutObject.
- if (ScrollableArea* area = scrollableArea()) {
- if (area->hasVerticalBarDamage()) {
- if (!willDoFullInvalidation)
- invalidatePaintRectangleNotInvalidatingDisplayItemClients(LayoutRect(area->verticalBarDamage()));
- // TODO(wangxianzhu): Pass current bounds of the scrollbar to PaintController. crbug.com/547119.
- if (Scrollbar* verticalScrollbar = area->verticalScrollbar())
- invalidateDisplayItemClient(*verticalScrollbar);
- }
- if (area->hasHorizontalBarDamage()) {
- if (!willDoFullInvalidation)
- invalidatePaintRectangleNotInvalidatingDisplayItemClients(LayoutRect(area->horizontalBarDamage()));
- // TODO(wangxianzhu): Pass current bounds of the scrollbar to PaintController. crbug.com/547119.
- if (Scrollbar* horizontalScrollbar = area->horizontalScrollbar())
- invalidateDisplayItemClient(*horizontalScrollbar);
- }
- }
+ if (PaintLayerScrollableArea* area = scrollableArea())
+ area->invalidatePaintOfScrollControlsIfNeeded(paintInvalidationState, paintInvalidationContainer);
// This is for the next invalidatePaintIfNeeded so must be at the end.
savePreviousBoxSizesIfNeeded();
return reason;
}
-void LayoutBox::clearPaintInvalidationState(const PaintInvalidationState& paintInvalidationState)
-{
- LayoutBoxModelObject::clearPaintInvalidationState(paintInvalidationState);
-
- if (ScrollableArea* area = scrollableArea())
- area->resetScrollbarDamage();
-}
-
-#if ENABLE(ASSERT)
-bool LayoutBox::paintInvalidationStateIsDirty() const
-{
- if (ScrollableArea* area = scrollableArea()) {
- if (area->hasVerticalBarDamage() || area->hasHorizontalBarDamage())
- return true;
- }
- return LayoutBoxModelObject::paintInvalidationStateIsDirty();
-}
-#endif
-
LayoutRect LayoutBox::overflowClipRect(const LayoutPoint& location, OverlayScrollbarSizeRelevancy relevancy) const
{
// FIXME: When overflow-clip (CSS3) is implemented, we'll obtain the property
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698