| 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/layout/PaintInvalidationState.h" | 5 #include "core/layout/PaintInvalidationState.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/LayoutInline.h" | 9 #include "core/layout/LayoutInline.h" |
| 10 #include "core/layout/LayoutPart.h" | 10 #include "core/layout/LayoutPart.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 m_paintOffset = LayoutSize(); | 146 m_paintOffset = LayoutSize(); |
| 147 return; | 147 return; |
| 148 } | 148 } |
| 149 | 149 |
| 150 if (!m_cachedOffsetsEnabled) | 150 if (!m_cachedOffsetsEnabled) |
| 151 return; | 151 return; |
| 152 | 152 |
| 153 if (currentObject.isLayoutView()) { | 153 if (currentObject.isLayoutView()) { |
| 154 ASSERT(&parentState.m_currentObject == toLayoutView(currentObject).frame
()->ownerLayoutObject()); | 154 ASSERT(&parentState.m_currentObject == toLayoutView(currentObject).frame
()->ownerLayoutObject()); |
| 155 m_paintOffset += toLayoutBox(parentState.m_currentObject).contentBoxOffs
et(); | 155 m_paintOffset += toLayoutBox(parentState.m_currentObject).contentBoxOffs
et(); |
| 156 // a LayoutView paints with a defined size but a pixel-rounded offset. |
| 157 m_paintOffset = LayoutSize(roundedIntSize(m_paintOffset)); |
| 156 return; | 158 return; |
| 157 } | 159 } |
| 158 | 160 |
| 159 if (currentObject.isBox()) | 161 if (currentObject.isBox()) |
| 160 m_paintOffset += toLayoutBox(currentObject).locationOffset(); | 162 m_paintOffset += toLayoutBox(currentObject).locationOffset(); |
| 161 | 163 |
| 162 if (currentObject.isInFlowPositioned() && currentObject.hasLayer()) | 164 if (currentObject.isInFlowPositioned() && currentObject.hasLayer()) |
| 163 m_paintOffset += toLayoutBoxModelObject(currentObject).layer()->offsetFo
rInFlowPosition(); | 165 m_paintOffset += toLayoutBoxModelObject(currentObject).layer()->offsetFo
rInFlowPosition(); |
| 164 } | 166 } |
| 165 | 167 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 346 |
| 345 PaintLayer& PaintInvalidationState::enclosingSelfPaintingLayer(const LayoutObjec
t& layoutObject) const | 347 PaintLayer& PaintInvalidationState::enclosingSelfPaintingLayer(const LayoutObjec
t& layoutObject) const |
| 346 { | 348 { |
| 347 if (layoutObject.hasLayer() && toLayoutBoxModelObject(layoutObject).hasSelfP
aintingLayer()) | 349 if (layoutObject.hasLayer() && toLayoutBoxModelObject(layoutObject).hasSelfP
aintingLayer()) |
| 348 return *toLayoutBoxModelObject(layoutObject).layer(); | 350 return *toLayoutBoxModelObject(layoutObject).layer(); |
| 349 | 351 |
| 350 return m_enclosingSelfPaintingLayer; | 352 return m_enclosingSelfPaintingLayer; |
| 351 } | 353 } |
| 352 | 354 |
| 353 } // namespace blink | 355 } // namespace blink |
| OLD | NEW |