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/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
10 #include "core/layout/LayoutBox.h" | 10 #include "core/layout/LayoutBox.h" |
11 #include "core/layout/LayoutView.h" | 11 #include "core/layout/LayoutView.h" |
12 #include "core/paint/BlockPainter.h" | 12 #include "core/paint/BlockPainter.h" |
13 #include "core/paint/BoxPainter.h" | 13 #include "core/paint/BoxPainter.h" |
14 #include "core/paint/DeprecatedPaintLayer.h" | 14 #include "core/paint/DeprecatedPaintLayer.h" |
15 #include "core/paint/LayoutObjectDrawingRecorder.h" | 15 #include "core/paint/LayoutObjectDrawingRecorder.h" |
16 #include "core/paint/PaintInfo.h" | 16 #include "core/paint/PaintInfo.h" |
17 #include "platform/RuntimeEnabledFeatures.h" | 17 #include "platform/RuntimeEnabledFeatures.h" |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 | 20 |
21 void ViewPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffs
et) | 21 void ViewPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffs
et) |
22 { | 22 { |
23 // If we ever require layout but receive a paint anyway, something has gone
horribly wrong. | 23 // If we ever require layout but receive a paint anyway, something has gone
horribly wrong. |
24 ASSERT(!m_layoutView.needsLayout()); | 24 ASSERT(!m_layoutView.needsLayout()); |
25 // LayoutViews should never be called to paint with an offset not on device
pixels. | 25 // LayoutViews should never be called to paint with an offset not on device
pixels. |
26 ASSERT(LayoutPoint(IntPoint(paintOffset.x(), paintOffset.y())) == paintOffse
t); | 26 ASSERT(LayoutPoint(IntPoint(paintOffset.x(), paintOffset.y())) == paintOffse
t); |
27 | 27 |
| 28 const FrameView* frameView = m_layoutView.frameView(); |
| 29 if (frameView->shouldThrottleRenderingPipeline()) |
| 30 return; |
| 31 |
28 m_layoutView.paintObject(paintInfo, paintOffset); | 32 m_layoutView.paintObject(paintInfo, paintOffset); |
29 BlockPainter(m_layoutView).paintOverflowControlsIfNeeded(paintInfo, paintOff
set); | 33 BlockPainter(m_layoutView).paintOverflowControlsIfNeeded(paintInfo, paintOff
set); |
30 } | 34 } |
31 | 35 |
32 void ViewPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo) | 36 void ViewPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo) |
33 { | 37 { |
34 if (!paintInfo.shouldPaintWithinRoot(&m_layoutView)) | 38 if (!paintInfo.shouldPaintWithinRoot(&m_layoutView)) |
35 return; | 39 return; |
36 | 40 |
37 if (paintInfo.skipRootBackground()) | 41 if (paintInfo.skipRootBackground()) |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 ASSERT((*it)->clip() == BorderFillBox); | 145 ASSERT((*it)->clip() == BorderFillBox); |
142 BoxPainter::paintFillLayerExtended(m_layoutView, paintInfo, Color(), **i
t, LayoutRect(paintRect), BackgroundBleedNone); | 146 BoxPainter::paintFillLayerExtended(m_layoutView, paintInfo, Color(), **i
t, LayoutRect(paintRect), BackgroundBleedNone); |
143 } | 147 } |
144 context.restore(); | 148 context.restore(); |
145 | 149 |
146 if (shouldDrawBackgroundInSeparateBuffer) | 150 if (shouldDrawBackgroundInSeparateBuffer) |
147 context.endLayer(); | 151 context.endLayer(); |
148 } | 152 } |
149 | 153 |
150 } // namespace blink | 154 } // namespace blink |
OLD | NEW |