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

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

Issue 2029813002: cc::SharedQuadState: drop CopyFrom and add copy constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use = default in cc 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/ipc/cc_param_traits_unittest.cc ('k') | cc/quads/draw_quad_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <vector> 5 #include <vector>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "cc/debug/lap_timer.h" 9 #include "cc/debug/lap_timer.h"
10 #include "cc/quads/draw_quad.h" 10 #include "cc/quads/draw_quad.h"
(...skipping 30 matching lines...) Expand all
41 DrawQuadPerfTest() 41 DrawQuadPerfTest()
42 : timer_(kWarmupRuns, 42 : timer_(kWarmupRuns,
43 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), 43 base::TimeDelta::FromMilliseconds(kTimeLimitMillis),
44 kTimeCheckInterval) {} 44 kTimeCheckInterval) {}
45 45
46 void CreateRenderPass() { 46 void CreateRenderPass() {
47 render_pass_ = RenderPass::Create(); 47 render_pass_ = RenderPass::Create();
48 SharedQuadState* new_shared_state( 48 SharedQuadState* new_shared_state(
49 CreateSharedQuadState(render_pass_.get())); 49 CreateSharedQuadState(render_pass_.get()));
50 shared_state_ = render_pass_->CreateAndAppendSharedQuadState(); 50 shared_state_ = render_pass_->CreateAndAppendSharedQuadState();
51 shared_state_->CopyFrom(new_shared_state); 51 *shared_state_ = *new_shared_state;
52 } 52 }
53 53
54 void CleanUpRenderPass() { 54 void CleanUpRenderPass() {
55 render_pass_.reset(); 55 render_pass_.reset();
56 shared_state_ = nullptr; 56 shared_state_ = nullptr;
57 } 57 }
58 58
59 void GenerateTextureDrawQuads(int count, std::vector<DrawQuad*>* quads) { 59 void GenerateTextureDrawQuads(int count, std::vector<DrawQuad*>* quads) {
60 for (int i = 0; i < count; ++i) { 60 for (int i = 0; i < count; ++i) {
61 TextureDrawQuad* quad = 61 TextureDrawQuad* quad =
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 }; 104 };
105 105
106 TEST_F(DrawQuadPerfTest, IterateResources) { 106 TEST_F(DrawQuadPerfTest, IterateResources) {
107 RunIterateResourceTest("10_quads", 10); 107 RunIterateResourceTest("10_quads", 10);
108 RunIterateResourceTest("100_quads", 100); 108 RunIterateResourceTest("100_quads", 100);
109 RunIterateResourceTest("500_quads", 500); 109 RunIterateResourceTest("500_quads", 500);
110 } 110 }
111 111
112 } // namespace 112 } // namespace
113 } // namespace cc 113 } // namespace cc
OLDNEW
« no previous file with comments | « cc/ipc/cc_param_traits_unittest.cc ('k') | cc/quads/draw_quad_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698