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

Side by Side Diff: cc/ipc/cc_serialization_perftest.cc

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: nit Created 4 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/ipc/cc_param_traits_unittest.cc ('k') | cc/ipc/compositor_frame_struct_traits.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <utility> 5 #include <utility>
6 6
7 #include "base/test/launcher/unit_test_launcher.h" 7 #include "base/test/launcher/unit_test_launcher.h"
8 #include "base/test/test_suite.h" 8 #include "base/test/test_suite.h"
9 #include "cc/ipc/cc_param_traits.h" 9 #include "cc/ipc/cc_param_traits.h"
10 #include "cc/ipc/compositor_frame.mojom.h" 10 #include "cc/ipc/compositor_frame.mojom.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 true); 191 true);
192 perf_test::PrintResult("StructTraits serialization: num runs in 2 seconds", 192 perf_test::PrintResult("StructTraits serialization: num runs in 2 seconds",
193 "", test_name, count, "", true); 193 "", test_name, count, "", true);
194 } 194 }
195 195
196 static void RunCompositorFrameTest(const std::string& test_name, 196 static void RunCompositorFrameTest(const std::string& test_name,
197 uint32_t num_quads, 197 uint32_t num_quads,
198 uint32_t num_passes, 198 uint32_t num_passes,
199 UseSingleSharedQuadState single_sqs) { 199 UseSingleSharedQuadState single_sqs) {
200 CompositorFrame frame; 200 CompositorFrame frame;
201 frame.delegated_frame_data.reset(new DelegatedFrameData);
202 201
203 for (uint32_t i = 0; i < num_passes; ++i) { 202 for (uint32_t i = 0; i < num_passes; ++i) {
204 std::unique_ptr<RenderPass> render_pass = RenderPass::Create(); 203 std::unique_ptr<RenderPass> render_pass = RenderPass::Create();
205 render_pass->SetNew(RenderPassId(1, 1), gfx::Rect(), gfx::Rect(), 204 render_pass->SetNew(RenderPassId(1, 1), gfx::Rect(), gfx::Rect(),
206 gfx::Transform()); 205 gfx::Transform());
207 for (uint32_t j = 0; j < num_quads; ++j) { 206 for (uint32_t j = 0; j < num_quads; ++j) {
208 if (j == 0 || single_sqs == UseSingleSharedQuadState::NO) 207 if (j == 0 || single_sqs == UseSingleSharedQuadState::NO)
209 render_pass->CreateAndAppendSharedQuadState(); 208 render_pass->CreateAndAppendSharedQuadState();
210 const gfx::Rect bounds(100, 100, 100, 100); 209 const gfx::Rect bounds(100, 100, 100, 100);
211 const bool kForceAntiAliasingOff = true; 210 const bool kForceAntiAliasingOff = true;
212 SolidColorDrawQuad* quad = 211 SolidColorDrawQuad* quad =
213 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); 212 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
214 quad->SetNew(render_pass->shared_quad_state_list.back(), bounds, bounds, 213 quad->SetNew(render_pass->shared_quad_state_list.back(), bounds, bounds,
215 SK_ColorRED, kForceAntiAliasingOff); 214 SK_ColorRED, kForceAntiAliasingOff);
216 } 215 }
217 frame.delegated_frame_data->render_pass_list.push_back( 216 frame.render_pass_list.push_back(std::move(render_pass));
218 std::move(render_pass));
219 } 217 }
220 RunTest(test_name, std::move(frame)); 218 RunTest(test_name, std::move(frame));
221 } 219 }
222 220
223 static void RunTest(const std::string& test_name, CompositorFrame frame) { 221 static void RunTest(const std::string& test_name, CompositorFrame frame) {
224 RunSerializationTestStructTraits(test_name, frame); 222 RunSerializationTestStructTraits(test_name, frame);
225 RunDeserializationTestStructTraits(test_name, frame); 223 RunDeserializationTestStructTraits(test_name, frame);
226 RunSerializationTestParamTraits(test_name, frame); 224 RunSerializationTestParamTraits(test_name, frame);
227 RunDeserializationTestParamTraits(test_name, frame); 225 RunDeserializationTestParamTraits(test_name, frame);
228 } 226 }
(...skipping 29 matching lines...) Expand all
258 UseSingleSharedQuadState::NO); 256 UseSingleSharedQuadState::NO);
259 } 257 }
260 258
261 TEST_F(CCSerializationPerfTest, DelegatedFrame_ManyRenderPasses_1000_100) { 259 TEST_F(CCSerializationPerfTest, DelegatedFrame_ManyRenderPasses_1000_100) {
262 RunCompositorFrameTest("DelegatedFrame_ManyRenderPasses_10000_100", 100, 1000, 260 RunCompositorFrameTest("DelegatedFrame_ManyRenderPasses_10000_100", 100, 1000,
263 UseSingleSharedQuadState::NO); 261 UseSingleSharedQuadState::NO);
264 } 262 }
265 263
266 } // namespace 264 } // namespace
267 } // namespace cc 265 } // namespace cc
OLDNEW
« no previous file with comments | « cc/ipc/cc_param_traits_unittest.cc ('k') | cc/ipc/compositor_frame_struct_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698