| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 StyleDifference_h | 5 #ifndef StyleDifference_h |
| 6 #define StyleDifference_h | 6 #define StyleDifference_h |
| 7 | 7 |
| 8 #include "wtf/Allocator.h" | 8 #include "wtf/Allocator.h" |
| 9 #include "wtf/Assertions.h" | 9 #include "wtf/Assertions.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // The object needs to issue paint invalidations if it is affected by te
xt decorations or properties dependent on color (e.g., border or outline). | 22 // The object needs to issue paint invalidations if it is affected by te
xt decorations or properties dependent on color (e.g., border or outline). |
| 23 TextDecorationOrColorChanged = 1 << 5, | 23 TextDecorationOrColorChanged = 1 << 5, |
| 24 // If you add a value here, be sure to update the number of bits on m_pr
opertySpecificDifferences. | 24 // If you add a value here, be sure to update the number of bits on m_pr
opertySpecificDifferences. |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 StyleDifference() | 27 StyleDifference() |
| 28 : m_paintInvalidationType(NoPaintInvalidation) | 28 : m_paintInvalidationType(NoPaintInvalidation) |
| 29 , m_layoutType(NoLayout) | 29 , m_layoutType(NoLayout) |
| 30 , m_recomputeOverflow(false) | 30 , m_recomputeOverflow(false) |
| 31 , m_propertySpecificDifferences(0) | 31 , m_propertySpecificDifferences(0) |
| 32 , m_scrollAnchorDisablingPropertyChanged(false) |
| 32 { } | 33 { } |
| 33 | 34 |
| 34 bool hasDifference() const { return m_paintInvalidationType || m_layoutType
|| m_propertySpecificDifferences; } | 35 bool hasDifference() const { return m_paintInvalidationType || m_layoutType
|| m_propertySpecificDifferences; } |
| 35 | 36 |
| 36 bool hasAtMostPropertySpecificDifferences(unsigned propertyDifferences) cons
t | 37 bool hasAtMostPropertySpecificDifferences(unsigned propertyDifferences) cons
t |
| 37 { | 38 { |
| 38 return !m_paintInvalidationType && !m_layoutType && !(m_propertySpecific
Differences & ~propertyDifferences); | 39 return !m_paintInvalidationType && !m_layoutType && !(m_propertySpecific
Differences & ~propertyDifferences); |
| 39 } | 40 } |
| 40 | 41 |
| 41 bool needsPaintInvalidation() const { return m_paintInvalidationType != NoPa
intInvalidation; } | 42 bool needsPaintInvalidation() const { return m_paintInvalidationType != NoPa
intInvalidation; } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 82 |
| 82 bool filterChanged() const { return m_propertySpecificDifferences & FilterCh
anged; } | 83 bool filterChanged() const { return m_propertySpecificDifferences & FilterCh
anged; } |
| 83 void setFilterChanged() { m_propertySpecificDifferences |= FilterChanged; } | 84 void setFilterChanged() { m_propertySpecificDifferences |= FilterChanged; } |
| 84 | 85 |
| 85 bool backdropFilterChanged() const { return m_propertySpecificDifferences &
BackdropFilterChanged; } | 86 bool backdropFilterChanged() const { return m_propertySpecificDifferences &
BackdropFilterChanged; } |
| 86 void setBackdropFilterChanged() { m_propertySpecificDifferences |= BackdropF
ilterChanged; } | 87 void setBackdropFilterChanged() { m_propertySpecificDifferences |= BackdropF
ilterChanged; } |
| 87 | 88 |
| 88 bool textDecorationOrColorChanged() const { return m_propertySpecificDiffere
nces & TextDecorationOrColorChanged; } | 89 bool textDecorationOrColorChanged() const { return m_propertySpecificDiffere
nces & TextDecorationOrColorChanged; } |
| 89 void setTextDecorationOrColorChanged() { m_propertySpecificDifferences |= Te
xtDecorationOrColorChanged; } | 90 void setTextDecorationOrColorChanged() { m_propertySpecificDifferences |= Te
xtDecorationOrColorChanged; } |
| 90 | 91 |
| 92 bool scrollAnchorDisablingPropertyChanged() const { return m_scrollAnchorDis
ablingPropertyChanged; } |
| 93 void setScrollAnchorDisablingPropertyChanged() { m_scrollAnchorDisablingProp
ertyChanged = true; } |
| 94 |
| 91 private: | 95 private: |
| 92 enum PaintInvalidationType { | 96 enum PaintInvalidationType { |
| 93 NoPaintInvalidation = 0, | 97 NoPaintInvalidation = 0, |
| 94 PaintInvalidationObject, | 98 PaintInvalidationObject, |
| 95 PaintInvalidationSubtree | 99 PaintInvalidationSubtree |
| 96 }; | 100 }; |
| 97 unsigned m_paintInvalidationType : 2; | 101 unsigned m_paintInvalidationType : 2; |
| 98 | 102 |
| 99 enum LayoutType { | 103 enum LayoutType { |
| 100 NoLayout = 0, | 104 NoLayout = 0, |
| 101 PositionedMovement, | 105 PositionedMovement, |
| 102 FullLayout | 106 FullLayout |
| 103 }; | 107 }; |
| 104 unsigned m_layoutType : 2; | 108 unsigned m_layoutType : 2; |
| 105 unsigned m_recomputeOverflow : 1; | 109 unsigned m_recomputeOverflow : 1; |
| 106 unsigned m_propertySpecificDifferences : 6; | 110 unsigned m_propertySpecificDifferences : 6; |
| 111 unsigned m_scrollAnchorDisablingPropertyChanged : 1; |
| 107 }; | 112 }; |
| 108 | 113 |
| 109 } // namespace blink | 114 } // namespace blink |
| 110 | 115 |
| 111 #endif // StyleDifference_h | 116 #endif // StyleDifference_h |
| OLD | NEW |