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

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

Issue 2503203002: Revert "Getting rid of DelegatedFrameData" (Closed)
Patch Set: 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);
201 202
202 for (uint32_t i = 0; i < num_passes; ++i) { 203 for (uint32_t i = 0; i < num_passes; ++i) {
203 std::unique_ptr<RenderPass> render_pass = RenderPass::Create(); 204 std::unique_ptr<RenderPass> render_pass = RenderPass::Create();
204 render_pass->SetNew(RenderPassId(1, 1), gfx::Rect(), gfx::Rect(), 205 render_pass->SetNew(RenderPassId(1, 1), gfx::Rect(), gfx::Rect(),
205 gfx::Transform()); 206 gfx::Transform());
206 for (uint32_t j = 0; j < num_quads; ++j) { 207 for (uint32_t j = 0; j < num_quads; ++j) {
207 if (j == 0 || single_sqs == UseSingleSharedQuadState::NO) 208 if (j == 0 || single_sqs == UseSingleSharedQuadState::NO)
208 render_pass->CreateAndAppendSharedQuadState(); 209 render_pass->CreateAndAppendSharedQuadState();
209 const gfx::Rect bounds(100, 100, 100, 100); 210 const gfx::Rect bounds(100, 100, 100, 100);
210 const bool kForceAntiAliasingOff = true; 211 const bool kForceAntiAliasingOff = true;
211 SolidColorDrawQuad* quad = 212 SolidColorDrawQuad* quad =
212 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); 213 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
213 quad->SetNew(render_pass->shared_quad_state_list.back(), bounds, bounds, 214 quad->SetNew(render_pass->shared_quad_state_list.back(), bounds, bounds,
214 SK_ColorRED, kForceAntiAliasingOff); 215 SK_ColorRED, kForceAntiAliasingOff);
215 } 216 }
216 frame.render_pass_list.push_back(std::move(render_pass)); 217 frame.delegated_frame_data->render_pass_list.push_back(
218 std::move(render_pass));
217 } 219 }
218 RunTest(test_name, std::move(frame)); 220 RunTest(test_name, std::move(frame));
219 } 221 }
220 222
221 static void RunTest(const std::string& test_name, CompositorFrame frame) { 223 static void RunTest(const std::string& test_name, CompositorFrame frame) {
222 RunSerializationTestStructTraits(test_name, frame); 224 RunSerializationTestStructTraits(test_name, frame);
223 RunDeserializationTestStructTraits(test_name, frame); 225 RunDeserializationTestStructTraits(test_name, frame);
224 RunSerializationTestParamTraits(test_name, frame); 226 RunSerializationTestParamTraits(test_name, frame);
225 RunDeserializationTestParamTraits(test_name, frame); 227 RunDeserializationTestParamTraits(test_name, frame);
226 } 228 }
(...skipping 29 matching lines...) Expand all
256 UseSingleSharedQuadState::NO); 258 UseSingleSharedQuadState::NO);
257 } 259 }
258 260
259 TEST_F(CCSerializationPerfTest, DelegatedFrame_ManyRenderPasses_1000_100) { 261 TEST_F(CCSerializationPerfTest, DelegatedFrame_ManyRenderPasses_1000_100) {
260 RunCompositorFrameTest("DelegatedFrame_ManyRenderPasses_10000_100", 100, 1000, 262 RunCompositorFrameTest("DelegatedFrame_ManyRenderPasses_10000_100", 100, 1000,
261 UseSingleSharedQuadState::NO); 263 UseSingleSharedQuadState::NO);
262 } 264 }
263 265
264 } // namespace 266 } // namespace
265 } // namespace cc 267 } // 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