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 DisplayItem_h | 5 #ifndef DisplayItem_h |
6 #define DisplayItem_h | 6 #define DisplayItem_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 #include "platform/graphics/ContiguousContainer.h" | 9 #include "platform/graphics/ContiguousContainer.h" |
10 #include "platform/graphics/paint/DisplayItemClient.h" | 10 #include "platform/graphics/paint/DisplayItemClient.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 214 |
215 // Ids are for matching new DisplayItems with existing DisplayItems. | 215 // Ids are for matching new DisplayItems with existing DisplayItems. |
216 struct Id { | 216 struct Id { |
217 Id(const DisplayItemClient client, const Type type, const unsigned scope
) | 217 Id(const DisplayItemClient client, const Type type, const unsigned scope
) |
218 : client(client) | 218 : client(client) |
219 , type(type) | 219 , type(type) |
220 , scope(scope) { } | 220 , scope(scope) { } |
221 | 221 |
222 bool matches(const DisplayItem& item) const | 222 bool matches(const DisplayItem& item) const |
223 { | 223 { |
224 // We should always convert to non-cached types before matching. | |
225 ASSERT(!isCachedType(item.m_type)); | |
226 ASSERT(!isCachedType(type)); | |
227 return client == item.m_client | 224 return client == item.m_client |
228 && type == item.m_type | 225 && type == item.m_type |
229 && scope == item.m_scope; | 226 && scope == item.m_scope; |
230 } | 227 } |
231 | 228 |
232 const DisplayItemClient client; | 229 const DisplayItemClient client; |
233 const Type type; | 230 const Type type; |
234 const unsigned scope; | 231 const unsigned scope; |
235 }; | 232 }; |
236 | 233 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; | 396 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; |
400 #endif | 397 #endif |
401 | 398 |
402 private: | 399 private: |
403 bool isEnd() const final { return true; } | 400 bool isEnd() const final { return true; } |
404 }; | 401 }; |
405 | 402 |
406 } // namespace blink | 403 } // namespace blink |
407 | 404 |
408 #endif // DisplayItem_h | 405 #endif // DisplayItem_h |
OLD | NEW |