| 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 "platform/wtf/Allocator.h" | 10 #include "platform/wtf/Allocator.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 protected: | 88 protected: |
| 89 const LayoutObject& object_; | 89 const LayoutObject& object_; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 class ObjectPaintInvalidatorWithContext : public ObjectPaintInvalidator { | 92 class ObjectPaintInvalidatorWithContext : public ObjectPaintInvalidator { |
| 93 public: | 93 public: |
| 94 ObjectPaintInvalidatorWithContext(const LayoutObject& object, | 94 ObjectPaintInvalidatorWithContext(const LayoutObject& object, |
| 95 const PaintInvalidatorContext& context) | 95 const PaintInvalidatorContext& context) |
| 96 : ObjectPaintInvalidator(object), context_(context) {} | 96 : ObjectPaintInvalidator(object), context_(context) {} |
| 97 | 97 |
| 98 PaintInvalidationReason InvalidatePaintIfNeeded() { | 98 PaintInvalidationReason InvalidatePaint() { |
| 99 return InvalidatePaintIfNeededWithComputedReason( | 99 return InvalidatePaintWithComputedReason(ComputePaintInvalidationReason()); |
| 100 ComputePaintInvalidationReason()); | |
| 101 } | 100 } |
| 102 | 101 |
| 103 PaintInvalidationReason ComputePaintInvalidationReason(); | 102 PaintInvalidationReason ComputePaintInvalidationReason(); |
| 104 PaintInvalidationReason InvalidatePaintIfNeededWithComputedReason( | 103 PaintInvalidationReason InvalidatePaintWithComputedReason( |
| 105 PaintInvalidationReason); | 104 PaintInvalidationReason); |
| 106 | 105 |
| 107 // This function generates a full invalidation, which means invalidating both | 106 // This function generates a full invalidation, which means invalidating both |
| 108 // |oldVisualRect| and |newVisualRect|. This is the default choice when | 107 // |oldVisualRect| and |newVisualRect|. This is the default choice when |
| 109 // generating an invalidation, as it is always correct, albeit it may force | 108 // generating an invalidation, as it is always correct, albeit it may force |
| 110 // some extra painting. | 109 // some extra painting. |
| 111 void FullyInvalidatePaint(PaintInvalidationReason, | 110 void FullyInvalidatePaint(PaintInvalidationReason, |
| 112 const LayoutRect& old_visual_rect, | 111 const LayoutRect& old_visual_rect, |
| 113 const LayoutRect& new_visual_rect); | 112 const LayoutRect& new_visual_rect); |
| 114 | 113 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 131 public: | 130 public: |
| 132 DisablePaintInvalidationStateAsserts(); | 131 DisablePaintInvalidationStateAsserts(); |
| 133 | 132 |
| 134 private: | 133 private: |
| 135 AutoReset<bool> disabler_; | 134 AutoReset<bool> disabler_; |
| 136 }; | 135 }; |
| 137 | 136 |
| 138 } // namespace blink | 137 } // namespace blink |
| 139 | 138 |
| 140 #endif | 139 #endif |
| OLD | NEW |