| 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 15 matching lines...) Expand all Loading... |
| 26 const PaintPropertyTreeBuilderContext& treeBuilderContext, | 26 const PaintPropertyTreeBuilderContext& treeBuilderContext, |
| 27 const PaintInvalidatorContext& parentContext) | 27 const PaintInvalidatorContext& parentContext) |
| 28 : treeBuilderContext(treeBuilderContext), | 28 : treeBuilderContext(treeBuilderContext), |
| 29 forcedSubtreeInvalidationFlags( | 29 forcedSubtreeInvalidationFlags( |
| 30 parentContext.forcedSubtreeInvalidationFlags), | 30 parentContext.forcedSubtreeInvalidationFlags), |
| 31 paintInvalidationContainer(parentContext.paintInvalidationContainer), | 31 paintInvalidationContainer(parentContext.paintInvalidationContainer), |
| 32 paintInvalidationContainerForStackedContents( | 32 paintInvalidationContainerForStackedContents( |
| 33 parentContext.paintInvalidationContainerForStackedContents), | 33 parentContext.paintInvalidationContainerForStackedContents), |
| 34 paintingLayer(parentContext.paintingLayer) {} | 34 paintingLayer(parentContext.paintingLayer) {} |
| 35 | 35 |
| 36 // This method is temporary to adapt PaintInvalidatorContext and the legacy Pa
intInvalidationState | 36 // This method is temporary to adapt PaintInvalidatorContext and the legacy |
| 37 // for code shared by old code and new code. | 37 // PaintInvalidationState for code shared by old code and new code. |
| 38 virtual void mapLocalRectToPaintInvalidationBacking(const LayoutObject&, | 38 virtual void mapLocalRectToPaintInvalidationBacking(const LayoutObject&, |
| 39 LayoutRect&) const; | 39 LayoutRect&) const; |
| 40 | 40 |
| 41 const PaintPropertyTreeBuilderContext& treeBuilderContext; | 41 const PaintPropertyTreeBuilderContext& treeBuilderContext; |
| 42 | 42 |
| 43 enum ForcedSubtreeInvalidationFlag { | 43 enum ForcedSubtreeInvalidationFlag { |
| 44 ForcedSubtreeInvalidationChecking = 1 << 0, | 44 ForcedSubtreeInvalidationChecking = 1 << 0, |
| 45 ForcedSubtreeInvalidationRectUpdate = 1 << 1, | 45 ForcedSubtreeInvalidationRectUpdate = 1 << 1, |
| 46 ForcedSubtreeFullInvalidation = 1 << 2, | 46 ForcedSubtreeFullInvalidation = 1 << 2, |
| 47 ForcedSubtreeFullInvalidationForStackedContents = 1 << 3, | 47 ForcedSubtreeFullInvalidationForStackedContents = 1 << 3, |
| 48 // TODO(crbug.com/637313): This is temporary before we support filters in pa
int property tree. | 48 // TODO(crbug.com/637313): This is temporary before we support filters in |
| 49 // paint property tree. |
| 49 ForcedSubtreeSlowPathRect = 1 << 4, | 50 ForcedSubtreeSlowPathRect = 1 << 4, |
| 50 }; | 51 }; |
| 51 unsigned forcedSubtreeInvalidationFlags = 0; | 52 unsigned forcedSubtreeInvalidationFlags = 0; |
| 52 | 53 |
| 53 // The following fields can be null only before PaintInvalidator::updateContex
t(). | 54 // The following fields can be null only before |
| 55 // PaintInvalidator::updateContext(). |
| 54 | 56 |
| 55 // The current paint invalidation container for normal flow objects. | 57 // The current paint invalidation container for normal flow objects. |
| 56 // It is the enclosing composited object. | 58 // It is the enclosing composited object. |
| 57 const LayoutBoxModelObject* paintInvalidationContainer = nullptr; | 59 const LayoutBoxModelObject* paintInvalidationContainer = nullptr; |
| 58 | 60 |
| 59 // The current paint invalidation container for stacked contents (stacking con
texts or positioned objects). | 61 // The current paint invalidation container for stacked contents (stacking |
| 60 // It is the nearest ancestor composited object which establishes a stacking c
ontext. | 62 // contexts or positioned objects). It is the nearest ancestor composited |
| 61 // See Source/core/paint/README.md ### PaintInvalidationState for details on h
ow stacked contents' | 63 // object which establishes a stacking context. See |
| 62 // paint invalidation containers differ. | 64 // Source/core/paint/README.md ### PaintInvalidationState for details on how |
| 65 // stacked contents' paint invalidation containers differ. |
| 63 const LayoutBoxModelObject* paintInvalidationContainerForStackedContents = | 66 const LayoutBoxModelObject* paintInvalidationContainerForStackedContents = |
| 64 nullptr; | 67 nullptr; |
| 65 | 68 |
| 66 PaintLayer* paintingLayer = nullptr; | 69 PaintLayer* paintingLayer = nullptr; |
| 67 | 70 |
| 68 LayoutRect oldBounds; | 71 LayoutRect oldBounds; |
| 69 LayoutRect newBounds; | 72 LayoutRect newBounds; |
| 70 LayoutPoint oldLocation; | 73 LayoutPoint oldLocation; |
| 71 LayoutPoint newLocation; | 74 LayoutPoint newLocation; |
| 72 }; | 75 }; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 94 void updatePaintingLayer(const LayoutObject&, PaintInvalidatorContext&); | 97 void updatePaintingLayer(const LayoutObject&, PaintInvalidatorContext&); |
| 95 void updateContext(const LayoutObject&, PaintInvalidatorContext&); | 98 void updateContext(const LayoutObject&, PaintInvalidatorContext&); |
| 96 | 99 |
| 97 Vector<const LayoutObject*> m_pendingDelayedPaintInvalidations; | 100 Vector<const LayoutObject*> m_pendingDelayedPaintInvalidations; |
| 98 GeometryMapper m_geometryMapper; | 101 GeometryMapper m_geometryMapper; |
| 99 }; | 102 }; |
| 100 | 103 |
| 101 } // namespace blink | 104 } // namespace blink |
| 102 | 105 |
| 103 #endif // PaintInvalidator_h | 106 #endif // PaintInvalidator_h |
| OLD | NEW |