| Index: third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp
|
| index 3d9ec1d68025a2fb48b1b0e85c04b0e980f71e88..b56c6845d6c8d3fca7b1243e90779ad9abeb86fb 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp
|
| @@ -11,6 +11,7 @@
|
| #include "core/layout/LayoutScrollbar.h"
|
| #include "core/layout/LayoutScrollbarPart.h"
|
| #include "core/layout/PaintInvalidationState.h"
|
| +#include "core/paint/FindPaintOffsetAndVisualRectNeedingUpdate.h"
|
| #include "core/paint/ObjectPaintInvalidator.h"
|
| #include "core/paint/PaintInvalidator.h"
|
| #include "core/paint/PaintLayer.h"
|
| @@ -34,8 +35,16 @@ void PaintInvalidationCapableScrollableArea::willRemoveScrollbar(
|
| static LayoutRect scrollControlVisualRect(
|
| const IntRect& scrollControlRect,
|
| const LayoutBox& box,
|
| - const PaintInvalidatorContext& context) {
|
| + const PaintInvalidatorContext& context,
|
| + const LayoutRect& previousVisualRect) {
|
| LayoutRect visualRect(scrollControlRect);
|
| +#if DCHECK_IS_ON()
|
| + FindVisualRectNeedingUpdateScope finder(box, context, previousVisualRect,
|
| + visualRect);
|
| +#endif
|
| + if (!context.needsVisualRectUpdate(box))
|
| + return previousVisualRect;
|
| +
|
| // No need to apply any paint offset. Scroll controls paint in a different
|
| // transform space than their contained box (the scrollbarPaintOffset
|
| // transform node).
|
| @@ -82,12 +91,12 @@ static LayoutRect invalidatePaintOfScrollbarIfNeeded(
|
| const PaintInvalidatorContext& context) {
|
| bool isOverlay = scrollbar && scrollbar->isOverlayScrollbar();
|
|
|
| + LayoutRect newVisualRect;
|
| // Calculate visual rect of the scrollbar, except overlay composited
|
| // scrollbars because we invalidate the graphics layer only.
|
| - LayoutRect newVisualRect;
|
| if (scrollbar && !(graphicsLayer && isOverlay)) {
|
| - newVisualRect =
|
| - scrollControlVisualRect(scrollbar->frameRect(), box, context);
|
| + newVisualRect = scrollControlVisualRect(scrollbar->frameRect(), box,
|
| + context, previousVisualRect);
|
| }
|
|
|
| bool needsPaintInvalidation = needsPaintInvalidationArg;
|
| @@ -160,7 +169,8 @@ void PaintInvalidationCapableScrollableArea::
|
| verticalScrollbarNeedsPaintInvalidation(), box, context));
|
|
|
| LayoutRect scrollCornerAndResizerVisualRect =
|
| - scrollControlVisualRect(scrollCornerAndResizerRect(), box, context);
|
| + scrollControlVisualRect(scrollCornerAndResizerRect(), box, context,
|
| + m_scrollCornerAndResizerVisualRect);
|
| const LayoutBoxModelObject& paintInvalidationContainer =
|
| *context.paintInvalidationContainer;
|
| if (invalidatePaintOfScrollControlIfNeeded(
|
|
|