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