OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ScrollableAreaPainter.h" | 6 #include "core/paint/ScrollableAreaPainter.h" |
7 | 7 |
| 8 #include "core/layout/Layer.h" |
| 9 #include "core/layout/LayerScrollableArea.h" |
8 #include "core/page/Page.h" | 10 #include "core/page/Page.h" |
9 #include "core/paint/ScrollbarPainter.h" | 11 #include "core/paint/ScrollbarPainter.h" |
10 #include "core/rendering/PaintInfo.h" | 12 #include "core/rendering/PaintInfo.h" |
11 #include "core/rendering/RenderLayer.h" | |
12 #include "core/rendering/RenderLayerScrollableArea.h" | |
13 #include "core/rendering/RenderView.h" | 13 #include "core/rendering/RenderView.h" |
14 #include "platform/graphics/GraphicsContext.h" | 14 #include "platform/graphics/GraphicsContext.h" |
15 #include "platform/graphics/GraphicsContextStateSaver.h" | 15 #include "platform/graphics/GraphicsContextStateSaver.h" |
16 #include "platform/graphics/paint/DrawingRecorder.h" | 16 #include "platform/graphics/paint/DrawingRecorder.h" |
17 | 17 |
18 namespace blink { | 18 namespace blink { |
19 | 19 |
20 void ScrollableAreaPainter::paintResizer(GraphicsContext* context, const IntPoin
t& paintOffset, const IntRect& damageRect) | 20 void ScrollableAreaPainter::paintResizer(GraphicsContext* context, const IntPoin
t& paintOffset, const IntRect& damageRect) |
21 { | 21 { |
22 if (m_renderLayerScrollableArea.box().style()->resize() == RESIZE_NONE) | 22 if (m_renderLayerScrollableArea.box().style()->resize() == RESIZE_NONE) |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // It's not necessary to do the second pass if the scrollbars paint into
layers. | 109 // It's not necessary to do the second pass if the scrollbars paint into
layers. |
110 if ((m_renderLayerScrollableArea.horizontalScrollbar() && m_renderLayerS
crollableArea.layerForHorizontalScrollbar()) || (m_renderLayerScrollableArea.ver
ticalScrollbar() && m_renderLayerScrollableArea.layerForVerticalScrollbar())) | 110 if ((m_renderLayerScrollableArea.horizontalScrollbar() && m_renderLayerS
crollableArea.layerForHorizontalScrollbar()) || (m_renderLayerScrollableArea.ver
ticalScrollbar() && m_renderLayerScrollableArea.layerForVerticalScrollbar())) |
111 return; | 111 return; |
112 IntRect localDamgeRect = damageRect; | 112 IntRect localDamgeRect = damageRect; |
113 localDamgeRect.moveBy(-paintOffset); | 113 localDamgeRect.moveBy(-paintOffset); |
114 if (!overflowControlsIntersectRect(localDamgeRect)) | 114 if (!overflowControlsIntersectRect(localDamgeRect)) |
115 return; | 115 return; |
116 | 116 |
117 RenderView* renderView = m_renderLayerScrollableArea.box().view(); | 117 RenderView* renderView = m_renderLayerScrollableArea.box().view(); |
118 | 118 |
119 RenderLayer* paintingRoot = m_renderLayerScrollableArea.layer()->enclosi
ngLayerWithCompositedLayerMapping(IncludeSelf); | 119 Layer* paintingRoot = m_renderLayerScrollableArea.layer()->enclosingLaye
rWithCompositedLayerMapping(IncludeSelf); |
120 if (!paintingRoot) | 120 if (!paintingRoot) |
121 paintingRoot = renderView->layer(); | 121 paintingRoot = renderView->layer(); |
122 | 122 |
123 paintingRoot->setContainsDirtyOverlayScrollbars(true); | 123 paintingRoot->setContainsDirtyOverlayScrollbars(true); |
124 return; | 124 return; |
125 } | 125 } |
126 | 126 |
127 // This check is required to avoid painting custom CSS scrollbars twice. | 127 // This check is required to avoid painting custom CSS scrollbars twice. |
128 if (paintingOverlayControls && !m_renderLayerScrollableArea.hasOverlayScroll
bars()) | 128 if (paintingOverlayControls && !m_renderLayerScrollableArea.hasOverlayScroll
bars()) |
129 return; | 129 return; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 if (recorder.canUseCachedDrawing()) | 181 if (recorder.canUseCachedDrawing()) |
182 return; | 182 return; |
183 | 183 |
184 // We don't want to paint white if we have overlay scrollbars, since we need | 184 // We don't want to paint white if we have overlay scrollbars, since we need |
185 // to see what is behind it. | 185 // to see what is behind it. |
186 if (!m_renderLayerScrollableArea.hasOverlayScrollbars()) | 186 if (!m_renderLayerScrollableArea.hasOverlayScrollbars()) |
187 context->fillRect(absRect, Color::white); | 187 context->fillRect(absRect, Color::white); |
188 } | 188 } |
189 | 189 |
190 } // namespace blink | 190 } // namespace blink |
OLD | NEW |