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/BlockPainter.h" | 6 #include "core/paint/BlockPainter.h" |
7 | 7 |
8 #include "core/editing/DragCaretController.h" | 8 #include "core/editing/DragCaretController.h" |
9 #include "core/editing/FrameSelection.h" | 9 #include "core/editing/FrameSelection.h" |
10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Our scrollbar widgets paint exactly when we tell them to, so that they wo
rk properly with | 67 // Our scrollbar widgets paint exactly when we tell them to, so that they wo
rk properly with |
68 // z-index. We paint after we painted the background/border, so that the scr
ollbars will | 68 // z-index. We paint after we painted the background/border, so that the scr
ollbars will |
69 // sit above the background/border. | 69 // sit above the background/border. |
70 paintOverflowControlsIfNeeded(localPaintInfo, adjustedPaintOffset); | 70 paintOverflowControlsIfNeeded(localPaintInfo, adjustedPaintOffset); |
71 } | 71 } |
72 | 72 |
73 void BlockPainter::paintOverflowControlsIfNeeded(const PaintInfo& paintInfo, con
st LayoutPoint& paintOffset) | 73 void BlockPainter::paintOverflowControlsIfNeeded(const PaintInfo& paintInfo, con
st LayoutPoint& paintOffset) |
74 { | 74 { |
75 PaintPhase phase = paintInfo.phase; | 75 PaintPhase phase = paintInfo.phase; |
76 if (m_layoutBlock.hasOverflowClip() && m_layoutBlock.style()->visibility() =
= VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBloc
kBackground) && paintInfo.shouldPaintWithinRoot(&m_layoutBlock) && !paintInfo.pa
intRootBackgroundOnly()) { | 76 if (m_layoutBlock.hasOverflowClip() && m_layoutBlock.style()->visibility() =
= VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBloc
kBackground) && paintInfo.shouldPaintWithinRoot(&m_layoutBlock) && !paintInfo.pa
intRootBackgroundOnly()) { |
| 77 Optional<ClipRecorder> clipRecorder; |
| 78 if (!m_layoutBlock.layer()->isSelfPaintingLayer()) { |
| 79 LayoutRect clipRect = m_layoutBlock.borderBoxRect(); |
| 80 clipRect.moveBy(paintOffset); |
| 81 clipRecorder.emplace(*paintInfo.context, m_layoutBlock, DisplayItem:
:ClipScrollbarsToBoxBounds, clipRect); |
| 82 } |
77 ScrollableAreaPainter(*m_layoutBlock.layer()->scrollableArea()).paintOve
rflowControls(paintInfo.context, roundedIntPoint(paintOffset), paintInfo.cullRec
t(), false /* paintingOverlayControls */); | 83 ScrollableAreaPainter(*m_layoutBlock.layer()->scrollableArea()).paintOve
rflowControls(paintInfo.context, roundedIntPoint(paintOffset), paintInfo.cullRec
t(), false /* paintingOverlayControls */); |
78 } | 84 } |
79 } | 85 } |
80 | 86 |
81 void BlockPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) | 87 void BlockPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) |
82 { | 88 { |
83 for (LayoutBox* child = m_layoutBlock.firstChildBox(); child; child = child-
>nextSiblingBox()) | 89 for (LayoutBox* child = m_layoutBlock.firstChildBox(); child; child = child-
>nextSiblingBox()) |
84 paintChild(*child, paintInfo, paintOffset); | 90 paintChild(*child, paintInfo, paintOffset); |
85 } | 91 } |
86 | 92 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 267 |
262 // We don't paint our own background, but we do let the kids paint their
backgrounds. | 268 // We don't paint our own background, but we do let the kids paint their
backgrounds. |
263 PaintInfo paintInfoForChild(paintInfo); | 269 PaintInfo paintInfoForChild(paintInfo); |
264 paintInfoForChild.phase = newPhase; | 270 paintInfoForChild.phase = newPhase; |
265 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock); | 271 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock); |
266 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset); | 272 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset); |
267 } | 273 } |
268 } | 274 } |
269 | 275 |
270 } // namespace blink | 276 } // namespace blink |
OLD | NEW |