| 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 26 matching lines...) Expand all Loading... |
| 37 // This method is temporary to adapt PaintInvalidatorContext and the legacy | 37 // This method is temporary to adapt PaintInvalidatorContext and the legacy |
| 38 // PaintInvalidationState for code shared by old code and new code. | 38 // PaintInvalidationState for code shared by old code and new code. |
| 39 virtual void mapLocalRectToPaintInvalidationBacking(const LayoutObject&, | 39 virtual void mapLocalRectToPaintInvalidationBacking(const LayoutObject&, |
| 40 LayoutRect&) const; | 40 LayoutRect&) const; |
| 41 | 41 |
| 42 const PaintPropertyTreeBuilderContext& treeBuilderContext; | 42 const PaintPropertyTreeBuilderContext& treeBuilderContext; |
| 43 const PaintInvalidatorContext* parentContext; | 43 const PaintInvalidatorContext* parentContext; |
| 44 | 44 |
| 45 enum ForcedSubtreeInvalidationFlag { | 45 enum ForcedSubtreeInvalidationFlag { |
| 46 ForcedSubtreeInvalidationChecking = 1 << 0, | 46 ForcedSubtreeInvalidationChecking = 1 << 0, |
| 47 ForcedSubtreeInvalidationRectUpdate = 1 << 1, | 47 ForcedSubtreeVisualRectUpdate = 1 << 1, |
| 48 ForcedSubtreeFullInvalidation = 1 << 2, | 48 ForcedSubtreeFullInvalidation = 1 << 2, |
| 49 ForcedSubtreeFullInvalidationForStackedContents = 1 << 3, | 49 ForcedSubtreeFullInvalidationForStackedContents = 1 << 3, |
| 50 ForcedSubtreeSVGResourceChange = 1 << 4, | 50 ForcedSubtreeSVGResourceChange = 1 << 4, |
| 51 // 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 |
| 52 // paint property tree. | 52 // paint property tree. |
| 53 ForcedSubtreeSlowPathRect = 1 << 5, | 53 ForcedSubtreeSlowPathRect = 1 << 5, |
| 54 }; | 54 }; |
| 55 unsigned forcedSubtreeInvalidationFlags = 0; | 55 unsigned forcedSubtreeInvalidationFlags = 0; |
| 56 | 56 |
| 57 // The following fields can be null only before | 57 // The following fields can be null only before |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 PaintInvalidator(GeometryMapper& geometryMapper) | 91 PaintInvalidator(GeometryMapper& geometryMapper) |
| 92 : m_geometryMapper(geometryMapper) {} | 92 : m_geometryMapper(geometryMapper) {} |
| 93 | 93 |
| 94 void invalidatePaintIfNeeded(FrameView&, PaintInvalidatorContext&); | 94 void invalidatePaintIfNeeded(FrameView&, PaintInvalidatorContext&); |
| 95 void invalidatePaintIfNeeded(const LayoutObject&, PaintInvalidatorContext&); | 95 void invalidatePaintIfNeeded(const LayoutObject&, PaintInvalidatorContext&); |
| 96 | 96 |
| 97 // Process objects needing paint invalidation on the next frame. | 97 // Process objects needing paint invalidation on the next frame. |
| 98 // See the definition of PaintInvalidationDelayedFull for more details. | 98 // See the definition of PaintInvalidationDelayedFull for more details. |
| 99 void processPendingDelayedPaintInvalidations(); | 99 void processPendingDelayedPaintInvalidations(); |
| 100 | 100 |
| 101 bool needsVisualRectUpdate(const LayoutObject&, |
| 102 const PaintInvalidatorContext&); |
| 103 |
| 101 private: | 104 private: |
| 102 ALWAYS_INLINE LayoutRect | 105 ALWAYS_INLINE LayoutRect |
| 103 computeVisualRectInBacking(const LayoutObject&, | 106 computeVisualRectInBacking(const LayoutObject&, |
| 104 const PaintInvalidatorContext&); | 107 const PaintInvalidatorContext&); |
| 105 ALWAYS_INLINE LayoutPoint | 108 ALWAYS_INLINE LayoutPoint |
| 106 computeLocationInBacking(const LayoutObject&, const PaintInvalidatorContext&); | 109 computeLocationInBacking(const LayoutObject&, const PaintInvalidatorContext&); |
| 107 ALWAYS_INLINE void updatePaintingLayer(const LayoutObject&, | 110 ALWAYS_INLINE void updatePaintingLayer(const LayoutObject&, |
| 108 PaintInvalidatorContext&); | 111 PaintInvalidatorContext&); |
| 109 ALWAYS_INLINE void updatePaintInvalidationContainer(const LayoutObject&, | 112 ALWAYS_INLINE void updatePaintInvalidationContainer(const LayoutObject&, |
| 110 PaintInvalidatorContext&); | 113 PaintInvalidatorContext&); |
| 114 ALWAYS_INLINE void updateVisualRectIfNeeded(const LayoutObject&, |
| 115 PaintInvalidatorContext&); |
| 111 ALWAYS_INLINE void updateVisualRect(const LayoutObject&, | 116 ALWAYS_INLINE void updateVisualRect(const LayoutObject&, |
| 112 PaintInvalidatorContext&); | 117 PaintInvalidatorContext&); |
| 113 | 118 |
| 114 Vector<const LayoutObject*> m_pendingDelayedPaintInvalidations; | 119 Vector<const LayoutObject*> m_pendingDelayedPaintInvalidations; |
| 115 GeometryMapper& m_geometryMapper; | 120 GeometryMapper& m_geometryMapper; |
| 116 }; | 121 }; |
| 117 | 122 |
| 118 } // namespace blink | 123 } // namespace blink |
| 119 | 124 |
| 120 #endif // PaintInvalidator_h | 125 #endif // PaintInvalidator_h |
| OLD | NEW |