Chromium Code Reviews| 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 (RuntimeEnabledFeatures::slimmingPaintV2Enabled() || | |
|
chrishtr
2017/04/13 17:19:54
I also added this for symmetry with PaintInvalidat
| |
| 159 !paint_layer.HasDescendantThatSupportsSubsequenceCaching() || | |
| 160 !paint_layer.GetLayoutObject().HasClipRelatedProperty())) | |
| 161 return; | |
| 162 | |
| 151 if (object.StyleRef().HasTransform() || | 163 if (object.StyleRef().HasTransform() || |
| 152 &object == | 164 &object == |
| 153 context.paint_invalidator_context.paint_invalidation_container) { | 165 context.paint_invalidator_context.paint_invalidation_container) { |
| 154 context.ancestor_transformed_or_root_paint_layer = &paint_layer; | 166 context.ancestor_transformed_or_root_paint_layer = &paint_layer; |
| 155 } | 167 } |
| 156 | 168 |
| 157 const auto& ancestor = | 169 const auto& ancestor = |
| 158 context.ancestor_transformed_or_root_paint_layer->GetLayoutObject(); | 170 context.ancestor_transformed_or_root_paint_layer->GetLayoutObject(); |
| 159 PropertyTreeState ancestor_state = *ancestor.LocalBorderBoxProperties(); | 171 PropertyTreeState ancestor_state = *ancestor.LocalBorderBoxProperties(); |
| 160 | 172 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 302 } | 314 } |
| 303 Walk(*ToFrameView(frame_view_base), context); | 315 Walk(*ToFrameView(frame_view_base), context); |
| 304 } | 316 } |
| 305 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). | 317 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). |
| 306 } | 318 } |
| 307 | 319 |
| 308 object.GetMutableForPainting().ClearPaintFlags(); | 320 object.GetMutableForPainting().ClearPaintFlags(); |
| 309 } | 321 } |
| 310 | 322 |
| 311 } // namespace blink | 323 } // namespace blink |
| OLD | NEW |