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

Side by Side Diff: cc/debug/rasterize_and_record_benchmark.h

Issue 2216203002: Refactor MutatorHostClient from LayerTreeHost to LayerTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on another LTH refactor CL. Created 4 years, 4 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/debug/micro_benchmark_controller.cc ('k') | cc/debug/rasterize_and_record_benchmark.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 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 #ifndef CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ 5 #ifndef CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_
6 #define CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ 6 #define CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
11 #include <utility> 11 #include <utility>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "cc/debug/micro_benchmark_controller.h" 17 #include "cc/debug/micro_benchmark_controller.h"
18 #include "cc/playback/recording_source.h" 18 #include "cc/playback/recording_source.h"
19 19
20 namespace base { 20 namespace base {
21 class DictionaryValue; 21 class DictionaryValue;
22 } 22 }
23 23
24 namespace cc { 24 namespace cc {
25 25
26 class LayerTreeHost; 26 class LayerTree;
27 class Layer; 27 class Layer;
28 28
29 class RasterizeAndRecordBenchmark : public MicroBenchmark { 29 class RasterizeAndRecordBenchmark : public MicroBenchmark {
30 public: 30 public:
31 explicit RasterizeAndRecordBenchmark( 31 explicit RasterizeAndRecordBenchmark(
32 std::unique_ptr<base::Value> value, 32 std::unique_ptr<base::Value> value,
33 const MicroBenchmark::DoneCallback& callback); 33 const MicroBenchmark::DoneCallback& callback);
34 ~RasterizeAndRecordBenchmark() override; 34 ~RasterizeAndRecordBenchmark() override;
35 35
36 // Implements MicroBenchmark interface. 36 // Implements MicroBenchmark interface.
37 void DidUpdateLayers(LayerTreeHost* host) override; 37 void DidUpdateLayers(LayerTree* layer_tree) override;
38 void RunOnLayer(PictureLayer* layer) override; 38 void RunOnLayer(PictureLayer* layer) override;
39 39
40 std::unique_ptr<MicroBenchmarkImpl> CreateBenchmarkImpl( 40 std::unique_ptr<MicroBenchmarkImpl> CreateBenchmarkImpl(
41 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner) override; 41 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner) override;
42 42
43 private: 43 private:
44 void RecordRasterResults(std::unique_ptr<base::Value> results); 44 void RecordRasterResults(std::unique_ptr<base::Value> results);
45 45
46 struct RecordResults { 46 struct RecordResults {
47 RecordResults(); 47 RecordResults();
48 ~RecordResults(); 48 ~RecordResults();
49 49
50 int pixels_recorded; 50 int pixels_recorded;
51 size_t bytes_used; 51 size_t bytes_used;
52 base::TimeDelta total_best_time[RecordingSource::RECORDING_MODE_COUNT]; 52 base::TimeDelta total_best_time[RecordingSource::RECORDING_MODE_COUNT];
53 }; 53 };
54 54
55 RecordResults record_results_; 55 RecordResults record_results_;
56 int record_repeat_count_; 56 int record_repeat_count_;
57 std::unique_ptr<base::Value> settings_; 57 std::unique_ptr<base::Value> settings_;
58 std::unique_ptr<base::DictionaryValue> results_; 58 std::unique_ptr<base::DictionaryValue> results_;
59 59
60 // The following is used in DCHECKs. 60 // The following is used in DCHECKs.
61 bool main_thread_benchmark_done_; 61 bool main_thread_benchmark_done_;
62 62
63 LayerTreeHost* host_; 63 LayerTree* layer_tree_;
64 64
65 base::WeakPtrFactory<RasterizeAndRecordBenchmark> weak_ptr_factory_; 65 base::WeakPtrFactory<RasterizeAndRecordBenchmark> weak_ptr_factory_;
66 }; 66 };
67 67
68 } // namespace cc 68 } // namespace cc
69 69
70 #endif // CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ 70 #endif // CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_
OLDNEW
« no previous file with comments | « cc/debug/micro_benchmark_controller.cc ('k') | cc/debug/rasterize_and_record_benchmark.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698