Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: Source/platform/graphics/paint/DisplayItem.h

Issue 1294233004: Subtree caching implementation in blink-core (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Ready for review Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698