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

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

Issue 2064833002: Implement DrawQuad StructTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix move constructor Created 4 years, 6 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/quads/render_pass.h ('k') | cc/quads/render_pass_draw_quad.h » ('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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 17 matching lines...) Expand all
28 #include "cc/quads/tile_draw_quad.h" 28 #include "cc/quads/tile_draw_quad.h"
29 #include "cc/quads/yuv_video_draw_quad.h" 29 #include "cc/quads/yuv_video_draw_quad.h"
30 30
31 namespace { 31 namespace {
32 const size_t kDefaultNumSharedQuadStatesToReserve = 32; 32 const size_t kDefaultNumSharedQuadStatesToReserve = 32;
33 const size_t kDefaultNumQuadsToReserve = 128; 33 const size_t kDefaultNumQuadsToReserve = 128;
34 } 34 }
35 35
36 namespace cc { 36 namespace cc {
37 37
38 QuadList::QuadList()
39 : ListContainer<DrawQuad>(LargestDrawQuadSize(),
40 kDefaultNumSharedQuadStatesToReserve) {}
41
38 QuadList::QuadList(size_t default_size_to_reserve) 42 QuadList::QuadList(size_t default_size_to_reserve)
39 : ListContainer<DrawQuad>(LargestDrawQuadSize(), default_size_to_reserve) { 43 : ListContainer<DrawQuad>(LargestDrawQuadSize(), default_size_to_reserve) {
40 } 44 }
41 45
42 std::unique_ptr<RenderPass> RenderPass::Create() { 46 std::unique_ptr<RenderPass> RenderPass::Create() {
43 return base::WrapUnique(new RenderPass()); 47 return base::WrapUnique(new RenderPass());
44 } 48 }
45 49
46 std::unique_ptr<RenderPass> RenderPass::Create(size_t num_layers) { 50 std::unique_ptr<RenderPass> RenderPass::Create(size_t num_layers) {
47 return base::WrapUnique(new RenderPass(num_layers)); 51 return base::WrapUnique(new RenderPass(num_layers));
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 case DrawQuad::RENDER_PASS: 258 case DrawQuad::RENDER_PASS:
255 case DrawQuad::INVALID: 259 case DrawQuad::INVALID:
256 LOG(FATAL) << "Invalid DrawQuad material " << quad->material; 260 LOG(FATAL) << "Invalid DrawQuad material " << quad->material;
257 break; 261 break;
258 } 262 }
259 quad_list.back()->shared_quad_state = shared_quad_state; 263 quad_list.back()->shared_quad_state = shared_quad_state;
260 return quad_list.back(); 264 return quad_list.back();
261 } 265 }
262 266
263 } // namespace cc 267 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quads/render_pass.h ('k') | cc/quads/render_pass_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698