| 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" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 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 m_layoutView.paintObject(paintInfo, paintOffset); | 28 m_layoutView.paintObject(paintInfo, paintOffset); |
| 29 BlockPainter(m_layoutView).paintOverflowControlsIfNeeded(paintInfo, paintOff
set); | 29 BlockPainter(m_layoutView).paintOverflowControlsIfNeeded(paintInfo, paintOff
set); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void ViewPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo) | 32 void ViewPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo) |
| 33 { | 33 { |
| 34 if (!paintInfo.shouldPaintWithinRoot(&m_layoutView)) |
| 35 return; |
| 36 |
| 34 if (paintInfo.skipRootBackground()) | 37 if (paintInfo.skipRootBackground()) |
| 35 return; | 38 return; |
| 36 | 39 |
| 37 // This function overrides background painting for the LayoutView. | 40 // This function overrides background painting for the LayoutView. |
| 38 // View background painting is special in the following ways: | 41 // View background painting is special in the following ways: |
| 39 // 1. The view paints background for the root element, the background positi
oning respects | 42 // 1. The view paints background for the root element, the background positi
oning respects |
| 40 // the positioning and transformation of the root element. | 43 // the positioning and transformation of the root element. |
| 41 // 2. CSS background-clip is ignored, the background layers always expand to
cover the whole | 44 // 2. CSS background-clip is ignored, the background layers always expand to
cover the whole |
| 42 // canvas. None of the stacking context effects (except transformation) o
n the root element | 45 // canvas. None of the stacking context effects (except transformation) o
n the root element |
| 43 // affects the background. | 46 // affects the background. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 ASSERT((*it)->clip() == BorderFillBox); | 131 ASSERT((*it)->clip() == BorderFillBox); |
| 129 BoxPainter::paintFillLayerExtended(m_layoutView, paintInfo, Color(), **i
t, LayoutRect(paintRect), BackgroundBleedNone); | 132 BoxPainter::paintFillLayerExtended(m_layoutView, paintInfo, Color(), **i
t, LayoutRect(paintRect), BackgroundBleedNone); |
| 130 } | 133 } |
| 131 context.restore(); | 134 context.restore(); |
| 132 | 135 |
| 133 if (shouldDrawBackgroundInSeparateBuffer) | 136 if (shouldDrawBackgroundInSeparateBuffer) |
| 134 context.endLayer(); | 137 context.endLayer(); |
| 135 } | 138 } |
| 136 | 139 |
| 137 } // namespace blink | 140 } // namespace blink |
| OLD | NEW |