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 "core/paint/PaintInvalidationCapableScrollableArea.h" | 5 #include "core/paint/PaintInvalidationCapableScrollableArea.h" |
6 | 6 |
7 #include "core/frame/Settings.h" | 7 #include "core/frame/Settings.h" |
8 #include "core/html/HTMLFrameOwnerElement.h" | 8 #include "core/html/HTMLFrameOwnerElement.h" |
9 #include "core/layout/LayoutBox.h" | 9 #include "core/layout/LayoutBox.h" |
10 #include "core/layout/LayoutScrollbar.h" | 10 #include "core/layout/LayoutScrollbar.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 && !(orientation == HorizontalScrollbar ? layerForHorizontalScrollbar()
: layerForVerticalScrollbar())) | 21 && !(orientation == HorizontalScrollbar ? layerForHorizontalScrollbar()
: layerForVerticalScrollbar())) |
22 boxForScrollControlPaintInvalidation().invalidateDisplayItemClient(scrol
lbar); | 22 boxForScrollControlPaintInvalidation().invalidateDisplayItemClient(scrol
lbar); |
23 | 23 |
24 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); | 24 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); |
25 } | 25 } |
26 | 26 |
27 static LayoutRect scrollControlPaintInvalidationRect(const IntRect& scrollContro
lRect, const LayoutBox& box, const PaintInvalidationState& paintInvalidationStat
e) | 27 static LayoutRect scrollControlPaintInvalidationRect(const IntRect& scrollContro
lRect, const LayoutBox& box, const PaintInvalidationState& paintInvalidationStat
e) |
28 { | 28 { |
29 LayoutRect paintInvalidationRect(scrollControlRect); | 29 LayoutRect paintInvalidationRect(scrollControlRect); |
30 if (!paintInvalidationRect.isEmpty()) | 30 if (!paintInvalidationRect.isEmpty()) |
31 PaintLayer::mapRectToPaintInvalidationBacking(&box, &paintInvalidationSt
ate.paintInvalidationContainer(), paintInvalidationRect, &paintInvalidationState
); | 31 paintInvalidationState.mapLocalRectToPaintInvalidationBacking(paintInval
idationRect); |
32 return paintInvalidationRect; | 32 return paintInvalidationRect; |
33 } | 33 } |
34 | 34 |
35 // Returns true if the scroll control is invalidated. | 35 // Returns true if the scroll control is invalidated. |
36 static bool invalidatePaintOfScrollControlIfNeeded(const LayoutRect& newPaintInv
alidationRect, const LayoutRect& previousPaintInvalidationRect, bool needsPaintI
nvalidation, LayoutBox& box, const LayoutBoxModelObject& paintInvalidationContai
ner) | 36 static bool invalidatePaintOfScrollControlIfNeeded(const LayoutRect& newPaintInv
alidationRect, const LayoutRect& previousPaintInvalidationRect, bool needsPaintI
nvalidation, LayoutBox& box, const LayoutBoxModelObject& paintInvalidationContai
ner) |
37 { | 37 { |
38 bool shouldInvalidateNewRect = needsPaintInvalidation; | 38 bool shouldInvalidateNewRect = needsPaintInvalidation; |
39 if (newPaintInvalidationRect != previousPaintInvalidationRect) { | 39 if (newPaintInvalidationRect != previousPaintInvalidationRect) { |
40 box.invalidatePaintUsingContainer(paintInvalidationContainer, previousPa
intInvalidationRect, PaintInvalidationScroll); | 40 box.invalidatePaintUsingContainer(paintInvalidationContainer, previousPa
intInvalidationRect, PaintInvalidationScroll); |
41 shouldInvalidateNewRect = true; | 41 shouldInvalidateNewRect = true; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 } | 118 } |
119 | 119 |
120 void PaintInvalidationCapableScrollableArea::clearPreviousPaintInvalidationRects
() | 120 void PaintInvalidationCapableScrollableArea::clearPreviousPaintInvalidationRects
() |
121 { | 121 { |
122 m_horizontalScrollbarPreviousPaintInvalidationRect = LayoutRect(); | 122 m_horizontalScrollbarPreviousPaintInvalidationRect = LayoutRect(); |
123 m_verticalScrollbarPreviousPaintInvalidationRect = LayoutRect(); | 123 m_verticalScrollbarPreviousPaintInvalidationRect = LayoutRect(); |
124 m_scrollCornerAndResizerPreviousPaintInvalidationRect = LayoutRect(); | 124 m_scrollCornerAndResizerPreviousPaintInvalidationRect = LayoutRect(); |
125 } | 125 } |
126 | 126 |
127 } // namespace blink | 127 } // namespace blink |
OLD | NEW |