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" |
(...skipping 12 matching lines...) Expand all Loading... |
23 : treeBuilderContext(treeBuilderContext), parentContext(nullptr) {} | 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 parentContext(&parentContext), |
30 forcedSubtreeInvalidationFlags( | 30 forcedSubtreeInvalidationFlags( |
31 parentContext.forcedSubtreeInvalidationFlags), | 31 parentContext.forcedSubtreeInvalidationFlags), |
32 paintInvalidationContainer(parentContext.paintInvalidationContainer), | 32 paintInvalidationContainer(parentContext.paintInvalidationContainer), |
| 33 scrollAdjustment(parentContext.scrollAdjustment), |
33 paintInvalidationContainerForStackedContents( | 34 paintInvalidationContainerForStackedContents( |
34 parentContext.paintInvalidationContainerForStackedContents), | 35 parentContext.paintInvalidationContainerForStackedContents), |
35 paintingLayer(parentContext.paintingLayer) {} | 36 paintingLayer(parentContext.paintingLayer) {} |
36 | 37 |
37 // This method is temporary to adapt PaintInvalidatorContext and the legacy | 38 // This method is temporary to adapt PaintInvalidatorContext and the legacy |
38 // PaintInvalidationState for code shared by old code and new code. | 39 // PaintInvalidationState for code shared by old code and new code. |
39 virtual void mapLocalRectToVisualRectInBacking(const LayoutObject&, | 40 virtual void mapLocalRectToVisualRectInBacking(const LayoutObject&, |
40 LayoutRect&) const; | 41 LayoutRect&) const; |
41 | 42 |
42 const PaintPropertyTreeBuilderContext& treeBuilderContext; | 43 const PaintPropertyTreeBuilderContext& treeBuilderContext; |
(...skipping 11 matching lines...) Expand all Loading... |
54 }; | 55 }; |
55 unsigned forcedSubtreeInvalidationFlags = 0; | 56 unsigned forcedSubtreeInvalidationFlags = 0; |
56 | 57 |
57 // The following fields can be null only before | 58 // The following fields can be null only before |
58 // PaintInvalidator::updateContext(). | 59 // PaintInvalidator::updateContext(). |
59 | 60 |
60 // The current paint invalidation container for normal flow objects. | 61 // The current paint invalidation container for normal flow objects. |
61 // It is the enclosing composited object. | 62 // It is the enclosing composited object. |
62 const LayoutBoxModelObject* paintInvalidationContainer = nullptr; | 63 const LayoutBoxModelObject* paintInvalidationContainer = nullptr; |
63 | 64 |
| 65 // Adjusts scrolling contents coordinates in non-composited paint invalidation |
| 66 // container into container coordinates. It's empty for non-scrolling or |
| 67 // composited-scrolling paint invalidation container. |
| 68 IntSize scrollAdjustment; |
| 69 |
64 // The current paint invalidation container for stacked contents (stacking | 70 // The current paint invalidation container for stacked contents (stacking |
65 // contexts or positioned objects). It is the nearest ancestor composited | 71 // contexts or positioned objects). It is the nearest ancestor composited |
66 // object which establishes a stacking context. See | 72 // object which establishes a stacking context. See |
67 // Source/core/paint/README.md ### PaintInvalidationState for details on how | 73 // Source/core/paint/README.md ### PaintInvalidationState for details on how |
68 // stacked contents' paint invalidation containers differ. | 74 // stacked contents' paint invalidation containers differ. |
69 const LayoutBoxModelObject* paintInvalidationContainerForStackedContents = | 75 const LayoutBoxModelObject* paintInvalidationContainerForStackedContents = |
70 nullptr; | 76 nullptr; |
71 | 77 |
72 PaintLayer* paintingLayer = nullptr; | 78 PaintLayer* paintingLayer = nullptr; |
73 | 79 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 ALWAYS_INLINE void updateVisualRect(const LayoutObject&, | 117 ALWAYS_INLINE void updateVisualRect(const LayoutObject&, |
112 PaintInvalidatorContext&); | 118 PaintInvalidatorContext&); |
113 | 119 |
114 Vector<const LayoutObject*> m_pendingDelayedPaintInvalidations; | 120 Vector<const LayoutObject*> m_pendingDelayedPaintInvalidations; |
115 GeometryMapper& m_geometryMapper; | 121 GeometryMapper& m_geometryMapper; |
116 }; | 122 }; |
117 | 123 |
118 } // namespace blink | 124 } // namespace blink |
119 | 125 |
120 #endif // PaintInvalidator_h | 126 #endif // PaintInvalidator_h |
OLD | NEW |