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/Caret.h" | 8 #include "core/editing/Caret.h" |
9 #include "core/editing/FrameSelection.h" | 9 #include "core/editing/FrameSelection.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 && m_renderBlock.firstChild() && m_renderBlock.lastChild() && m_rend
erBlock.firstChild() != m_renderBlock.lastChild(); | 63 && m_renderBlock.firstChild() && m_renderBlock.lastChild() && m_rend
erBlock.firstChild() != m_renderBlock.lastChild(); |
64 if (shouldCull) | 64 if (shouldCull) |
65 cullSaver.cull(overflowBox); | 65 cullSaver.cull(overflowBox); |
66 | 66 |
67 m_renderBlock.paintObject(paintInfo, adjustedPaintOffset); | 67 m_renderBlock.paintObject(paintInfo, adjustedPaintOffset); |
68 } | 68 } |
69 | 69 |
70 // Our scrollbar widgets paint exactly when we tell them to, so that they wo
rk properly with | 70 // Our scrollbar widgets paint exactly when we tell them to, so that they wo
rk properly with |
71 // z-index. We paint after we painted the background/border, so that the scr
ollbars will | 71 // z-index. We paint after we painted the background/border, so that the scr
ollbars will |
72 // sit above the background/border. | 72 // sit above the background/border. |
| 73 paintOverflowControlsIfNeeded(paintInfo, adjustedPaintOffset); |
| 74 } |
| 75 |
| 76 void BlockPainter::paintOverflowControlsIfNeeded(PaintInfo& paintInfo, const Lay
outPoint& paintOffset) |
| 77 { |
| 78 PaintPhase phase = paintInfo.phase; |
73 if (m_renderBlock.hasOverflowClip() && m_renderBlock.style()->visibility() =
= VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBloc
kBackground) && paintInfo.shouldPaintWithinRoot(&m_renderBlock) && !paintInfo.pa
intRootBackgroundOnly()) { | 79 if (m_renderBlock.hasOverflowClip() && m_renderBlock.style()->visibility() =
= VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBloc
kBackground) && paintInfo.shouldPaintWithinRoot(&m_renderBlock) && !paintInfo.pa
intRootBackgroundOnly()) { |
74 DrawingRecorder recorder(paintInfo.context, &m_renderBlock, paintInfo.ph
ase, pixelSnappedIntRect(adjustedPaintOffset, m_renderBlock.visualOverflowRect()
.size())); | 80 DrawingRecorder recorder(paintInfo.context, &m_renderBlock, paintInfo.ph
ase, pixelSnappedIntRect(paintOffset, m_renderBlock.visualOverflowRect().size())
); |
75 m_renderBlock.layer()->scrollableArea()->paintOverflowControls(paintInfo
.context, roundedIntPoint(adjustedPaintOffset), paintInfo.rect, false /* paintin
gOverlayControls */); | 81 m_renderBlock.layer()->scrollableArea()->paintOverflowControls(paintInfo
.context, roundedIntPoint(paintOffset), paintInfo.rect, false /* paintingOverlay
Controls */); |
76 } | 82 } |
77 } | 83 } |
78 | 84 |
79 void BlockPainter::paintChildren(PaintInfo& paintInfo, const LayoutPoint& paintO
ffset) | 85 void BlockPainter::paintChildren(PaintInfo& paintInfo, const LayoutPoint& paintO
ffset) |
80 { | 86 { |
81 for (RenderBox* child = m_renderBlock.firstChildBox(); child; child = child-
>nextSiblingBox()) | 87 for (RenderBox* child = m_renderBlock.firstChildBox(); child; child = child-
>nextSiblingBox()) |
82 paintChild(child, paintInfo, paintOffset); | 88 paintChild(child, paintInfo, paintOffset); |
83 } | 89 } |
84 | 90 |
85 void BlockPainter::paintChild(RenderBox* child, PaintInfo& paintInfo, const Layo
utPoint& paintOffset) | 91 void BlockPainter::paintChild(RenderBox* child, PaintInfo& paintInfo, const Layo
utPoint& paintOffset) |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 RenderBlock* block = flow->containingBlock(); | 519 RenderBlock* block = flow->containingBlock(); |
514 for ( ; block && block != &m_renderBlock; block = block->containingBlock
()) | 520 for ( ; block && block != &m_renderBlock; block = block->containingBlock
()) |
515 accumulatedPaintOffset.moveBy(block->location()); | 521 accumulatedPaintOffset.moveBy(block->location()); |
516 ASSERT(block); | 522 ASSERT(block); |
517 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); | 523 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); |
518 } | 524 } |
519 } | 525 } |
520 | 526 |
521 | 527 |
522 } // namespace blink | 528 } // namespace blink |
OLD | NEW |