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

Side by Side Diff: cc/quads/list_container.h

Issue 1123983002: cc: Use a ListContainer for DisplayItemList to reduce allocations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: displaylistcontainer: fixdcheck Created 5 years, 7 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
« no previous file with comments | « cc/layers/picture_image_layer_unittest.cc ('k') | cc/quads/list_container.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CC_QUADS_LIST_CONTAINER_H_ 5 #ifndef CC_QUADS_LIST_CONTAINER_H_
6 #define CC_QUADS_LIST_CONTAINER_H_ 6 #define CC_QUADS_LIST_CONTAINER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "cc/base/cc_export.h" 10 #include "cc/base/cc_export.h"
11 11
12 namespace cc { 12 namespace cc {
13 class DisplayItem;
14 class DrawQuad;
13 class SharedQuadState; 15 class SharedQuadState;
14 class DrawQuad;
15 16
16 // This class is a container type that handles allocating contiguous memory for 17 // This class is a container type that handles allocating contiguous memory for
17 // new elements and traversing through elements with either iterator or reverse 18 // new elements and traversing through elements with either iterator or reverse
18 // iterator. Since this container hands out raw pointers of its elements, it is 19 // iterator. Since this container hands out raw pointers of its elements, it is
19 // very important that this container never reallocate its memory so those raw 20 // very important that this container never reallocate its memory so those raw
20 // pointer will continue to be valid. This class is used to contain 21 // pointer will continue to be valid. This class is used to contain
21 // SharedQuadState or DrawQuad. Since the size of each DrawQuad varies, to hold 22 // SharedQuadState or DrawQuad. Since the size of each DrawQuad varies, to hold
22 // DrawQuads, the allocations size of each element in this class is 23 // DrawQuads, the allocations size of each element in this class is
23 // LargestDrawQuadSize while BaseElementType is DrawQuad. 24 // LargestDrawQuadSize while BaseElementType is DrawQuad.
24 template <class BaseElementType> 25 template <class BaseElementType>
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 void* Allocate(size_t size_of_actual_element_in_bytes); 228 void* Allocate(size_t size_of_actual_element_in_bytes);
228 229
229 scoped_ptr<ListContainerCharAllocator> data_; 230 scoped_ptr<ListContainerCharAllocator> data_;
230 231
231 DISALLOW_COPY_AND_ASSIGN(ListContainer); 232 DISALLOW_COPY_AND_ASSIGN(ListContainer);
232 }; 233 };
233 234
234 #if !defined(COMPILER_MSVC) 235 #if !defined(COMPILER_MSVC)
235 extern template class ListContainer<SharedQuadState>; 236 extern template class ListContainer<SharedQuadState>;
236 extern template class ListContainer<DrawQuad>; 237 extern template class ListContainer<DrawQuad>;
238 extern template class ListContainer<DisplayItem>;
237 #endif 239 #endif
238 } // namespace cc 240 } // namespace cc
239 241
240 #endif // CC_QUADS_LIST_CONTAINER_H_ 242 #endif // CC_QUADS_LIST_CONTAINER_H_
OLDNEW
« no previous file with comments | « cc/layers/picture_image_layer_unittest.cc ('k') | cc/quads/list_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698