| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 if (!object.HasLayer()) | 150 if (!object.HasLayer()) |
| 151 return; | 151 return; |
| 152 | 152 |
| 153 PaintLayer& paint_layer = *ToLayoutBoxModelObject(object).Layer(); | 153 PaintLayer& paint_layer = *ToLayoutBoxModelObject(object).Layer(); |
| 154 if (object.StyleRef().HasTransform() || | 154 if (object.StyleRef().HasTransform() || |
| 155 &object == | 155 &object == |
| 156 context.paint_invalidator_context.paint_invalidation_container) { | 156 context.paint_invalidator_context.paint_invalidation_container) { |
| 157 context.ancestor_transformed_or_root_paint_layer = &paint_layer; | 157 context.ancestor_transformed_or_root_paint_layer = &paint_layer; |
| 158 } | 158 } |
| 159 | 159 |
| 160 // This code below checks whether any clips have changed that might: |
| 161 // (a) invalidate optimizations made for a PaintLayer that supports |
| 162 // subsequence caching, or |
| 163 // (b) impact clipping of descendant visual rects. |
| 164 if (!paint_layer.SupportsSubsequenceCaching() && |
| 165 !paint_layer.GetLayoutObject().HasClipRelatedProperty()) |
| 166 return; |
| 167 |
| 160 const auto& ancestor = | 168 const auto& ancestor = |
| 161 context.ancestor_transformed_or_root_paint_layer->GetLayoutObject(); | 169 context.ancestor_transformed_or_root_paint_layer->GetLayoutObject(); |
| 162 PropertyTreeState ancestor_state = *ancestor.LocalBorderBoxProperties(); | 170 PropertyTreeState ancestor_state = *ancestor.LocalBorderBoxProperties(); |
| 163 | 171 |
| 164 #ifdef CHECK_CLIP_RECTS | 172 #ifdef CHECK_CLIP_RECTS |
| 165 auto respect_overflow_clip = kRespectOverflowClip; | 173 auto respect_overflow_clip = kRespectOverflowClip; |
| 166 #endif | 174 #endif |
| 167 if (context.ancestor_transformed_or_root_paint_layer->GetCompositingState() == | 175 if (context.ancestor_transformed_or_root_paint_layer->GetCompositingState() == |
| 168 kPaintsIntoOwnBacking) { | 176 kPaintsIntoOwnBacking) { |
| 169 const auto* ancestor_properties = ancestor.PaintProperties(); | 177 const auto* ancestor_properties = ancestor.PaintProperties(); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 } | 317 } |
| 310 Walk(*frame_view, context); | 318 Walk(*frame_view, context); |
| 311 } | 319 } |
| 312 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). | 320 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). |
| 313 } | 321 } |
| 314 | 322 |
| 315 object.GetMutableForPainting().ClearPaintFlags(); | 323 object.GetMutableForPainting().ClearPaintFlags(); |
| 316 } | 324 } |
| 317 | 325 |
| 318 } // namespace blink | 326 } // namespace blink |
| OLD | NEW |