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 #ifndef PrePaintTreeWalk_h | 5 #ifndef PrePaintTreeWalk_h |
| 6 #define PrePaintTreeWalk_h | 6 #define PrePaintTreeWalk_h |
| 7 | 7 |
| 8 #include "core/paint/ClipRect.h" | 8 #include "core/paint/ClipRect.h" |
| 9 #include "core/paint/PaintInvalidator.h" | 9 #include "core/paint/PaintInvalidator.h" |
| 10 #include "core/paint/PaintPropertyTreeBuilder.h" | 10 #include "core/paint/PaintPropertyTreeBuilder.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class FrameView; | 14 class FrameView; |
| 15 class LayoutObject; | 15 class LayoutObject; |
| 16 class PropertyTreeState; | 16 class PropertyTreeState; |
| 17 struct PrePaintTreeWalkContext; | 17 struct PrePaintTreeWalkContext; |
| 18 | 18 |
| 19 // This class walks the whole layout tree, beginning from the root FrameView, | 19 // This class walks the whole layout tree, beginning from the root FrameView, |
| 20 // across frame boundaries. Helper classes are called for each tree node to | 20 // across frame boundaries. Helper classes are called for each tree node to |
| 21 // perform actual actions. It expects to be invoked in InPrePaint phase. | 21 // perform actual actions. It expects to be invoked in InPrePaint phase. |
| 22 class PrePaintTreeWalk { | 22 class CORE_EXPORT PrePaintTreeWalk { |
|
pdr.
2017/04/12 18:40:06
Is this only needed for tests?
chrishtr
2017/04/13 02:05:59
Yes.
| |
| 23 public: | 23 public: |
| 24 PrePaintTreeWalk() {} | 24 PrePaintTreeWalk() {} |
| 25 void Walk(FrameView& root_frame); | 25 void Walk(FrameView& root_frame); |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 void Walk(FrameView&, const PrePaintTreeWalkContext&); | 28 void Walk(FrameView&, const PrePaintTreeWalkContext&); |
| 29 void Walk(const LayoutObject&, const PrePaintTreeWalkContext&); | 29 void Walk(const LayoutObject&, const PrePaintTreeWalkContext&); |
| 30 | 30 |
| 31 bool ShouldEarlyOut(const LayoutObject&, | |
| 32 const PrePaintTreeWalkContext& parent_context, | |
| 33 bool& needs_tree_builder_context_update); | |
| 34 | |
| 31 // Invalidates paint-layer painting optimizations, such as subsequence caching | 35 // Invalidates paint-layer painting optimizations, such as subsequence caching |
| 32 // and empty paint phase optimizations if clips from the context have changed. | 36 // and empty paint phase optimizations if clips from the context have changed. |
| 33 ALWAYS_INLINE void InvalidatePaintLayerOptimizationsIfNeeded( | 37 ALWAYS_INLINE void InvalidatePaintLayerOptimizationsIfNeeded( |
| 34 const LayoutObject&, | 38 const LayoutObject&, |
| 35 PrePaintTreeWalkContext&); | 39 PrePaintTreeWalkContext&); |
| 36 | 40 |
| 37 // Returns in |clipRect| the clip applied to children for the given | 41 // Returns in |clipRect| the clip applied to children for the given |
| 38 // contaiing block context + effect, in the space of ancestorState adjusted | 42 // contaiing block context + effect, in the space of ancestorState adjusted |
| 39 // by ancestorPaintOffset. | 43 // by ancestorPaintOffset. |
| 40 ALWAYS_INLINE void ComputeClipRectForContext( | 44 ALWAYS_INLINE void ComputeClipRectForContext( |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 51 NeedsTreeBuilderContextUpdate(const LayoutObject&, | 55 NeedsTreeBuilderContextUpdate(const LayoutObject&, |
| 52 const PrePaintTreeWalkContext&); | 56 const PrePaintTreeWalkContext&); |
| 53 | 57 |
| 54 PaintPropertyTreeBuilder property_tree_builder_; | 58 PaintPropertyTreeBuilder property_tree_builder_; |
| 55 PaintInvalidator paint_invalidator_; | 59 PaintInvalidator paint_invalidator_; |
| 56 }; | 60 }; |
| 57 | 61 |
| 58 } // namespace blink | 62 } // namespace blink |
| 59 | 63 |
| 60 #endif // PrePaintTreeWalk_h | 64 #endif // PrePaintTreeWalk_h |
| OLD | NEW |