| 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 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class StyleDifference { | 13 class StyleDifference { |
| 14 STACK_ALLOCATED(); | 14 STACK_ALLOCATED(); |
| 15 public: | 15 public: |
| 16 enum PropertyDifference { | 16 enum PropertyDifference { |
| 17 TransformChanged = 1 << 0, | 17 TransformChanged = 1 << 0, |
| 18 OpacityChanged = 1 << 1, | 18 OpacityChanged = 1 << 1, |
| 19 ZIndexChanged = 1 << 2, | 19 ZIndexChanged = 1 << 2, |
| 20 FilterChanged = 1 << 3, | 20 FilterChanged = 1 << 3, |
| 21 BackdropFilterChanged = 1 << 4, | 21 BackdropFilterChanged = 1 << 4, |
| 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 LayoutAffectingPropertyChanged = 1 << 6, |
| 24 // If you add a value here, be sure to update the number of bits on m_pr
opertySpecificDifferences. | 25 // If you add a value here, be sure to update the number of bits on m_pr
opertySpecificDifferences. |
| 25 }; | 26 }; |
| 26 | 27 |
| 27 StyleDifference() | 28 StyleDifference() |
| 28 : m_paintInvalidationType(NoPaintInvalidation) | 29 : m_paintInvalidationType(NoPaintInvalidation) |
| 29 , m_layoutType(NoLayout) | 30 , m_layoutType(NoLayout) |
| 30 , m_recomputeOverflow(false) | 31 , m_recomputeOverflow(false) |
| 31 , m_propertySpecificDifferences(0) | 32 , m_propertySpecificDifferences(0) |
| 32 { } | 33 { } |
| 33 | 34 |
| (...skipping 47 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 layoutAffectingPropertyChanged() const { return m_propertySpecificDiffe
rences & LayoutAffectingPropertyChanged; } |
| 93 void setLayoutAffectingPropertyChanged() { m_propertySpecificDifferences |=
LayoutAffectingPropertyChanged; } |
| 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 : 7; |
| 107 }; | 111 }; |
| 108 | 112 |
| 109 } // namespace blink | 113 } // namespace blink |
| 110 | 114 |
| 111 #endif // StyleDifference_h | 115 #endif // StyleDifference_h |
| OLD | NEW |