| 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/layout/PaintInvalidationState.h" | 6 #include "core/layout/PaintInvalidationState.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutInline.h" | 8 #include "core/layout/LayoutInline.h" |
| 9 #include "core/layout/LayoutView.h" | 9 #include "core/layout/LayoutView.h" |
| 10 #include "core/layout/svg/LayoutSVGModelObject.h" | 10 #include "core/layout/svg/LayoutSVGModelObject.h" |
| 11 #include "core/layout/svg/LayoutSVGRoot.h" | 11 #include "core/layout/svg/LayoutSVGRoot.h" |
| 12 #include "core/paint/DeprecatedPaintLayer.h" | 12 #include "core/paint/DeprecatedPaintLayer.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 PaintInvalidationState::PaintInvalidationState(const LayoutView& layoutView, Vec
tor<LayoutObject*>& pendingDelayedPaintInvalidations) | 16 PaintInvalidationState::PaintInvalidationState(const LayoutView& layoutView, Vec
tor<LayoutObject*>& pendingDelayedPaintInvalidations, PaintInvalidationState* ow
nerPaintInvalidationState) |
| 17 : m_clipped(false) | 17 : m_clipped(false) |
| 18 , m_cachedOffsetsEnabled(true) | 18 , m_cachedOffsetsEnabled(true) |
| 19 , m_forceCheckForPaintInvalidation(false) | 19 , m_forceCheckForPaintInvalidation(false) |
| 20 , m_paintInvalidationContainer(*layoutView.containerForPaintInvalidation()) | 20 , m_paintInvalidationContainer(*layoutView.containerForPaintInvalidation()) |
| 21 , m_pendingDelayedPaintInvalidations(pendingDelayedPaintInvalidations) | 21 , m_pendingDelayedPaintInvalidations(pendingDelayedPaintInvalidations) |
| 22 { | 22 { |
| 23 bool establishesPaintInvalidationContainer = layoutView == m_paintInvalidati
onContainer; | 23 bool establishesPaintInvalidationContainer = layoutView == m_paintInvalidati
onContainer; |
| 24 if (!establishesPaintInvalidationContainer) { | 24 if (!establishesPaintInvalidationContainer) { |
| 25 if (!layoutView.supportsPaintInvalidationStateCachedOffsets()) { | 25 if ((ownerPaintInvalidationState && !ownerPaintInvalidationState->m_cach
edOffsetsEnabled) |
| 26 || !layoutView.supportsPaintInvalidationStateCachedOffsets()) { |
| 26 m_cachedOffsetsEnabled = false; | 27 m_cachedOffsetsEnabled = false; |
| 27 return; | 28 return; |
| 28 } | 29 } |
| 30 if (ownerPaintInvalidationState && ownerPaintInvalidationState->m_forceC
heckForPaintInvalidation) |
| 31 m_forceCheckForPaintInvalidation = true; |
| 29 FloatPoint point = layoutView.localToContainerPoint(FloatPoint(), &m_pai
ntInvalidationContainer, TraverseDocumentBoundaries); | 32 FloatPoint point = layoutView.localToContainerPoint(FloatPoint(), &m_pai
ntInvalidationContainer, TraverseDocumentBoundaries); |
| 30 m_paintOffset = LayoutSize(point.x(), point.y()); | 33 m_paintOffset = LayoutSize(point.x(), point.y()); |
| 31 } | 34 } |
| 32 m_clipRect = layoutView.viewRect(); | 35 m_clipRect = layoutView.viewRect(); |
| 33 m_clipRect.move(m_paintOffset); | 36 m_clipRect.move(m_paintOffset); |
| 34 m_clipped = true; | 37 m_clipped = true; |
| 35 } | 38 } |
| 36 | 39 |
| 37 PaintInvalidationState::PaintInvalidationState(PaintInvalidationState& next, Lay
outBoxModelObject& layoutObject, const LayoutBoxModelObject& paintInvalidationCo
ntainer) | 40 PaintInvalidationState::PaintInvalidationState(PaintInvalidationState& next, Lay
outBoxModelObject& layoutObject, const LayoutBoxModelObject& paintInvalidationCo
ntainer) |
| 38 : m_clipped(false) | 41 : m_clipped(false) |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // to be always invalidated in-time. | 130 // to be always invalidated in-time. |
| 128 if (box.usesCompositedScrolling()) | 131 if (box.usesCompositedScrolling()) |
| 129 ASSERT(!m_clipped); // The box should establish paint invalidation conta
iner, so no m_clipped inherited. | 132 ASSERT(!m_clipped); // The box should establish paint invalidation conta
iner, so no m_clipped inherited. |
| 130 else | 133 else |
| 131 addClipRectRelativeToPaintOffset(LayoutSize(box.layer()->size())); | 134 addClipRectRelativeToPaintOffset(LayoutSize(box.layer()->size())); |
| 132 | 135 |
| 133 m_paintOffset -= box.scrolledContentOffset(); | 136 m_paintOffset -= box.scrolledContentOffset(); |
| 134 } | 137 } |
| 135 | 138 |
| 136 } // namespace blink | 139 } // namespace blink |
| OLD | NEW |