OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 protected: | 79 protected: |
80 // When adding modes, make sure we don't overflow m_invalidationMask below. | 80 // When adding modes, make sure we don't overflow m_invalidationMask below. |
81 enum InvalidationMode { | 81 enum InvalidationMode { |
82 LayoutAndBoundariesInvalidation = 1 << 0, | 82 LayoutAndBoundariesInvalidation = 1 << 0, |
83 BoundariesInvalidation = 1 << 1, | 83 BoundariesInvalidation = 1 << 1, |
84 PaintInvalidation = 1 << 2, | 84 PaintInvalidation = 1 << 2, |
85 ParentOnlyInvalidation = 1 << 3 | 85 ParentOnlyInvalidation = 1 << 3 |
86 }; | 86 }; |
87 | 87 |
88 // Used from the invalidateClient/invalidateClients methods from classes, inhe
riting from us. | 88 // Used from the invalidateClient/invalidateClients methods from classes, |
| 89 // inheriting from us. |
89 void markAllClientsForInvalidation(InvalidationMode); | 90 void markAllClientsForInvalidation(InvalidationMode); |
90 void markAllResourceClientsForInvalidation(); | 91 void markAllResourceClientsForInvalidation(); |
91 void markClientForInvalidation(LayoutObject*, InvalidationMode); | 92 void markClientForInvalidation(LayoutObject*, InvalidationMode); |
92 | 93 |
93 void willBeDestroyed() override; | 94 void willBeDestroyed() override; |
94 | 95 |
95 bool m_isInLayout; | 96 bool m_isInLayout; |
96 | 97 |
97 private: | 98 private: |
98 friend class SVGResourcesCache; | 99 friend class SVGResourcesCache; |
99 void addClient(LayoutObject*); | 100 void addClient(LayoutObject*); |
100 void removeClient(LayoutObject*); | 101 void removeClient(LayoutObject*); |
101 void detachAllClients(); | 102 void detachAllClients(); |
102 | 103 |
103 void registerResource(); | 104 void registerResource(); |
104 | 105 |
105 AtomicString m_id; | 106 AtomicString m_id; |
106 // Track global (markAllClientsForInvalidation) invals to avoid redundant craw
ls. | 107 // Track global (markAllClientsForInvalidation) invals to avoid redundant |
| 108 // crawls. |
107 unsigned m_invalidationMask : 8; | 109 unsigned m_invalidationMask : 8; |
108 | 110 |
109 unsigned m_registered : 1; | 111 unsigned m_registered : 1; |
110 unsigned m_isInvalidating : 1; | 112 unsigned m_isInvalidating : 1; |
111 // 22 padding bits available | 113 // 22 padding bits available |
112 | 114 |
113 HashSet<LayoutObject*> m_clients; | 115 HashSet<LayoutObject*> m_clients; |
114 PersistentHeapHashSet<WeakMember<SVGResourceClient>> m_resourceClients; | 116 PersistentHeapHashSet<WeakMember<SVGResourceClient>> m_resourceClients; |
115 }; | 117 }; |
116 | 118 |
(...skipping 24 matching lines...) Expand all Loading... |
141 isSVGResourceContainer()); | 143 isSVGResourceContainer()); |
142 | 144 |
143 #define DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(thisType, typeName) \ | 145 #define DEFINE_LAYOUT_SVG_RESOURCE_TYPE_CASTS(thisType, typeName) \ |
144 DEFINE_TYPE_CASTS(thisType, LayoutSVGResourceContainer, resource, \ | 146 DEFINE_TYPE_CASTS(thisType, LayoutSVGResourceContainer, resource, \ |
145 resource->resourceType() == typeName, \ | 147 resource->resourceType() == typeName, \ |
146 resource.resourceType() == typeName) | 148 resource.resourceType() == typeName) |
147 | 149 |
148 } // namespace blink | 150 } // namespace blink |
149 | 151 |
150 #endif | 152 #endif |
OLD | NEW |