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/Assertions.h" | 8 #include "wtf/Assertions.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 class StyleDifference { | 12 class StyleDifference { |
13 public: | 13 public: |
14 enum PropertyDifference { | 14 enum PropertyDifference { |
15 TransformChanged = 1 << 0, | 15 TransformChanged = 1 << 0, |
16 OpacityChanged = 1 << 1, | 16 OpacityChanged = 1 << 1, |
17 ZIndexChanged = 1 << 2, | 17 ZIndexChanged = 1 << 2, |
18 FilterChanged = 1 << 3, | 18 FilterChanged = 1 << 3, |
| 19 BackdropFilterChanged = 1 << 4, |
19 // The object needs to issue paint invalidations if it contains text or
properties dependent on color (e.g., border or outline). | 20 // The object needs to issue paint invalidations if it contains text or
properties dependent on color (e.g., border or outline). |
20 TextOrColorChanged = 1 << 4, | 21 TextOrColorChanged = 1 << 5, |
| 22 // If you add a value here, be sure to update the number of bits on m_pr
opertySpecificDifferences. |
21 }; | 23 }; |
22 | 24 |
23 StyleDifference() | 25 StyleDifference() |
24 : m_paintInvalidationType(NoPaintInvalidation) | 26 : m_paintInvalidationType(NoPaintInvalidation) |
25 , m_layoutType(NoLayout) | 27 , m_layoutType(NoLayout) |
26 , m_propertySpecificDifferences(0) | 28 , m_propertySpecificDifferences(0) |
27 { } | 29 { } |
28 | 30 |
29 bool hasDifference() const { return m_paintInvalidationType || m_layoutType
|| m_propertySpecificDifferences; } | 31 bool hasDifference() const { return m_paintInvalidationType || m_layoutType
|| m_propertySpecificDifferences; } |
30 | 32 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 69 |
68 bool opacityChanged() const { return m_propertySpecificDifferences & Opacity
Changed; } | 70 bool opacityChanged() const { return m_propertySpecificDifferences & Opacity
Changed; } |
69 void setOpacityChanged() { m_propertySpecificDifferences |= OpacityChanged;
} | 71 void setOpacityChanged() { m_propertySpecificDifferences |= OpacityChanged;
} |
70 | 72 |
71 bool zIndexChanged() const { return m_propertySpecificDifferences & ZIndexCh
anged; } | 73 bool zIndexChanged() const { return m_propertySpecificDifferences & ZIndexCh
anged; } |
72 void setZIndexChanged() { m_propertySpecificDifferences |= ZIndexChanged; } | 74 void setZIndexChanged() { m_propertySpecificDifferences |= ZIndexChanged; } |
73 | 75 |
74 bool filterChanged() const { return m_propertySpecificDifferences & FilterCh
anged; } | 76 bool filterChanged() const { return m_propertySpecificDifferences & FilterCh
anged; } |
75 void setFilterChanged() { m_propertySpecificDifferences |= FilterChanged; } | 77 void setFilterChanged() { m_propertySpecificDifferences |= FilterChanged; } |
76 | 78 |
| 79 bool backdropFilterChanged() const { return m_propertySpecificDifferences &
BackdropFilterChanged; } |
| 80 void setBackdropFilterChanged() { m_propertySpecificDifferences |= BackdropF
ilterChanged; } |
| 81 |
77 bool textOrColorChanged() const { return m_propertySpecificDifferences & Tex
tOrColorChanged; } | 82 bool textOrColorChanged() const { return m_propertySpecificDifferences & Tex
tOrColorChanged; } |
78 void setTextOrColorChanged() { m_propertySpecificDifferences |= TextOrColorC
hanged; } | 83 void setTextOrColorChanged() { m_propertySpecificDifferences |= TextOrColorC
hanged; } |
79 | 84 |
80 private: | 85 private: |
81 enum PaintInvalidationType { | 86 enum PaintInvalidationType { |
82 NoPaintInvalidation = 0, | 87 NoPaintInvalidation = 0, |
83 PaintInvalidationObject, | 88 PaintInvalidationObject, |
84 PaintInvalidationLayer | 89 PaintInvalidationLayer |
85 }; | 90 }; |
86 unsigned m_paintInvalidationType : 2; | 91 unsigned m_paintInvalidationType : 2; |
87 | 92 |
88 enum LayoutType { | 93 enum LayoutType { |
89 NoLayout = 0, | 94 NoLayout = 0, |
90 PositionedMovement, | 95 PositionedMovement, |
91 FullLayout | 96 FullLayout |
92 }; | 97 }; |
93 unsigned m_layoutType : 2; | 98 unsigned m_layoutType : 2; |
94 | 99 |
95 unsigned m_propertySpecificDifferences : 5; | 100 unsigned m_propertySpecificDifferences : 6; |
96 }; | 101 }; |
97 | 102 |
98 } // namespace blink | 103 } // namespace blink |
99 | 104 |
100 #endif // StyleDifference_h | 105 #endif // StyleDifference_h |
OLD | NEW |