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

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

Issue 698053002: Choose Largest DrawQuad Type No Longer Depended on Compiler Flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no const needed Created 6 years, 1 month 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/quads/largest_draw_quad.cc ('k') | cc/quads/list_container_unittest.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 SharedQuadState; 13 class SharedQuadState;
14 class DrawQuad; 14 class DrawQuad;
15 15
16 // This class is a container type that handles allocating contiguous memory for 16 // This class is a container type that handles allocating contiguous memory for
17 // new elements and traversing through elements with either iterator or reverse 17 // 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 18 // 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 19 // 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 20 // 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 21 // SharedQuadState or DrawQuad. Since the size of each DrawQuad varies, to hold
22 // DrawQuads, the allocations size of each element in this class is 22 // DrawQuads, the allocations size of each element in this class is
23 // kLargestDrawQuad while BaseElementType is DrawQuad. 23 // LargestDrawQuadSize while BaseElementType is DrawQuad.
24 template <class BaseElementType> 24 template <class BaseElementType>
25 class CC_EXPORT ListContainer { 25 class CC_EXPORT ListContainer {
26 public: 26 public:
27 // BaseElementType is the type of raw pointers this class hands out; however, 27 // BaseElementType is the type of raw pointers this class hands out; however,
28 // its derived classes might require different memory sizes. 28 // its derived classes might require different memory sizes.
29 // max_size_for_derived_class the largest memory size required for all the 29 // max_size_for_derived_class the largest memory size required for all the
30 // derived classes to use for allocation. 30 // derived classes to use for allocation.
31 explicit ListContainer(size_t max_size_for_derived_class); 31 explicit ListContainer(size_t max_size_for_derived_class);
32 // This constructor omits input variable for max_size_for_derived_class. This 32 // This constructor omits input variable for max_size_for_derived_class. This
33 // is used when there is no derived classes from BaseElementType we need to 33 // is used when there is no derived classes from BaseElementType we need to
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 DISALLOW_COPY_AND_ASSIGN(ListContainer); 225 DISALLOW_COPY_AND_ASSIGN(ListContainer);
226 }; 226 };
227 227
228 #if !defined(COMPILER_MSVC) 228 #if !defined(COMPILER_MSVC)
229 extern template class ListContainer<SharedQuadState>; 229 extern template class ListContainer<SharedQuadState>;
230 extern template class ListContainer<DrawQuad>; 230 extern template class ListContainer<DrawQuad>;
231 #endif 231 #endif
232 } // namespace cc 232 } // namespace cc
233 233
234 #endif // CC_QUADS_LIST_CONTAINER_H_ 234 #endif // CC_QUADS_LIST_CONTAINER_H_
OLDNEW
« no previous file with comments | « cc/quads/largest_draw_quad.cc ('k') | cc/quads/list_container_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698