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