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

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

Issue 1456953003: Revert of 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 80c7de4745b6e5ccc483acaf4bcc33de4f2a9ce3..c2464543b3ab9518d900671862dcfd1dfa5be0ca 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1429,7 +1429,7 @@
return rect.intersects(LayoutRect(layoutView->frameView()->scrollableArea()->visibleContentRectDouble()));
}
-PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(PaintInvalidationState& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationContainer)
+PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(PaintInvalidationState& paintInvalidationState, const LayoutBoxModelObject& newPaintInvalidationContainer)
{
PaintInvalidationReason fullInvalidationReason = fullPaintInvalidationReason();
// If the current paint invalidation reason is PaintInvalidationDelayedFull, then this paint invalidation can delayed if the
@@ -1443,18 +1443,53 @@
setShouldDoFullPaintInvalidation(PaintInvalidationFull);
}
- PaintInvalidationReason reason = LayoutBoxModelObject::invalidatePaintIfNeeded(paintInvalidationState, paintInvalidationContainer);
-
- if (!view()->doingFullPaintInvalidation() && !isFullPaintInvalidationReason(reason))
+ PaintInvalidationReason reason = LayoutBoxModelObject::invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer);
+
+ bool willDoFullInvalidation = view()->doingFullPaintInvalidation() || isFullPaintInvalidationReason(reason);
+ if (!willDoFullInvalidation)
invalidatePaintForOverflowIfNeeded();
- if (PaintLayerScrollableArea* area = scrollableArea())
- area->invalidatePaintOfScrollControlsIfNeeded(paintInvalidationState, paintInvalidationContainer);
+ // 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);
+ }
+ }
// 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
{
« 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