| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/PrePaintTreeWalk.h" | 5 #include "core/paint/PrePaintTreeWalk.h" |
| 6 | 6 |
| 7 #include "core/dom/DocumentLifecycle.h" | 7 #include "core/dom/DocumentLifecycle.h" |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" | 10 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 GeometryMapper::SourceToDestinationClipRect(local_state, ancestor_state); | 140 GeometryMapper::SourceToDestinationClipRect(local_state, ancestor_state); |
| 141 clip_rect.MoveBy(-FloatPoint(ancestor_paint_offset)); | 141 clip_rect.MoveBy(-FloatPoint(ancestor_paint_offset)); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void PrePaintTreeWalk::InvalidatePaintLayerOptimizationsIfNeeded( | 144 void PrePaintTreeWalk::InvalidatePaintLayerOptimizationsIfNeeded( |
| 145 const LayoutObject& object, | 145 const LayoutObject& object, |
| 146 PrePaintTreeWalkContext& context) { | 146 PrePaintTreeWalkContext& context) { |
| 147 if (!object.HasLayer()) | 147 if (!object.HasLayer()) |
| 148 return; | 148 return; |
| 149 | 149 |
| 150 // This method checks whether any changes to descendant-affecting clips |
| 151 // apply to any PaintLayer that supports subsequence caching. The |
| 152 // only PaintLayers that can have such an effect by themselves (i.e. |
| 153 // without any ancestor changes) are PaintLayers that have clip-related |
| 154 // properties and descendants (including self) that support subsequence |
| 155 // caching. |
| 150 PaintLayer& paint_layer = *ToLayoutBoxModelObject(object).Layer(); | 156 PaintLayer& paint_layer = *ToLayoutBoxModelObject(object).Layer(); |
| 157 if (!paint_layer.SupportsSubsequenceCaching() && |
| 158 (!paint_layer.HasDescendantThatSupportsSubsequenceCaching() || |
| 159 !paint_layer.GetLayoutObject().HasClipRelatedProperty())) |
| 160 return; |
| 161 |
| 151 if (object.StyleRef().HasTransform() || | 162 if (object.StyleRef().HasTransform() || |
| 152 &object == | 163 &object == |
| 153 context.paint_invalidator_context.paint_invalidation_container) { | 164 context.paint_invalidator_context.paint_invalidation_container) { |
| 154 context.ancestor_transformed_or_root_paint_layer = &paint_layer; | 165 context.ancestor_transformed_or_root_paint_layer = &paint_layer; |
| 155 } | 166 } |
| 156 | 167 |
| 157 const auto& ancestor = | 168 const auto& ancestor = |
| 158 context.ancestor_transformed_or_root_paint_layer->GetLayoutObject(); | 169 context.ancestor_transformed_or_root_paint_layer->GetLayoutObject(); |
| 159 PropertyTreeState ancestor_state = *ancestor.LocalBorderBoxProperties(); | 170 PropertyTreeState ancestor_state = *ancestor.LocalBorderBoxProperties(); |
| 160 | 171 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 } | 313 } |
| 303 Walk(*ToFrameView(frame_view_base), context); | 314 Walk(*ToFrameView(frame_view_base), context); |
| 304 } | 315 } |
| 305 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). | 316 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). |
| 306 } | 317 } |
| 307 | 318 |
| 308 object.GetMutableForPainting().ClearPaintFlags(); | 319 object.GetMutableForPainting().ClearPaintFlags(); |
| 309 } | 320 } |
| 310 | 321 |
| 311 } // namespace blink | 322 } // namespace blink |
| OLD | NEW |