| 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 "core/paint/FramePainter.h" | 5 #include "core/paint/FramePainter.h" |
| 6 | 6 |
| 7 #include "core/editing/markers/DocumentMarkerController.h" | 7 #include "core/editing/markers/DocumentMarkerController.h" |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/inspector/InspectorInstrumentation.h" | 9 #include "core/inspector/InspectorInstrumentation.h" |
| 10 #include "core/inspector/InspectorTraceEvents.h" | 10 #include "core/inspector/InspectorTraceEvents.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 context, *frameView().layoutView(), DisplayItem::kScrollbarCorner, | 221 context, *frameView().layoutView(), DisplayItem::kScrollbarCorner, |
| 222 FloatRect(cornerRect)); | 222 FloatRect(cornerRect)); |
| 223 context.fillRect(cornerRect, frameView().baseBackgroundColor()); | 223 context.fillRect(cornerRect, frameView().baseBackgroundColor()); |
| 224 } | 224 } |
| 225 ScrollbarPainter::paintIntoRect(*frameView().scrollCorner(), context, | 225 ScrollbarPainter::paintIntoRect(*frameView().scrollCorner(), context, |
| 226 cornerRect.location(), | 226 cornerRect.location(), |
| 227 LayoutRect(cornerRect)); | 227 LayoutRect(cornerRect)); |
| 228 return; | 228 return; |
| 229 } | 229 } |
| 230 | 230 |
| 231 ScrollbarTheme::theme().paintScrollCorner(context, *frameView().layoutView(), | 231 ScrollbarTheme* theme = nullptr; |
| 232 cornerRect); | 232 |
| 233 if (frameView().horizontalScrollbar()) { |
| 234 theme = &frameView().horizontalScrollbar()->theme(); |
| 235 } else if (frameView().verticalScrollbar()) { |
| 236 theme = &frameView().verticalScrollbar()->theme(); |
| 237 } else { |
| 238 NOTREACHED(); |
| 239 } |
| 240 |
| 241 theme->paintScrollCorner(context, *frameView().layoutView(), cornerRect); |
| 233 } | 242 } |
| 234 | 243 |
| 235 void FramePainter::paintScrollbar(GraphicsContext& context, | 244 void FramePainter::paintScrollbar(GraphicsContext& context, |
| 236 Scrollbar& bar, | 245 Scrollbar& bar, |
| 237 const IntRect& rect) { | 246 const IntRect& rect) { |
| 238 bool needsBackground = | 247 bool needsBackground = |
| 239 bar.isCustomScrollbar() && frameView().frame().isMainFrame(); | 248 bar.isCustomScrollbar() && frameView().frame().isMainFrame(); |
| 240 if (needsBackground) { | 249 if (needsBackground) { |
| 241 IntRect toFill = bar.frameRect(); | 250 IntRect toFill = bar.frameRect(); |
| 242 toFill.intersect(rect); | 251 toFill.intersect(rect); |
| 243 context.fillRect(toFill, frameView().baseBackgroundColor()); | 252 context.fillRect(toFill, frameView().baseBackgroundColor()); |
| 244 } | 253 } |
| 245 | 254 |
| 246 bar.paint(context, CullRect(rect)); | 255 bar.paint(context, CullRect(rect)); |
| 247 } | 256 } |
| 248 | 257 |
| 249 const FrameView& FramePainter::frameView() { | 258 const FrameView& FramePainter::frameView() { |
| 250 DCHECK(m_frameView); | 259 DCHECK(m_frameView); |
| 251 return *m_frameView; | 260 return *m_frameView; |
| 252 } | 261 } |
| 253 | 262 |
| 254 } // namespace blink | 263 } // namespace blink |
| OLD | NEW |