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" |
11 #include "core/frame/Settings.h" | 11 #include "core/frame/Settings.h" |
12 #include "core/page/Page.h" | 12 #include "core/page/Page.h" |
13 #include "core/paint/BoxClipper.h" | 13 #include "core/paint/BoxClipper.h" |
14 #include "core/paint/BoxPainter.h" | 14 #include "core/paint/BoxPainter.h" |
15 #include "core/paint/InlinePainter.h" | 15 #include "core/paint/InlinePainter.h" |
16 #include "core/paint/LineBoxListPainter.h" | 16 #include "core/paint/LineBoxListPainter.h" |
17 #include "core/paint/RenderDrawingRecorder.h" | 17 #include "core/paint/RenderDrawingRecorder.h" |
| 18 #include "core/paint/ScrollableAreaPainter.h" |
18 #include "core/rendering/GraphicsContextAnnotator.h" | 19 #include "core/rendering/GraphicsContextAnnotator.h" |
19 #include "core/rendering/PaintInfo.h" | 20 #include "core/rendering/PaintInfo.h" |
20 #include "core/rendering/RenderBlock.h" | 21 #include "core/rendering/RenderBlock.h" |
21 #include "core/rendering/RenderFlexibleBox.h" | 22 #include "core/rendering/RenderFlexibleBox.h" |
22 #include "core/rendering/RenderInline.h" | 23 #include "core/rendering/RenderInline.h" |
23 #include "core/rendering/RenderLayer.h" | 24 #include "core/rendering/RenderLayer.h" |
24 #include "core/rendering/RenderView.h" | 25 #include "core/rendering/RenderView.h" |
25 #include "platform/geometry/LayoutPoint.h" | 26 #include "platform/geometry/LayoutPoint.h" |
26 #include "platform/geometry/LayoutRect.h" | 27 #include "platform/geometry/LayoutRect.h" |
27 #include "platform/graphics/GraphicsContextStateSaver.h" | 28 #include "platform/graphics/GraphicsContextStateSaver.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // z-index. We paint after we painted the background/border, so that the scr
ollbars will | 81 // z-index. We paint after we painted the background/border, so that the scr
ollbars will |
81 // sit above the background/border. | 82 // sit above the background/border. |
82 paintOverflowControlsIfNeeded(localPaintInfo, adjustedPaintOffset); | 83 paintOverflowControlsIfNeeded(localPaintInfo, adjustedPaintOffset); |
83 } | 84 } |
84 | 85 |
85 void BlockPainter::paintOverflowControlsIfNeeded(const PaintInfo& paintInfo, con
st LayoutPoint& paintOffset) | 86 void BlockPainter::paintOverflowControlsIfNeeded(const PaintInfo& paintInfo, con
st LayoutPoint& paintOffset) |
86 { | 87 { |
87 PaintPhase phase = paintInfo.phase; | 88 PaintPhase phase = paintInfo.phase; |
88 if (m_renderBlock.hasOverflowClip() && m_renderBlock.style()->visibility() =
= VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBloc
kBackground) && paintInfo.shouldPaintWithinRoot(&m_renderBlock) && !paintInfo.pa
intRootBackgroundOnly()) { | 89 if (m_renderBlock.hasOverflowClip() && m_renderBlock.style()->visibility() =
= VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBloc
kBackground) && paintInfo.shouldPaintWithinRoot(&m_renderBlock) && !paintInfo.pa
intRootBackgroundOnly()) { |
89 RenderDrawingRecorder recorder(paintInfo.context, &m_renderBlock, paintI
nfo.phase, pixelSnappedIntRect(paintOffset, m_renderBlock.visualOverflowRect().s
ize())); | 90 RenderDrawingRecorder recorder(paintInfo.context, &m_renderBlock, paintI
nfo.phase, pixelSnappedIntRect(paintOffset, m_renderBlock.visualOverflowRect().s
ize())); |
90 m_renderBlock.layer()->scrollableArea()->paintOverflowControls(paintInfo
.context, roundedIntPoint(paintOffset), paintInfo.rect, false /* paintingOverlay
Controls */); | 91 ScrollableAreaPainter(*m_renderBlock.layer()->scrollableArea()).paintOve
rflowControls(paintInfo.context, roundedIntPoint(paintOffset), paintInfo.rect, f
alse /* paintingOverlayControls */); |
91 } | 92 } |
92 } | 93 } |
93 | 94 |
94 void BlockPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) | 95 void BlockPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) |
95 { | 96 { |
96 for (RenderBox* child = m_renderBlock.firstChildBox(); child; child = child-
>nextSiblingBox()) | 97 for (RenderBox* child = m_renderBlock.firstChildBox(); child; child = child-
>nextSiblingBox()) |
97 paintChild(child, paintInfo, paintOffset); | 98 paintChild(child, paintInfo, paintOffset); |
98 } | 99 } |
99 | 100 |
100 void BlockPainter::paintChild(RenderBox* child, const PaintInfo& paintInfo, cons
t LayoutPoint& paintOffset) | 101 void BlockPainter::paintChild(RenderBox* child, const PaintInfo& paintInfo, cons
t LayoutPoint& paintOffset) |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 RenderBlock* block = flow->containingBlock(); | 485 RenderBlock* block = flow->containingBlock(); |
485 for ( ; block && block != &m_renderBlock; block = block->containingBlock
()) | 486 for ( ; block && block != &m_renderBlock; block = block->containingBlock
()) |
486 accumulatedPaintOffset.moveBy(block->location()); | 487 accumulatedPaintOffset.moveBy(block->location()); |
487 ASSERT(block); | 488 ASSERT(block); |
488 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); | 489 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); |
489 } | 490 } |
490 } | 491 } |
491 | 492 |
492 | 493 |
493 } // namespace blink | 494 } // namespace blink |
OLD | NEW |