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

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

Issue 1416053003: Let synchronized painting generate correct paint invalidation rects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: For landing Created 5 years, 2 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 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 9cd08824b0e41dcb89336555f65d221f4e932db2..5dc2dbbef0fac915fa06b9180ec5c8677ebc25f8 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1427,21 +1427,25 @@ PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(PaintInvalidationStat
PaintInvalidationReason reason = LayoutBoxModelObject::invalidatePaintIfNeeded(paintInvalidationState, newPaintInvalidationContainer);
- // If we are set to do a full paint invalidation that means the LayoutView will be
- // issue paint invalidations. We can then skip issuing of paint invalidations for the child
- // layoutObjects as they'll be covered by the LayoutView.
- if (!view()->doingFullPaintInvalidation() && !isFullPaintInvalidationReason(reason)) {
+ bool willDoFullInvalidation = view()->doingFullPaintInvalidation() || isFullPaintInvalidationReason(reason);
+ if (!willDoFullInvalidation)
invalidatePaintForOverflowIfNeeded();
- // Issue paint invalidations for any scrollbars if there is a scrollable area for this layoutObject.
- if (ScrollableArea* area = scrollableArea()) {
- // In slimming paint mode, we already invalidated the display item clients of the scrollbars
- // during PaintLayerScrollableArea::invalidateScrollbarRect(). However, for now we still need to
- // invalidate the rectangles to trigger repaints.
- if (area->hasVerticalBarDamage())
+ // 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()));
- if (area->hasHorizontalBarDamage())
+ // 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);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698