| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/PaintInvalidationCapableScrollableArea.h" | 6 #include "core/paint/PaintInvalidationCapableScrollableArea.h" |
| 7 | 7 |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/html/HTMLFrameOwnerElement.h" | 9 #include "core/html/HTMLFrameOwnerElement.h" |
| 10 #include "core/layout/LayoutBox.h" | 10 #include "core/layout/LayoutBox.h" |
| 11 #include "core/layout/LayoutScrollbar.h" | 11 #include "core/layout/LayoutScrollbar.h" |
| 12 #include "core/layout/LayoutScrollbarPart.h" | 12 #include "core/layout/LayoutScrollbarPart.h" |
| 13 #include "core/layout/PaintInvalidationState.h" | 13 #include "core/layout/PaintInvalidationState.h" |
| 14 #include "core/paint/PaintLayer.h" | 14 #include "core/paint/PaintLayer.h" |
| 15 #include "platform/graphics/GraphicsLayer.h" | 15 #include "platform/graphics/GraphicsLayer.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 void PaintInvalidationCapableScrollableArea::willRemoveScrollbar(Scrollbar* scro
llbar, ScrollbarOrientation orientation) | 19 void PaintInvalidationCapableScrollableArea::willRemoveScrollbar(Scrollbar& scro
llbar, ScrollbarOrientation orientation) |
| 20 { | 20 { |
| 21 if (!scrollbar->isCustomScrollbar() | 21 if (!scrollbar.isCustomScrollbar() |
| 22 && !(orientation == HorizontalScrollbar ? layerForHorizontalScrollbar()
: layerForVerticalScrollbar())) | 22 && !(orientation == HorizontalScrollbar ? layerForHorizontalScrollbar()
: layerForVerticalScrollbar())) |
| 23 boxForScrollControlPaintInvalidation().invalidateDisplayItemClient(*scro
llbar); | 23 boxForScrollControlPaintInvalidation().invalidateDisplayItemClient(scrol
lbar); |
| 24 | 24 |
| 25 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); | 25 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); |
| 26 } | 26 } |
| 27 | 27 |
| 28 static LayoutRect scrollControlPaintInvalidationRect(const IntRect& scrollContro
lRect, const LayoutBox& box, const PaintInvalidationState& paintInvalidationStat
e, const LayoutBoxModelObject& paintInvalidationContainer) | 28 static LayoutRect scrollControlPaintInvalidationRect(const IntRect& scrollContro
lRect, const LayoutBox& box, const PaintInvalidationState& paintInvalidationStat
e, const LayoutBoxModelObject& paintInvalidationContainer) |
| 29 { | 29 { |
| 30 LayoutRect paintInvalidationRect(scrollControlRect); | 30 LayoutRect paintInvalidationRect(scrollControlRect); |
| 31 if (!paintInvalidationRect.isEmpty()) | 31 if (!paintInvalidationRect.isEmpty()) |
| 32 PaintLayer::mapRectToPaintInvalidationBacking(&box, &paintInvalidationCo
ntainer, paintInvalidationRect, &paintInvalidationState); | 32 PaintLayer::mapRectToPaintInvalidationBacking(&box, &paintInvalidationCo
ntainer, paintInvalidationRect, &paintInvalidationState); |
| 33 return paintInvalidationRect; | 33 return paintInvalidationRect; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 116 } |
| 117 | 117 |
| 118 void PaintInvalidationCapableScrollableArea::clearPreviousPaintInvalidationRects
() | 118 void PaintInvalidationCapableScrollableArea::clearPreviousPaintInvalidationRects
() |
| 119 { | 119 { |
| 120 m_horizontalScrollbarPreviousPaintInvalidationRect = LayoutRect(); | 120 m_horizontalScrollbarPreviousPaintInvalidationRect = LayoutRect(); |
| 121 m_verticalScrollbarPreviousPaintInvalidationRect = LayoutRect(); | 121 m_verticalScrollbarPreviousPaintInvalidationRect = LayoutRect(); |
| 122 m_scrollCornerPreviousPaintInvalidationRect = LayoutRect(); | 122 m_scrollCornerPreviousPaintInvalidationRect = LayoutRect(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 } // namespace blink | 125 } // namespace blink |
| OLD | NEW |