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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 LayoutRect PaintInvalidationCapableScrollableArea::visualRectForScrollbarParts()
const | 127 LayoutRect PaintInvalidationCapableScrollableArea::visualRectForScrollbarParts()
const |
128 { | 128 { |
129 LayoutRect fullBounds(m_horizontalScrollbarPreviousPaintInvalidationRect); | 129 LayoutRect fullBounds(m_horizontalScrollbarPreviousPaintInvalidationRect); |
130 fullBounds.unite(m_verticalScrollbarPreviousPaintInvalidationRect); | 130 fullBounds.unite(m_verticalScrollbarPreviousPaintInvalidationRect); |
131 fullBounds.unite(m_scrollCornerAndResizerPreviousPaintInvalidationRect); | 131 fullBounds.unite(m_scrollCornerAndResizerPreviousPaintInvalidationRect); |
132 return fullBounds; | 132 return fullBounds; |
133 } | 133 } |
134 | 134 |
135 } // namespace blink | 135 } // namespace blink |
OLD | NEW |