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 } | |
83 ScrollableAreaPainter(*m_layoutBlock.layer()->scrollableArea()).paintOve
rflowControls(paintInfo.context, roundedIntPoint(paintOffset), paintInfo.cullRec
t(), false /* paintingOverlayControls */); | 77 ScrollableAreaPainter(*m_layoutBlock.layer()->scrollableArea()).paintOve
rflowControls(paintInfo.context, roundedIntPoint(paintOffset), paintInfo.cullRec
t(), false /* paintingOverlayControls */); |
84 } | 78 } |
85 } | 79 } |
86 | 80 |
87 void BlockPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) | 81 void BlockPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) |
88 { | 82 { |
89 for (LayoutBox* child = m_layoutBlock.firstChildBox(); child; child = child-
>nextSiblingBox()) | 83 for (LayoutBox* child = m_layoutBlock.firstChildBox(); child; child = child-
>nextSiblingBox()) |
90 paintChild(*child, paintInfo, paintOffset); | 84 paintChild(*child, paintInfo, paintOffset); |
91 } | 85 } |
92 | 86 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 | 261 |
268 // We don't paint our own background, but we do let the kids paint their
backgrounds. | 262 // We don't paint our own background, but we do let the kids paint their
backgrounds. |
269 PaintInfo paintInfoForChild(paintInfo); | 263 PaintInfo paintInfoForChild(paintInfo); |
270 paintInfoForChild.phase = newPhase; | 264 paintInfoForChild.phase = newPhase; |
271 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock); | 265 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock); |
272 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset); | 266 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset); |
273 } | 267 } |
274 } | 268 } |
275 | 269 |
276 } // namespace blink | 270 } // namespace blink |
OLD | NEW |