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

Side by Side Diff: cc/debug/micro_benchmark_controller.cc

Issue 66213007: cc: Add rasterize and record micro benchmark. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added weak ptrs Created 7 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 | Annotate | Revision Log
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 "cc/debug/micro_benchmark_controller.h" 5 #include "cc/debug/micro_benchmark_controller.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "cc/debug/picture_record_benchmark.h" 12 #include "cc/debug/picture_record_benchmark.h"
13 #include "cc/debug/rasterize_and_record_benchmark.h"
13 #include "cc/debug/unittest_only_benchmark.h" 14 #include "cc/debug/unittest_only_benchmark.h"
14 #include "cc/trees/layer_tree_host.h" 15 #include "cc/trees/layer_tree_host.h"
15 #include "cc/trees/layer_tree_host_impl.h" 16 #include "cc/trees/layer_tree_host_impl.h"
16 17
17 namespace cc { 18 namespace cc {
18 19
19 namespace { 20 namespace {
20 21
21 scoped_ptr<MicroBenchmark> CreateBenchmark( 22 scoped_ptr<MicroBenchmark> CreateBenchmark(
22 const std::string& name, 23 const std::string& name,
23 scoped_ptr<base::Value> value, 24 scoped_ptr<base::Value> value,
24 const MicroBenchmark::DoneCallback& callback) { 25 const MicroBenchmark::DoneCallback& callback) {
25 if (name == "picture_record_benchmark") { 26 if (name == "picture_record_benchmark") {
26 return scoped_ptr<MicroBenchmark>( 27 return scoped_ptr<MicroBenchmark>(
27 new PictureRecordBenchmark(value.Pass(), callback)); 28 new PictureRecordBenchmark(value.Pass(), callback));
29 } else if (name == "rasterize_and_record_benchmark") {
30 return scoped_ptr<MicroBenchmark>(
31 new RasterizeAndRecordBenchmark(value.Pass(), callback));
28 } else if (name == "unittest_only_benchmark") { 32 } else if (name == "unittest_only_benchmark") {
29 return scoped_ptr<MicroBenchmark>( 33 return scoped_ptr<MicroBenchmark>(
30 new UnittestOnlyBenchmark(value.Pass(), callback)); 34 new UnittestOnlyBenchmark(value.Pass(), callback));
31 } 35 }
32 return scoped_ptr<MicroBenchmark>(); 36 return scoped_ptr<MicroBenchmark>();
33 } 37 }
34 38
35 class IsDonePredicate { 39 class IsDonePredicate {
36 public: 40 public:
37 typedef const MicroBenchmark* argument_type; 41 typedef const MicroBenchmark* argument_type;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 CleanUpFinishedBenchmarks(); 97 CleanUpFinishedBenchmarks();
94 } 98 }
95 99
96 void MicroBenchmarkController::CleanUpFinishedBenchmarks() { 100 void MicroBenchmarkController::CleanUpFinishedBenchmarks() {
97 benchmarks_.erase( 101 benchmarks_.erase(
98 benchmarks_.partition(std::not1(IsDonePredicate())), 102 benchmarks_.partition(std::not1(IsDonePredicate())),
99 benchmarks_.end()); 103 benchmarks_.end());
100 } 104 }
101 105
102 } // namespace cc 106 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698