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 ObjectPaintInvalidator_h | 5 #ifndef ObjectPaintInvalidator_h |
6 #define ObjectPaintInvalidator_h | 6 #define ObjectPaintInvalidator_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "platform/graphics/PaintInvalidationReason.h" | 9 #include "platform/graphics/PaintInvalidationReason.h" |
10 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 PaintInvalidationReason); | 105 PaintInvalidationReason); |
106 | 106 |
107 // This function generates a full invalidation, which means invalidating both | 107 // This function generates a full invalidation, which means invalidating both |
108 // |oldVisualRect| and |newVisualRect|. This is the default choice when | 108 // |oldVisualRect| and |newVisualRect|. This is the default choice when |
109 // generating an invalidation, as it is always correct, albeit it may force | 109 // generating an invalidation, as it is always correct, albeit it may force |
110 // some extra painting. | 110 // some extra painting. |
111 void fullyInvalidatePaint(PaintInvalidationReason, | 111 void fullyInvalidatePaint(PaintInvalidationReason, |
112 const LayoutRect& oldVisualRect, | 112 const LayoutRect& oldVisualRect, |
113 const LayoutRect& newVisualRect); | 113 const LayoutRect& newVisualRect); |
114 | 114 |
| 115 void invalidatePaintRectangleWithContext(const LayoutRect&, |
| 116 PaintInvalidationReason); |
| 117 |
115 private: | 118 private: |
116 void invalidateSelectionIfNeeded(PaintInvalidationReason); | 119 void invalidateSelectionIfNeeded(PaintInvalidationReason); |
117 | 120 |
118 const PaintInvalidatorContext& m_context; | 121 const PaintInvalidatorContext& m_context; |
119 }; | 122 }; |
120 | 123 |
121 // TODO(crbug.com/457415): We should not allow paint invalidation out of paint | 124 // TODO(crbug.com/457415): We should not allow paint invalidation out of paint |
122 // invalidation state. | 125 // invalidation state. |
123 class DisablePaintInvalidationStateAsserts { | 126 class DisablePaintInvalidationStateAsserts { |
124 STACK_ALLOCATED(); | 127 STACK_ALLOCATED(); |
125 WTF_MAKE_NONCOPYABLE(DisablePaintInvalidationStateAsserts); | 128 WTF_MAKE_NONCOPYABLE(DisablePaintInvalidationStateAsserts); |
126 | 129 |
127 public: | 130 public: |
128 DisablePaintInvalidationStateAsserts(); | 131 DisablePaintInvalidationStateAsserts(); |
129 | 132 |
130 private: | 133 private: |
131 AutoReset<bool> m_disabler; | 134 AutoReset<bool> m_disabler; |
132 }; | 135 }; |
133 | 136 |
134 } // namespace blink | 137 } // namespace blink |
135 | 138 |
136 #endif | 139 #endif |
OLD | NEW |