OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 PaintInvalidator_h | 5 #ifndef PaintInvalidator_h |
6 #define PaintInvalidator_h | 6 #define PaintInvalidator_h |
7 | 7 |
8 #include "platform/geometry/LayoutRect.h" | 8 #include "platform/geometry/LayoutRect.h" |
9 #include "platform/graphics/paint/GeometryMapper.h" | 9 #include "platform/graphics/paint/GeometryMapper.h" |
10 #include "wtf/Vector.h" | 10 #include "wtf/Vector.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class FrameView; | 14 class FrameView; |
15 class LayoutBoxModelObject; | 15 class LayoutBoxModelObject; |
16 class LayoutObject; | 16 class LayoutObject; |
17 class PaintLayer; | 17 class PaintLayer; |
18 struct PaintPropertyTreeBuilderContext; | 18 struct PaintPropertyTreeBuilderContext; |
19 | 19 |
20 struct PaintInvalidatorContext { | 20 struct PaintInvalidatorContext { |
21 PaintInvalidatorContext( | 21 PaintInvalidatorContext( |
22 const PaintPropertyTreeBuilderContext& treeBuilderContext) | 22 const PaintPropertyTreeBuilderContext& treeBuilderContext) |
23 : treeBuilderContext(treeBuilderContext) {} | 23 : treeBuilderContext(treeBuilderContext), parentContext(nullptr) {} |
24 | 24 |
25 PaintInvalidatorContext( | 25 PaintInvalidatorContext( |
26 const PaintPropertyTreeBuilderContext& treeBuilderContext, | 26 const PaintPropertyTreeBuilderContext& treeBuilderContext, |
27 const PaintInvalidatorContext& parentContext) | 27 const PaintInvalidatorContext& parentContext) |
28 : treeBuilderContext(treeBuilderContext), | 28 : treeBuilderContext(treeBuilderContext), |
| 29 parentContext(&parentContext), |
29 forcedSubtreeInvalidationFlags( | 30 forcedSubtreeInvalidationFlags( |
30 parentContext.forcedSubtreeInvalidationFlags), | 31 parentContext.forcedSubtreeInvalidationFlags), |
31 paintInvalidationContainer(parentContext.paintInvalidationContainer), | 32 paintInvalidationContainer(parentContext.paintInvalidationContainer), |
32 paintInvalidationContainerForStackedContents( | 33 paintInvalidationContainerForStackedContents( |
33 parentContext.paintInvalidationContainerForStackedContents), | 34 parentContext.paintInvalidationContainerForStackedContents), |
34 paintingLayer(parentContext.paintingLayer) {} | 35 paintingLayer(parentContext.paintingLayer) {} |
35 | 36 |
36 // This method is temporary to adapt PaintInvalidatorContext and the legacy | 37 // This method is temporary to adapt PaintInvalidatorContext and the legacy |
37 // PaintInvalidationState for code shared by old code and new code. | 38 // PaintInvalidationState for code shared by old code and new code. |
38 virtual void mapLocalRectToPaintInvalidationBacking(const LayoutObject&, | 39 virtual void mapLocalRectToPaintInvalidationBacking(const LayoutObject&, |
39 LayoutRect&) const; | 40 LayoutRect&) const; |
40 | 41 |
41 const PaintPropertyTreeBuilderContext& treeBuilderContext; | 42 const PaintPropertyTreeBuilderContext& treeBuilderContext; |
| 43 const PaintInvalidatorContext* parentContext; |
42 | 44 |
43 enum ForcedSubtreeInvalidationFlag { | 45 enum ForcedSubtreeInvalidationFlag { |
44 ForcedSubtreeInvalidationChecking = 1 << 0, | 46 ForcedSubtreeInvalidationChecking = 1 << 0, |
45 ForcedSubtreeInvalidationRectUpdate = 1 << 1, | 47 ForcedSubtreeInvalidationRectUpdate = 1 << 1, |
46 ForcedSubtreeFullInvalidation = 1 << 2, | 48 ForcedSubtreeFullInvalidation = 1 << 2, |
47 ForcedSubtreeFullInvalidationForStackedContents = 1 << 3, | 49 ForcedSubtreeFullInvalidationForStackedContents = 1 << 3, |
48 ForcedSubtreeSVGResourceChange = 1 << 4, | 50 ForcedSubtreeSVGResourceChange = 1 << 4, |
49 // TODO(crbug.com/637313): This is temporary before we support filters in | 51 // TODO(crbug.com/637313): This is temporary before we support filters in |
50 // paint property tree. | 52 // paint property tree. |
51 ForcedSubtreeSlowPathRect = 1 << 5, | 53 ForcedSubtreeSlowPathRect = 1 << 5, |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 ALWAYS_INLINE void updateContext(const LayoutObject&, | 109 ALWAYS_INLINE void updateContext(const LayoutObject&, |
108 PaintInvalidatorContext&); | 110 PaintInvalidatorContext&); |
109 | 111 |
110 Vector<const LayoutObject*> m_pendingDelayedPaintInvalidations; | 112 Vector<const LayoutObject*> m_pendingDelayedPaintInvalidations; |
111 GeometryMapper& m_geometryMapper; | 113 GeometryMapper& m_geometryMapper; |
112 }; | 114 }; |
113 | 115 |
114 } // namespace blink | 116 } // namespace blink |
115 | 117 |
116 #endif // PaintInvalidator_h | 118 #endif // PaintInvalidator_h |
OLD | NEW |