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" |
| 11 #include "core/layout/LayoutPart.h" | 11 #include "core/layout/LayoutPart.h" |
| 12 #include "core/layout/LayoutView.h" | 12 #include "core/layout/LayoutView.h" |
| 13 #include "core/paint/PaintLayer.h" | 13 #include "core/paint/PaintLayer.h" |
| 14 #include "platform/graphics/paint/GeometryMapper.h" | 14 #include "platform/graphics/paint/GeometryMapper.h" |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 struct PrePaintTreeWalkContext { | 18 struct PrePaintTreeWalkContext { |
| 19 PrePaintTreeWalkContext() | 19 PrePaintTreeWalkContext() |
| 20 : tree_builder_context( | 20 : tree_builder_context( |
| 21 WTF::WrapUnique(new PaintPropertyTreeBuilderContext)), | 21 WTF::WrapUnique(new PaintPropertyTreeBuilderContext)), |
| 22 paint_invalidator_context(tree_builder_context.get()), | 22 paint_invalidator_context(tree_builder_context.get()), |
| 23 ancestor_overflow_paint_layer(nullptr), | |
| 24 ancestor_transformed_or_root_paint_layer(nullptr) {} | 23 ancestor_transformed_or_root_paint_layer(nullptr) {} |
| 25 | 24 |
| 26 PrePaintTreeWalkContext(const PrePaintTreeWalkContext& parent_context, | 25 PrePaintTreeWalkContext(const PrePaintTreeWalkContext& parent_context, |
| 27 bool needs_tree_builder_context) | 26 bool needs_tree_builder_context) |
| 28 : tree_builder_context( | 27 : tree_builder_context( |
| 29 WTF::WrapUnique(needs_tree_builder_context || DCHECK_IS_ON() | 28 WTF::WrapUnique(needs_tree_builder_context || DCHECK_IS_ON() |
| 30 ? new PaintPropertyTreeBuilderContext( | 29 ? new PaintPropertyTreeBuilderContext( |
| 31 *parent_context.tree_builder_context) | 30 *parent_context.tree_builder_context) |
| 32 : nullptr)), | 31 : nullptr)), |
| 33 paint_invalidator_context(tree_builder_context.get(), | 32 paint_invalidator_context(tree_builder_context.get(), |
| 34 parent_context.paint_invalidator_context), | 33 parent_context.paint_invalidator_context), |
| 35 ancestor_overflow_paint_layer( | |
| 36 parent_context.ancestor_overflow_paint_layer), | |
| 37 ancestor_transformed_or_root_paint_layer( | 34 ancestor_transformed_or_root_paint_layer( |
| 38 parent_context.ancestor_transformed_or_root_paint_layer) { | 35 parent_context.ancestor_transformed_or_root_paint_layer) { |
| 39 #if DCHECK_IS_ON() | 36 #if DCHECK_IS_ON() |
| 40 if (needs_tree_builder_context) | 37 if (needs_tree_builder_context) |
| 41 DCHECK(parent_context.tree_builder_context->is_actually_needed); | 38 DCHECK(parent_context.tree_builder_context->is_actually_needed); |
| 42 tree_builder_context->is_actually_needed = needs_tree_builder_context; | 39 tree_builder_context->is_actually_needed = needs_tree_builder_context; |
| 43 #endif | 40 #endif |
| 44 } | 41 } |
| 45 | 42 |
| 46 // PaintPropertyTreeBuilderContext is large and can lead to stack overflows | 43 // PaintPropertyTreeBuilderContext is large and can lead to stack overflows |
| 47 // when recursion is deep so this context object is allocated on the heap. | 44 // when recursion is deep so this context object is allocated on the heap. |
| 48 // See: https://crbug.com/698653. | 45 // See: https://crbug.com/698653. |
| 49 std::unique_ptr<PaintPropertyTreeBuilderContext> tree_builder_context; | 46 std::unique_ptr<PaintPropertyTreeBuilderContext> tree_builder_context; |
| 50 | 47 |
| 51 PaintInvalidatorContext paint_invalidator_context; | 48 PaintInvalidatorContext paint_invalidator_context; |
| 52 | 49 |
| 53 // The ancestor in the PaintLayer tree which has overflow clip, or | 50 // The ancestor in the PaintLayer tree which hasa transform or is a root |
|
wkorman
2017/05/01 21:58:09
has a
chrishtr
2017/05/01 22:40:07
Done.
| |
| 54 // is the root layer. Note that it is tree ancestor, not containing | 51 // layer for painting (i.e. a paint invalidation container). |
| 55 // block or stacking ancestor. | |
| 56 PaintLayer* ancestor_overflow_paint_layer; | |
| 57 PaintLayer* ancestor_transformed_or_root_paint_layer; | 52 PaintLayer* ancestor_transformed_or_root_paint_layer; |
| 58 }; | 53 }; |
| 59 | 54 |
| 60 void PrePaintTreeWalk::Walk(FrameView& root_frame) { | 55 void PrePaintTreeWalk::Walk(FrameView& root_frame) { |
| 61 DCHECK(root_frame.GetFrame().GetDocument()->Lifecycle().GetState() == | 56 DCHECK(root_frame.GetFrame().GetDocument()->Lifecycle().GetState() == |
| 62 DocumentLifecycle::kInPrePaint); | 57 DocumentLifecycle::kInPrePaint); |
| 63 | 58 |
| 64 PrePaintTreeWalkContext initial_context; | 59 PrePaintTreeWalkContext initial_context; |
| 65 initial_context.ancestor_transformed_or_root_paint_layer = | 60 initial_context.ancestor_transformed_or_root_paint_layer = |
| 66 root_frame.GetLayoutView()->Layer(); | 61 root_frame.GetLayoutView()->Layer(); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 77 const PrePaintTreeWalkContext& parent_context) { | 72 const PrePaintTreeWalkContext& parent_context) { |
| 78 if (frame_view.ShouldThrottleRendering()) { | 73 if (frame_view.ShouldThrottleRendering()) { |
| 79 // Skip the throttled frame. Will update it when it becomes unthrottled. | 74 // Skip the throttled frame. Will update it when it becomes unthrottled. |
| 80 return; | 75 return; |
| 81 } | 76 } |
| 82 | 77 |
| 83 bool needs_tree_builder_context_update = | 78 bool needs_tree_builder_context_update = |
| 84 this->NeedsTreeBuilderContextUpdate(frame_view, parent_context); | 79 this->NeedsTreeBuilderContextUpdate(frame_view, parent_context); |
| 85 PrePaintTreeWalkContext context(parent_context, | 80 PrePaintTreeWalkContext context(parent_context, |
| 86 needs_tree_builder_context_update); | 81 needs_tree_builder_context_update); |
| 87 // ancestorOverflowLayer does not cross frame boundaries. | |
| 88 context.ancestor_overflow_paint_layer = nullptr; | |
| 89 if (context.tree_builder_context) { | 82 if (context.tree_builder_context) { |
| 90 property_tree_builder_.UpdateProperties(frame_view, | 83 property_tree_builder_.UpdateProperties(frame_view, |
| 91 *context.tree_builder_context); | 84 *context.tree_builder_context); |
| 92 } | 85 } |
| 93 paint_invalidator_.InvalidatePaint(frame_view, | 86 paint_invalidator_.InvalidatePaint(frame_view, |
| 94 context.paint_invalidator_context); | 87 context.paint_invalidator_context); |
| 95 | 88 |
| 96 if (LayoutView* view = frame_view.GetLayoutView()) { | 89 if (LayoutView* view = frame_view.GetLayoutView()) { |
| 97 Walk(*view, context); | 90 Walk(*view, context); |
| 98 #if DCHECK_IS_ON() | 91 #if DCHECK_IS_ON() |
| 99 view->AssertSubtreeClearedPaintInvalidationFlags(); | 92 view->AssertSubtreeClearedPaintInvalidationFlags(); |
| 100 #endif | 93 #endif |
| 101 } | 94 } |
| 102 frame_view.ClearNeedsPaintPropertyUpdate(); | 95 frame_view.ClearNeedsPaintPropertyUpdate(); |
| 103 } | 96 } |
| 104 | 97 |
| 105 static void UpdateAuxiliaryObjectProperties(const LayoutObject& object, | 98 static void UpdateAuxiliaryObjectProperties(const LayoutObject& object, |
| 106 PrePaintTreeWalkContext& context) { | 99 PrePaintTreeWalkContext& context) { |
| 107 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 100 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| 108 return; | 101 return; |
| 109 | 102 |
| 110 if (!object.HasLayer()) | 103 if (!object.HasLayer()) |
| 111 return; | 104 return; |
| 112 | 105 |
| 113 PaintLayer* paint_layer = object.EnclosingLayer(); | 106 PaintLayer* paint_layer = object.EnclosingLayer(); |
| 114 paint_layer->UpdateAncestorOverflowLayer( | |
| 115 context.ancestor_overflow_paint_layer); | |
| 116 | 107 |
| 117 if (object.StyleRef().GetPosition() == EPosition::kSticky) { | 108 if (object.StyleRef().GetPosition() == EPosition::kSticky) { |
| 118 paint_layer->GetLayoutObject().UpdateStickyPositionConstraints(); | 109 paint_layer->GetLayoutObject().UpdateStickyPositionConstraints(); |
| 119 | 110 |
| 120 // Sticky position constraints and ancestor overflow scroller affect the | 111 // Sticky position constraints and ancestor overflow scroller affect the |
| 121 // sticky layer position, so we need to update it again here. | 112 // sticky layer position, so we need to update it again here. |
| 122 // TODO(flackr): This should be refactored in the future to be clearer (i.e. | 113 // TODO(flackr): This should be refactored in the future to be clearer (i.e. |
| 123 // update layer position and ancestor inputs updates in the same walk). | 114 // update layer position and ancestor inputs updates in the same walk). |
| 124 paint_layer->UpdateLayerPosition(); | 115 paint_layer->UpdateLayerPosition(); |
| 125 } | 116 } |
| 126 | |
| 127 if (paint_layer->IsRootLayer() || object.HasOverflowClip()) | |
| 128 context.ancestor_overflow_paint_layer = paint_layer; | |
| 129 } | 117 } |
| 130 | 118 |
| 131 LayoutRect PrePaintTreeWalk::ComputeClipRectForContext( | 119 LayoutRect PrePaintTreeWalk::ComputeClipRectForContext( |
| 132 const PaintPropertyTreeBuilderFragmentContext::ContainingBlockContext& | 120 const PaintPropertyTreeBuilderFragmentContext::ContainingBlockContext& |
| 133 context, | 121 context, |
| 134 const EffectPaintPropertyNode* effect, | 122 const EffectPaintPropertyNode* effect, |
| 135 const PropertyTreeState& ancestor_state, | 123 const PropertyTreeState& ancestor_state, |
| 136 const LayoutPoint& ancestor_paint_offset) { | 124 const LayoutPoint& ancestor_paint_offset) { |
| 137 PropertyTreeState local_state(context.transform, context.clip, effect); | 125 PropertyTreeState local_state(context.transform, context.clip, effect); |
| 138 | 126 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 159 } | 147 } |
| 160 | 148 |
| 161 // This code below checks whether any clips have changed that might: | 149 // This code below checks whether any clips have changed that might: |
| 162 // (a) invalidate optimizations made for a PaintLayer that supports | 150 // (a) invalidate optimizations made for a PaintLayer that supports |
| 163 // subsequence caching, or | 151 // subsequence caching, or |
| 164 // (b) impact clipping of descendant visual rects. | 152 // (b) impact clipping of descendant visual rects. |
| 165 if (!paint_layer.SupportsSubsequenceCaching() && | 153 if (!paint_layer.SupportsSubsequenceCaching() && |
| 166 !paint_layer.GetLayoutObject().HasClipRelatedProperty()) | 154 !paint_layer.GetLayoutObject().HasClipRelatedProperty()) |
| 167 return; | 155 return; |
| 168 | 156 |
| 157 FragmentData* fragment_data = | |
| 158 &object.GetMutableForPainting().EnsureFirstFragment(); | |
| 159 for (auto& fragment : context.tree_builder_context->fragments) { | |
| 160 DCHECK(fragment_data); | |
| 161 if (InvalidatePaintLayerOptimizationsForFragment( | |
| 162 object, context.ancestor_transformed_or_root_paint_layer, fragment, | |
| 163 *fragment_data)) { | |
| 164 context.paint_invalidator_context.forced_subtree_invalidation_flags |= | |
| 165 PaintInvalidatorContext::kForcedSubtreeVisualRectUpdate; | |
| 166 } | |
| 167 fragment_data = fragment_data->NextFragment(); | |
| 168 } | |
| 169 } | |
| 170 | |
| 171 bool PrePaintTreeWalk::InvalidatePaintLayerOptimizationsForFragment( | |
| 172 const LayoutObject& object, | |
| 173 const PaintLayer* ancestor_transformed_or_root_paint_layer, | |
| 174 const PaintPropertyTreeBuilderFragmentContext& context, | |
| 175 FragmentData& fragment_data) { | |
| 176 PaintLayer& paint_layer = *ToLayoutBoxModelObject(object).Layer(); | |
| 177 | |
| 169 const auto& ancestor = | 178 const auto& ancestor = |
| 170 context.ancestor_transformed_or_root_paint_layer->GetLayoutObject(); | 179 ancestor_transformed_or_root_paint_layer->GetLayoutObject(); |
| 171 PropertyTreeState ancestor_state = *ancestor.LocalBorderBoxProperties(); | 180 PropertyTreeState ancestor_state = *ancestor.LocalBorderBoxProperties(); |
| 172 | 181 |
| 173 #ifdef CHECK_CLIP_RECTS | 182 #ifdef CHECK_CLIP_RECTS |
| 174 auto respect_overflow_clip = kRespectOverflowClip; | 183 auto respect_overflow_clip = kRespectOverflowClip; |
| 175 #endif | 184 #endif |
| 176 if (context.ancestor_transformed_or_root_paint_layer->GetCompositingState() == | 185 if (ancestor_transformed_or_root_paint_layer->GetCompositingState() == |
| 177 kPaintsIntoOwnBacking) { | 186 kPaintsIntoOwnBacking) { |
| 178 const auto* ancestor_properties = ancestor.PaintProperties(); | 187 const auto* ancestor_properties = ancestor.PaintProperties(); |
| 179 if (ancestor_properties && ancestor_properties->OverflowClip()) { | 188 if (ancestor_properties && ancestor_properties->OverflowClip()) { |
| 180 ancestor_state.SetClip(ancestor_properties->OverflowClip()); | 189 ancestor_state.SetClip(ancestor_properties->OverflowClip()); |
| 181 #ifdef CHECK_CLIP_RECTS | 190 #ifdef CHECK_CLIP_RECTS |
| 182 respect_overflow_clip = kIgnoreOverflowClip; | 191 respect_overflow_clip = kIgnoreOverflowClip; |
| 183 #endif | 192 #endif |
| 184 } | 193 } |
| 185 } | 194 } |
| 186 | 195 |
| 187 #ifdef CHECK_CLIP_RECTS | 196 #ifdef CHECK_CLIP_RECTS |
| 188 const auto& old_clip_rects = | 197 const auto& old_clip_rects = |
| 189 paint_layer.Clipper(PaintLayer::kDoNotUseGeometryMapper) | 198 paint_layer.Clipper(PaintLayer::kDoNotUseGeometryMapper) |
| 190 .PaintingClipRects(context.ancestor_transformed_or_root_paint_layer, | 199 .PaintingClipRects(ancestor_transformed_or_root_paint_layer, |
| 191 respect_overflow_clip, LayoutSize()); | 200 respect_overflow_clip, LayoutSize()); |
| 192 #endif | 201 #endif |
| 193 | 202 |
| 194 const LayoutPoint& ancestor_paint_offset = | 203 const LayoutPoint& ancestor_paint_offset = |
| 195 context.ancestor_transformed_or_root_paint_layer->GetLayoutObject() | 204 ancestor_transformed_or_root_paint_layer->GetLayoutObject().PaintOffset(); |
| 196 .PaintOffset(); | |
| 197 | 205 |
| 198 // TODO(chrishtr): generalize this for multicol. | 206 // TODO(chrishtr): generalize this for multicol. |
| 199 const auto* effect = | 207 const auto* effect = context.current_effect; |
| 200 context.tree_builder_context->fragments[0].current_effect; | |
| 201 auto overflow_clip_rect = ComputeClipRectForContext( | 208 auto overflow_clip_rect = ComputeClipRectForContext( |
| 202 context.tree_builder_context->fragments[0].current, effect, | 209 context.current, effect, ancestor_state, ancestor_paint_offset); |
| 203 ancestor_state, ancestor_paint_offset); | |
| 204 #ifdef CHECK_CLIP_RECTS | 210 #ifdef CHECK_CLIP_RECTS |
| 205 CHECK(overflow_clip_rect == old_clip_rects.OverflowClipRect().Rect()) | 211 CHECK(overflow_clip_rect == old_clip_rects.OverflowClipRect().Rect()) |
| 206 << " new=" << overflow_clip_rect.ToString() | 212 << " new=" << overflow_clip_rect.ToString() |
| 207 << " old=" << old_clip_rects.OverflowClipRect().Rect().ToString(); | 213 << " old=" << old_clip_rects.OverflowClipRect().Rect().ToString(); |
| 208 #endif | 214 #endif |
| 209 | 215 |
| 210 auto fixed_clip_rect = ComputeClipRectForContext( | 216 auto fixed_clip_rect = ComputeClipRectForContext( |
| 211 context.tree_builder_context->fragments[0].fixed_position, effect, | 217 context.fixed_position, effect, ancestor_state, ancestor_paint_offset); |
| 212 ancestor_state, ancestor_paint_offset); | |
| 213 #ifdef CHECK_CLIP_RECTS | 218 #ifdef CHECK_CLIP_RECTS |
| 214 CHECK(fixed_clip_rect == old_clip_rects.FixedClipRect().Rect()) | 219 CHECK(fixed_clip_rect == old_clip_rects.FixedClipRect().Rect()) |
| 215 << " new=" << fixed_clip_rect.ToString() | 220 << " new=" << fixed_clip_rect.ToString() |
| 216 << " old=" << old_clip_rects.FixedClipRect().Rect().ToString(); | 221 << " old=" << old_clip_rects.FixedClipRect().Rect().ToString(); |
| 217 #endif | 222 #endif |
| 218 | 223 |
| 219 auto pos_clip_rect = ComputeClipRectForContext( | 224 auto pos_clip_rect = ComputeClipRectForContext( |
| 220 context.tree_builder_context->fragments[0].absolute_position, effect, | 225 context.absolute_position, effect, ancestor_state, ancestor_paint_offset); |
| 221 ancestor_state, ancestor_paint_offset); | |
| 222 #ifdef CHECK_CLIP_RECTS | 226 #ifdef CHECK_CLIP_RECTS |
| 223 CHECK(pos_clip_rect == old_clip_rects.PosClipRect().Rect()) | 227 CHECK(pos_clip_rect == old_clip_rects.PosClipRect().Rect()) |
| 224 << " new=" << pos_clip_rect.ToString() | 228 << " new=" << pos_clip_rect.ToString() |
| 225 << " old=" << old_clip_rects.PosClipRect().Rect().ToString(); | 229 << " old=" << old_clip_rects.PosClipRect().Rect().ToString(); |
| 226 #endif | 230 #endif |
| 227 | 231 |
| 228 const auto* previous_clip_rects = paint_layer.PreviousPaintingClipRects(); | 232 const auto* previous_clip_rects = fragment_data.PreviousClipRects(); |
| 229 if (!previous_clip_rects || | 233 if (!previous_clip_rects || |
| 230 overflow_clip_rect != previous_clip_rects->OverflowClipRect().Rect() || | 234 overflow_clip_rect != previous_clip_rects->OverflowClipRect().Rect() || |
| 231 fixed_clip_rect != previous_clip_rects->FixedClipRect().Rect() || | 235 fixed_clip_rect != previous_clip_rects->FixedClipRect().Rect() || |
| 232 pos_clip_rect != previous_clip_rects->PosClipRect().Rect()) { | 236 pos_clip_rect != previous_clip_rects->PosClipRect().Rect()) { |
| 233 RefPtr<ClipRects> clip_rects = ClipRects::Create(); | 237 RefPtr<ClipRects> clip_rects = ClipRects::Create(); |
| 234 clip_rects->SetOverflowClipRect(overflow_clip_rect); | 238 clip_rects->SetOverflowClipRect(overflow_clip_rect); |
| 235 clip_rects->SetFixedClipRect(fixed_clip_rect); | 239 clip_rects->SetFixedClipRect(fixed_clip_rect); |
| 236 clip_rects->SetPosClipRect(pos_clip_rect); | 240 clip_rects->SetPosClipRect(pos_clip_rect); |
| 237 paint_layer.SetPreviousPaintingClipRects(*clip_rects); | 241 fragment_data.SetPreviousClipRects(*clip_rects); |
| 238 | 242 |
| 239 paint_layer.SetNeedsRepaint(); | 243 paint_layer.SetNeedsRepaint(); |
| 240 paint_layer.SetPreviousPaintPhaseDescendantOutlinesEmpty(false); | 244 paint_layer.SetPreviousPaintPhaseDescendantOutlinesEmpty(false); |
| 241 paint_layer.SetPreviousPaintPhaseFloatEmpty(false); | 245 paint_layer.SetPreviousPaintPhaseFloatEmpty(false); |
| 242 paint_layer.SetPreviousPaintPhaseDescendantBlockBackgroundsEmpty(false); | 246 paint_layer.SetPreviousPaintPhaseDescendantBlockBackgroundsEmpty(false); |
| 243 // All subsequences which are contained below this paintLayer must also | 247 // All subsequences which are contained below this paintLayer must also |
| 244 // be checked. | 248 // be checked. |
| 245 context.paint_invalidator_context.forced_subtree_invalidation_flags |= | 249 return true; |
| 246 PaintInvalidatorContext::kForcedSubtreeVisualRectUpdate; | |
| 247 } | 250 } |
| 251 return false; | |
| 248 } | 252 } |
| 249 | 253 |
| 250 bool PrePaintTreeWalk::NeedsTreeBuilderContextUpdate( | 254 bool PrePaintTreeWalk::NeedsTreeBuilderContextUpdate( |
| 251 const FrameView& frame_view, | 255 const FrameView& frame_view, |
| 252 const PrePaintTreeWalkContext& context) { | 256 const PrePaintTreeWalkContext& context) { |
| 253 return frame_view.NeedsPaintPropertyUpdate() || | 257 return frame_view.NeedsPaintPropertyUpdate() || |
| 254 (frame_view.GetLayoutView() && | 258 (frame_view.GetLayoutView() && |
| 255 NeedsTreeBuilderContextUpdate(*frame_view.GetLayoutView(), context)); | 259 NeedsTreeBuilderContextUpdate(*frame_view.GetLayoutView(), context)); |
| 256 } | 260 } |
| 257 | 261 |
| 258 bool PrePaintTreeWalk::NeedsTreeBuilderContextUpdate( | 262 bool PrePaintTreeWalk::NeedsTreeBuilderContextUpdate( |
| 259 const LayoutObject& object, | 263 const LayoutObject& object, |
| 260 const PrePaintTreeWalkContext& parent_context) { | 264 const PrePaintTreeWalkContext& parent_context) { |
| 261 return object.NeedsPaintPropertyUpdate() || | 265 return object.NeedsPaintPropertyUpdate() || |
| 262 object.DescendantNeedsPaintPropertyUpdate() || | 266 object.DescendantNeedsPaintPropertyUpdate() || |
| 263 (parent_context.tree_builder_context && | 267 (parent_context.tree_builder_context && |
| 264 parent_context.tree_builder_context->force_subtree_update) || | 268 parent_context.tree_builder_context->force_subtree_update) || |
| 265 // If the object needs visual rect update, we should update tree | 269 // If the object needs visual rect update, we should update tree |
| 266 // builder context which is needed by visual rect update. | 270 // builder context which is needed by visual rect update. |
| 267 parent_context.paint_invalidator_context.NeedsVisualRectUpdate(object); | 271 parent_context.paint_invalidator_context.NeedsVisualRectUpdate(object); |
| 268 } | 272 } |
| 269 | 273 |
| 274 void PrePaintTreeWalk::ClearPreviousClipRectsForTesting( | |
| 275 const LayoutObject& object) { | |
| 276 object.GetMutableForPainting().FirstFragment()->ClearPreviousClipRects(); | |
| 277 } | |
| 278 | |
| 270 void PrePaintTreeWalk::Walk(const LayoutObject& object, | 279 void PrePaintTreeWalk::Walk(const LayoutObject& object, |
| 271 const PrePaintTreeWalkContext& parent_context) { | 280 const PrePaintTreeWalkContext& parent_context) { |
| 272 // Early out from the tree walk if possible. | 281 // Early out from the tree walk if possible. |
| 273 bool needs_tree_builder_context_update = | 282 bool needs_tree_builder_context_update = |
| 274 this->NeedsTreeBuilderContextUpdate(object, parent_context); | 283 this->NeedsTreeBuilderContextUpdate(object, parent_context); |
| 275 if (!needs_tree_builder_context_update && | 284 if (!needs_tree_builder_context_update && |
| 276 !object.ShouldCheckForPaintInvalidation()) | 285 !object.ShouldCheckForPaintInvalidation()) |
| 277 return; | 286 return; |
| 278 | 287 |
| 279 PrePaintTreeWalkContext context(parent_context, | 288 PrePaintTreeWalkContext context(parent_context, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 } | 329 } |
| 321 Walk(*frame_view, context); | 330 Walk(*frame_view, context); |
| 322 } | 331 } |
| 323 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). | 332 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). |
| 324 } | 333 } |
| 325 | 334 |
| 326 object.GetMutableForPainting().ClearPaintFlags(); | 335 object.GetMutableForPainting().ClearPaintFlags(); |
| 327 } | 336 } |
| 328 | 337 |
| 329 } // namespace blink | 338 } // namespace blink |
| OLD | NEW |