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/ViewPainter.h" | 6 #include "core/paint/ViewPainter.h" |
7 | 7 |
8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/paint/BlockPainter.h" |
9 #include "core/rendering/GraphicsContextAnnotator.h" | 10 #include "core/rendering/GraphicsContextAnnotator.h" |
10 #include "core/rendering/PaintInfo.h" | 11 #include "core/rendering/PaintInfo.h" |
11 #include "core/rendering/RenderBox.h" | 12 #include "core/rendering/RenderBox.h" |
12 #include "core/rendering/RenderView.h" | 13 #include "core/rendering/RenderView.h" |
13 | 14 |
14 namespace blink { | 15 namespace blink { |
15 | 16 |
16 void ViewPainter::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) | 17 void ViewPainter::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
17 { | 18 { |
18 // If we ever require layout but receive a paint anyway, something has gone
horribly wrong. | 19 // If we ever require layout but receive a paint anyway, something has gone
horribly wrong. |
19 ASSERT(!m_renderView.needsLayout()); | 20 ASSERT(!m_renderView.needsLayout()); |
20 // RenderViews should never be called to paint with an offset not on device
pixels. | 21 // RenderViews should never be called to paint with an offset not on device
pixels. |
21 ASSERT(LayoutPoint(IntPoint(paintOffset.x(), paintOffset.y())) == paintOffse
t); | 22 ASSERT(LayoutPoint(IntPoint(paintOffset.x(), paintOffset.y())) == paintOffse
t); |
22 | 23 |
23 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_renderView); | 24 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_renderView); |
24 | 25 |
25 // This avoids painting garbage between columns if there is a column gap. | 26 // This avoids painting garbage between columns if there is a column gap. |
26 if (m_renderView.frameView() && m_renderView.style()->isOverflowPaged()) | 27 if (m_renderView.frameView() && m_renderView.style()->isOverflowPaged()) |
27 paintInfo.context->fillRect(paintInfo.rect, m_renderView.frameView()->ba
seBackgroundColor()); | 28 paintInfo.context->fillRect(paintInfo.rect, m_renderView.frameView()->ba
seBackgroundColor()); |
28 | 29 |
29 m_renderView.paintObject(paintInfo, paintOffset); | 30 m_renderView.paintObject(paintInfo, paintOffset); |
| 31 BlockPainter(m_renderView).paintOverflowControlsIfNeeded(paintInfo, paintOff
set); |
30 } | 32 } |
31 | 33 |
32 static inline bool rendererObscuresBackground(RenderBox* rootBox) | 34 static inline bool rendererObscuresBackground(RenderBox* rootBox) |
33 { | 35 { |
34 ASSERT(rootBox); | 36 ASSERT(rootBox); |
35 RenderStyle* style = rootBox->style(); | 37 RenderStyle* style = rootBox->style(); |
36 if (style->visibility() != VISIBLE | 38 if (style->visibility() != VISIBLE |
37 || style->opacity() != 1 | 39 || style->opacity() != 1 |
38 || style->hasFilter() | 40 || style->hasFilter() |
39 || style->hasTransform()) | 41 || style->hasTransform()) |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 { | 89 { |
88 ASSERT(rootBox); | 90 ASSERT(rootBox); |
89 // CSS Boxes always fill the viewport background (see paintRootBoxFillLayers
) | 91 // CSS Boxes always fill the viewport background (see paintRootBoxFillLayers
) |
90 if (!rootBox->isSVG()) | 92 if (!rootBox->isSVG()) |
91 return true; | 93 return true; |
92 | 94 |
93 return rootBox->frameRect().contains(m_renderView.frameRect()); | 95 return rootBox->frameRect().contains(m_renderView.frameRect()); |
94 } | 96 } |
95 | 97 |
96 } // namespace blink | 98 } // namespace blink |
OLD | NEW |