| 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/LayoutView.h" | 8 #include "core/layout/LayoutView.h" |
| 9 #include "core/page/Page.h" | 9 #include "core/page/Page.h" |
| 10 #include "core/paint/DeprecatedPaintLayer.h" | 10 #include "core/paint/DeprecatedPaintLayer.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 return true; | 161 return true; |
| 162 | 162 |
| 163 return false; | 163 return false; |
| 164 } | 164 } |
| 165 | 165 |
| 166 | 166 |
| 167 void ScrollableAreaPainter::paintScrollCorner(GraphicsContext* context, const In
tPoint& paintOffset, const IntRect& damageRect) | 167 void ScrollableAreaPainter::paintScrollCorner(GraphicsContext* context, const In
tPoint& paintOffset, const IntRect& damageRect) |
| 168 { | 168 { |
| 169 IntRect absRect = m_scrollableArea.scrollCornerRect(); | 169 IntRect absRect = m_scrollableArea.scrollCornerRect(); |
| 170 absRect.moveBy(paintOffset); | 170 absRect.moveBy(paintOffset); |
| 171 if (!absRect.intersects(damageRect)) | |
| 172 return; | |
| 173 | 171 |
| 174 if (m_scrollableArea.scrollCorner()) { | 172 if (m_scrollableArea.scrollCorner()) { |
| 173 if (!absRect.intersects(damageRect)) |
| 174 return; |
| 175 ScrollbarPainter::paintIntoRect(m_scrollableArea.scrollCorner(), context
, paintOffset, LayoutRect(absRect)); | 175 ScrollbarPainter::paintIntoRect(m_scrollableArea.scrollCorner(), context
, paintOffset, LayoutRect(absRect)); |
| 176 return; | 176 return; |
| 177 } | 177 } |
| 178 | 178 |
| 179 if (!RuntimeEnabledFeatures::slimmingPaintEnabled() && !absRect.intersects(d
amageRect)) |
| 180 return; |
| 181 |
| 182 // We don't want to paint white if we have overlay scrollbars, since we need |
| 183 // to see what is behind it. |
| 184 if (m_scrollableArea.hasOverlayScrollbars()) |
| 185 return; |
| 186 |
| 179 DrawingRecorder recorder(*context, m_scrollableArea.box(), DisplayItem::Scro
llbarCorner, absRect); | 187 DrawingRecorder recorder(*context, m_scrollableArea.box(), DisplayItem::Scro
llbarCorner, absRect); |
| 180 if (recorder.canUseCachedDrawing()) | 188 if (recorder.canUseCachedDrawing()) |
| 181 return; | 189 return; |
| 182 | 190 |
| 183 // We don't want to paint white if we have overlay scrollbars, since we need | 191 context->fillRect(absRect, Color::white); |
| 184 // to see what is behind it. | |
| 185 if (!m_scrollableArea.hasOverlayScrollbars()) | |
| 186 context->fillRect(absRect, Color::white); | |
| 187 } | 192 } |
| 188 | 193 |
| 189 } // namespace blink | 194 } // namespace blink |
| OLD | NEW |