| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; | 77 Optional<ClipRecorder> clipRecorder; |
| 78 if (!m_layoutBlock.layer()->isSelfPaintingLayer()) { | 78 if (!m_layoutBlock.layer()->isSelfPaintingLayer()) { |
| 79 LayoutRect clipRect = m_layoutBlock.borderBoxRect(); | 79 LayoutRect clipRect = m_layoutBlock.borderBoxRect(); |
| 80 clipRect.moveBy(paintOffset); | 80 clipRect.moveBy(paintOffset); |
| 81 clipRecorder.emplace(*paintInfo.context, m_layoutBlock, DisplayItem:
:ClipScrollbarsToBoxBounds, clipRect); | 81 clipRecorder.emplace(*paintInfo.context, m_layoutBlock, DisplayItem:
:ClipScrollbarsToBoxBounds, clipRect); |
| 82 } | 82 } |
| 83 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.cullRe
ct(), false /* paintingOverlayControls */); |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 void BlockPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) | 87 void BlockPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) |
| 88 { | 88 { |
| 89 for (LayoutBox* child = m_layoutBlock.firstChildBox(); child; child = child-
>nextSiblingBox()) | 89 for (LayoutBox* child = m_layoutBlock.firstChildBox(); child; child = child-
>nextSiblingBox()) |
| 90 paintChild(*child, paintInfo, paintOffset); | 90 paintChild(*child, paintInfo, paintOffset); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void BlockPainter::paintChild(const LayoutBox& child, const PaintInfo& paintInfo
, const LayoutPoint& paintOffset) | 93 void BlockPainter::paintChild(const LayoutBox& child, const PaintInfo& paintInfo
, const LayoutPoint& paintOffset) |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 | 267 |
| 268 // 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. |
| 269 PaintInfo paintInfoForChild(paintInfo); | 269 PaintInfo paintInfoForChild(paintInfo); |
| 270 paintInfoForChild.phase = newPhase; | 270 paintInfoForChild.phase = newPhase; |
| 271 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock); | 271 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock); |
| 272 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset); | 272 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset); |
| 273 } | 273 } |
| 274 } | 274 } |
| 275 | 275 |
| 276 } // namespace blink | 276 } // namespace blink |
| OLD | NEW |