OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/BoxPaintInvalidator.h" | 5 #include "core/paint/BoxPaintInvalidator.h" |
6 | 6 |
7 #include "core/frame/Settings.h" | 7 #include "core/frame/Settings.h" |
8 #include "core/layout/LayoutView.h" | 8 #include "core/layout/LayoutView.h" |
9 #include "core/paint/ObjectPaintInvalidator.h" | 9 #include "core/paint/ObjectPaintInvalidator.h" |
10 #include "core/paint/PaintInvalidator.h" | 10 #include "core/paint/PaintInvalidator.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 return m_box.intersectsVisibleViewport() ? PaintInvalidationFull : Paint
InvalidationDelayedFull; | 123 return m_box.intersectsVisibleViewport() ? PaintInvalidationFull : Paint
InvalidationDelayedFull; |
124 } | 124 } |
125 | 125 |
126 if (m_box.isLayoutView()) { | 126 if (m_box.isLayoutView()) { |
127 const LayoutView& layoutView = toLayoutView(m_box); | 127 const LayoutView& layoutView = toLayoutView(m_box); |
128 // In normal compositing mode, root background doesn't need to be invali
dated for | 128 // In normal compositing mode, root background doesn't need to be invali
dated for |
129 // box changes, because the background always covers the whole document
rect | 129 // box changes, because the background always covers the whole document
rect |
130 // and clipping is done by compositor()->m_containerLayer. Also the scro
llbars | 130 // and clipping is done by compositor()->m_containerLayer. Also the scro
llbars |
131 // are always composited. There are no other box decoration on the Layou
tView thus | 131 // are always composited. There are no other box decoration on the Layou
tView thus |
132 // we can safely exit here. | 132 // we can safely exit here. |
133 if (layoutView.usesCompositing() && (!layoutView.document().settings() |
| !layoutView.document().settings()->rootLayerScrolls())) | 133 if (layoutView.usesCompositing() && !RuntimeEnabledFeatures::rootLayerSc
rollingEnabled()) |
134 return reason; | 134 return reason; |
135 } | 135 } |
136 | 136 |
137 // If the transform is not identity or translation, incremental invalidation
is not applicable | 137 // If the transform is not identity or translation, incremental invalidation
is not applicable |
138 // because the difference between oldBounds and newBounds doesn't cover all
area needing invalidation. | 138 // because the difference between oldBounds and newBounds doesn't cover all
area needing invalidation. |
139 // FIXME: Should also consider ancestor transforms since paintInvalidationCo
ntainer. crbug.com/426111. | 139 // FIXME: Should also consider ancestor transforms since paintInvalidationCo
ntainer. crbug.com/426111. |
140 if (reason == PaintInvalidationIncremental | 140 if (reason == PaintInvalidationIncremental |
141 && m_context.oldBounds != m_context.newBounds | 141 && m_context.oldBounds != m_context.newBounds |
142 && m_context.paintInvalidationContainer != m_box | 142 && m_context.paintInvalidationContainer != m_box |
143 && m_box.hasLayer() && m_box.layer()->transform() | 143 && m_box.hasLayer() && m_box.layer()->transform() |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 273 |
274 auto it = previousBoxSizesMap().find(&m_box); | 274 auto it = previousBoxSizesMap().find(&m_box); |
275 if (it != previousBoxSizesMap().end()) | 275 if (it != previousBoxSizesMap().end()) |
276 return it->value.borderBoxSize; | 276 return it->value.borderBoxSize; |
277 | 277 |
278 // We didn't save the old border box size because it was the same as the siz
e of oldBounds. | 278 // We didn't save the old border box size because it was the same as the siz
e of oldBounds. |
279 return previousBoundsSize; | 279 return previousBoundsSize; |
280 } | 280 } |
281 | 281 |
282 } // namespace blink | 282 } // namespace blink |
OLD | NEW |