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

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

Issue 2324723002: Speed up quad deserialization. (Closed)
Patch Set: comment added Created 4 years, 3 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/largest_draw_quad.cc ('k') | no next file » | 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 18 matching lines...) Expand all
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() 38 QuadList::QuadList()
39 : ListContainer<DrawQuad>(LargestDrawQuadSize(), 39 : ListContainer<DrawQuad>(LargestDrawQuadSubclassSize(),
40 kDefaultNumSharedQuadStatesToReserve) {} 40 kDefaultNumSharedQuadStatesToReserve) {}
41 41
42 QuadList::QuadList(size_t default_size_to_reserve) 42 QuadList::QuadList(size_t default_size_to_reserve)
43 : ListContainer<DrawQuad>(LargestDrawQuadSize(), default_size_to_reserve) { 43 : ListContainer<DrawQuad>(LargestDrawQuadSubclassSize(),
44 } 44 default_size_to_reserve) {}
45 45
46 std::unique_ptr<RenderPass> RenderPass::Create() { 46 std::unique_ptr<RenderPass> RenderPass::Create() {
47 return base::WrapUnique(new RenderPass()); 47 return base::WrapUnique(new RenderPass());
48 } 48 }
49 49
50 std::unique_ptr<RenderPass> RenderPass::Create(size_t num_layers) { 50 std::unique_ptr<RenderPass> RenderPass::Create(size_t num_layers) {
51 return base::WrapUnique(new RenderPass(num_layers)); 51 return base::WrapUnique(new RenderPass(num_layers));
52 } 52 }
53 53
54 std::unique_ptr<RenderPass> RenderPass::Create( 54 std::unique_ptr<RenderPass> RenderPass::Create(
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 case DrawQuad::RENDER_PASS: 257 case DrawQuad::RENDER_PASS:
258 case DrawQuad::INVALID: 258 case DrawQuad::INVALID:
259 LOG(FATAL) << "Invalid DrawQuad material " << quad->material; 259 LOG(FATAL) << "Invalid DrawQuad material " << quad->material;
260 break; 260 break;
261 } 261 }
262 quad_list.back()->shared_quad_state = shared_quad_state; 262 quad_list.back()->shared_quad_state = shared_quad_state;
263 return quad_list.back(); 263 return quad_list.back();
264 } 264 }
265 265
266 } // namespace cc 266 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quads/largest_draw_quad.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698