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

Side by Side Diff: cc/quads/render_pass.cc

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/list_container_unittest.cc ('k') | content/common/cc_messages.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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 #include "cc/quads/render_pass.h" 5 #include "cc/quads/render_pass.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event_argument.h" 9 #include "base/debug/trace_event_argument.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 16 matching lines...) Expand all
27 #include "cc/quads/yuv_video_draw_quad.h" 27 #include "cc/quads/yuv_video_draw_quad.h"
28 28
29 namespace { 29 namespace {
30 const size_t kDefaultNumSharedQuadStatesToReserve = 32; 30 const size_t kDefaultNumSharedQuadStatesToReserve = 32;
31 const size_t kDefaultNumQuadsToReserve = 128; 31 const size_t kDefaultNumQuadsToReserve = 128;
32 } 32 }
33 33
34 namespace cc { 34 namespace cc {
35 35
36 QuadList::QuadList(size_t default_size_to_reserve) 36 QuadList::QuadList(size_t default_size_to_reserve)
37 : ListContainer<DrawQuad>(sizeof(kLargestDrawQuad), 37 : ListContainer<DrawQuad>(LargestDrawQuadSize(), default_size_to_reserve) {
38 default_size_to_reserve) {
39 } 38 }
40 39
41 scoped_ptr<RenderPass> RenderPass::Create() { 40 scoped_ptr<RenderPass> RenderPass::Create() {
42 return make_scoped_ptr(new RenderPass()); 41 return make_scoped_ptr(new RenderPass());
43 } 42 }
44 43
45 scoped_ptr<RenderPass> RenderPass::Create(size_t num_layers) { 44 scoped_ptr<RenderPass> RenderPass::Create(size_t num_layers) {
46 return make_scoped_ptr(new RenderPass(num_layers)); 45 return make_scoped_ptr(new RenderPass(num_layers));
47 } 46 }
48 47
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 case DrawQuad::RENDER_PASS: 268 case DrawQuad::RENDER_PASS:
270 case DrawQuad::INVALID: 269 case DrawQuad::INVALID:
271 LOG(FATAL) << "Invalid DrawQuad material " << quad->material; 270 LOG(FATAL) << "Invalid DrawQuad material " << quad->material;
272 break; 271 break;
273 } 272 }
274 quad_list.back()->shared_quad_state = shared_quad_state; 273 quad_list.back()->shared_quad_state = shared_quad_state;
275 return quad_list.back(); 274 return quad_list.back();
276 } 275 }
277 276
278 } // namespace cc 277 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quads/list_container_unittest.cc ('k') | content/common/cc_messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698