OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 DisplayItemClient_h | 5 #ifndef DisplayItemClient_h |
6 #define DisplayItemClient_h | 6 #define DisplayItemClient_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 #include "platform/geometry/LayoutRect.h" | 9 #include "platform/geometry/LayoutRect.h" |
10 #include "platform/graphics/PaintInvalidationReason.h" | 10 #include "platform/graphics/PaintInvalidationReason.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // Called when the DisplayItemClient is sure that it can safely die before its | 38 // Called when the DisplayItemClient is sure that it can safely die before its |
39 // owners have chance to remove it from the aliveness control. | 39 // owners have chance to remove it from the aliveness control. |
40 void endShouldKeepAlive() const; | 40 void endShouldKeepAlive() const; |
41 | 41 |
42 // Clears all should-keep-alive DisplayItemClients of a PaintController. | 42 // Clears all should-keep-alive DisplayItemClients of a PaintController. |
43 // Called after PaintController commits new display items or the subsequence | 43 // Called after PaintController commits new display items or the subsequence |
44 // owner is invalidated. | 44 // owner is invalidated. |
45 static void endShouldKeepAliveAllClients(const void* owner); | 45 static void endShouldKeepAliveAllClients(const void* owner); |
46 static void endShouldKeepAliveAllClients(); | 46 static void endShouldKeepAliveAllClients(); |
47 #else | 47 #else |
| 48 DisplayItemClient() {} |
48 virtual ~DisplayItemClient() {} | 49 virtual ~DisplayItemClient() {} |
49 #endif | 50 #endif |
50 | 51 |
51 virtual String debugName() const = 0; | 52 virtual String debugName() const = 0; |
52 | 53 |
53 // The visual rect of this DisplayItemClient, in the object space of the | 54 // The visual rect of this DisplayItemClient, in the object space of the |
54 // object that owns the GraphicsLayer, i.e. offset by | 55 // object that owns the GraphicsLayer, i.e. offset by |
55 // offsetFromLayoutObjectWithSubpixelAccumulation(). | 56 // offsetFromLayoutObjectWithSubpixelAccumulation(). |
56 virtual LayoutRect visualRect() const = 0; | 57 virtual LayoutRect visualRect() const = 0; |
57 | 58 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 bool displayItemsAreCached(CacheGenerationOrInvalidationReason other) const { | 165 bool displayItemsAreCached(CacheGenerationOrInvalidationReason other) const { |
165 return m_cacheGenerationOrInvalidationReason.matches(other); | 166 return m_cacheGenerationOrInvalidationReason.matches(other); |
166 } | 167 } |
167 void setDisplayItemsCached( | 168 void setDisplayItemsCached( |
168 CacheGenerationOrInvalidationReason cacheGeneration) const { | 169 CacheGenerationOrInvalidationReason cacheGeneration) const { |
169 m_cacheGenerationOrInvalidationReason = cacheGeneration; | 170 m_cacheGenerationOrInvalidationReason = cacheGeneration; |
170 } | 171 } |
171 | 172 |
172 mutable CacheGenerationOrInvalidationReason | 173 mutable CacheGenerationOrInvalidationReason |
173 m_cacheGenerationOrInvalidationReason; | 174 m_cacheGenerationOrInvalidationReason; |
| 175 |
| 176 DISALLOW_COPY_AND_ASSIGN(DisplayItemClient); |
174 }; | 177 }; |
175 | 178 |
176 inline bool operator==(const DisplayItemClient& client1, | 179 inline bool operator==(const DisplayItemClient& client1, |
177 const DisplayItemClient& client2) { | 180 const DisplayItemClient& client2) { |
178 return &client1 == &client2; | 181 return &client1 == &client2; |
179 } | 182 } |
180 inline bool operator!=(const DisplayItemClient& client1, | 183 inline bool operator!=(const DisplayItemClient& client1, |
181 const DisplayItemClient& client2) { | 184 const DisplayItemClient& client2) { |
182 return &client1 != &client2; | 185 return &client1 != &client2; |
183 } | 186 } |
184 | 187 |
185 } // namespace blink | 188 } // namespace blink |
186 | 189 |
187 #endif // DisplayItemClient_h | 190 #endif // DisplayItemClient_h |
OLD | NEW |