| 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 "core/paint/ViewPainter.h" | 5 #include "core/paint/ViewPainter.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/layout/LayoutBox.h" | 9 #include "core/layout/LayoutBox.h" |
| 10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
| 11 #include "core/paint/BlockPainter.h" | 11 #include "core/paint/BlockPainter.h" |
| 12 #include "core/paint/BoxPainter.h" | 12 #include "core/paint/BoxPainter.h" |
| 13 #include "core/paint/LayoutObjectDrawingRecorder.h" | 13 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| 14 #include "core/paint/PaintInfo.h" | 14 #include "core/paint/PaintInfo.h" |
| 15 #include "core/paint/PaintLayer.h" | 15 #include "core/paint/PaintLayer.h" |
| 16 #include "platform/RuntimeEnabledFeatures.h" | 16 #include "platform/RuntimeEnabledFeatures.h" |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 | 19 |
| 20 void ViewPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffs
et) | 20 void ViewPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffs
et) |
| 21 { | 21 { |
| 22 // If we ever require layout but receive a paint anyway, something has gone
horribly wrong. | 22 // If we ever require layout but receive a paint anyway, something has gone
horribly wrong. |
| 23 ASSERT(!m_layoutView.needsLayout()); | 23 DCHECK(!m_layoutView.needsLayout()); |
| 24 // LayoutViews should never be called to paint with an offset not on device
pixels. | 24 // LayoutViews should never be called to paint with an offset not on device
pixels. |
| 25 ASSERT(LayoutPoint(IntPoint(paintOffset.x(), paintOffset.y())) == paintOffse
t); | 25 DCHECK(LayoutPoint(IntPoint(paintOffset.x().toInt(), paintOffset.y().toInt()
)) == paintOffset); |
| 26 | 26 |
| 27 const FrameView* frameView = m_layoutView.frameView(); | 27 const FrameView* frameView = m_layoutView.frameView(); |
| 28 if (frameView->shouldThrottleRendering()) | 28 if (frameView->shouldThrottleRendering()) |
| 29 return; | 29 return; |
| 30 | 30 |
| 31 m_layoutView.paintObject(paintInfo, paintOffset); | 31 m_layoutView.paintObject(paintInfo, paintOffset); |
| 32 BlockPainter(m_layoutView).paintOverflowControlsIfNeeded(paintInfo, paintOff
set); | 32 BlockPainter(m_layoutView).paintOverflowControlsIfNeeded(paintInfo, paintOff
set); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void ViewPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo) | 35 void ViewPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo) |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 BoxPainter::paintFillLayer(m_layoutView, paintInfo, Color(), **it, L
ayoutRect(paintRect), BackgroundBleedNone); | 151 BoxPainter::paintFillLayer(m_layoutView, paintInfo, Color(), **it, L
ayoutRect(paintRect), BackgroundBleedNone); |
| 152 context.restore(); | 152 context.restore(); |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 if (shouldDrawBackgroundInSeparateBuffer) | 156 if (shouldDrawBackgroundInSeparateBuffer) |
| 157 context.endLayer(); | 157 context.endLayer(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace blink | 160 } // namespace blink |
| OLD | NEW |