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 // The object needs to issue paint invalidations if it contains text or
properties dependent on color (e.g., border or outline). | 19 // 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, | 20 TextOrColorChanged = 1 << 4, |
| 21 VisualOverflowChanged = 1 << 5 |
21 }; | 22 }; |
22 | 23 |
23 StyleDifference() | 24 StyleDifference() |
24 : m_paintInvalidationType(NoPaintInvalidation) | 25 : m_paintInvalidationType(NoPaintInvalidation) |
25 , m_layoutType(NoLayout) | 26 , m_layoutType(NoLayout) |
26 , m_propertySpecificDifferences(0) | 27 , m_propertySpecificDifferences(0) |
27 { } | 28 { } |
28 | 29 |
29 bool hasDifference() const { return m_paintInvalidationType || m_layoutType
|| m_propertySpecificDifferences; } | 30 bool hasDifference() const { return m_paintInvalidationType || m_layoutType
|| m_propertySpecificDifferences; } |
30 | 31 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 71 |
71 bool zIndexChanged() const { return m_propertySpecificDifferences & ZIndexCh
anged; } | 72 bool zIndexChanged() const { return m_propertySpecificDifferences & ZIndexCh
anged; } |
72 void setZIndexChanged() { m_propertySpecificDifferences |= ZIndexChanged; } | 73 void setZIndexChanged() { m_propertySpecificDifferences |= ZIndexChanged; } |
73 | 74 |
74 bool filterChanged() const { return m_propertySpecificDifferences & FilterCh
anged; } | 75 bool filterChanged() const { return m_propertySpecificDifferences & FilterCh
anged; } |
75 void setFilterChanged() { m_propertySpecificDifferences |= FilterChanged; } | 76 void setFilterChanged() { m_propertySpecificDifferences |= FilterChanged; } |
76 | 77 |
77 bool textOrColorChanged() const { return m_propertySpecificDifferences & Tex
tOrColorChanged; } | 78 bool textOrColorChanged() const { return m_propertySpecificDifferences & Tex
tOrColorChanged; } |
78 void setTextOrColorChanged() { m_propertySpecificDifferences |= TextOrColorC
hanged; } | 79 void setTextOrColorChanged() { m_propertySpecificDifferences |= TextOrColorC
hanged; } |
79 | 80 |
| 81 bool visualOverflowChanged() const { return m_propertySpecificDifferences &
VisualOverflowChanged; } |
| 82 void setVisualOverflowChanged() { m_propertySpecificDifferences |= VisualOve
rflowChanged; } |
80 private: | 83 private: |
81 enum PaintInvalidationType { | 84 enum PaintInvalidationType { |
82 NoPaintInvalidation = 0, | 85 NoPaintInvalidation = 0, |
83 PaintInvalidationObject, | 86 PaintInvalidationObject, |
84 PaintInvalidationLayer | 87 PaintInvalidationLayer |
85 }; | 88 }; |
86 unsigned m_paintInvalidationType : 2; | 89 unsigned m_paintInvalidationType : 2; |
87 | 90 |
88 enum LayoutType { | 91 enum LayoutType { |
89 NoLayout = 0, | 92 NoLayout = 0, |
90 PositionedMovement, | 93 PositionedMovement, |
91 FullLayout | 94 FullLayout |
92 }; | 95 }; |
93 unsigned m_layoutType : 2; | 96 unsigned m_layoutType : 2; |
94 | 97 |
95 unsigned m_propertySpecificDifferences : 5; | 98 unsigned m_propertySpecificDifferences : 6; |
96 }; | 99 }; |
97 | 100 |
98 } // namespace blink | 101 } // namespace blink |
99 | 102 |
100 #endif // StyleDifference_h | 103 #endif // StyleDifference_h |
OLD | NEW |