Add UMAs to measure Android tab state transition
[chromium-blink-merge.git] / cc / debug / rasterize_and_record_benchmark_impl.h
blob99b22f154e7eff36c6c5273e6ffd6b347f6c74fc
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
3 // found in the LICENSE file.
5 #ifndef CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_IMPL_H_
6 #define CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_IMPL_H_
8 #include <map>
9 #include <utility>
10 #include <vector>
12 #include "base/single_thread_task_runner.h"
13 #include "base/time/time.h"
14 #include "cc/debug/micro_benchmark_impl.h"
15 #include "cc/raster/task_graph_runner.h"
17 namespace cc {
19 class LayerTreeHostImpl;
20 class PictureLayerImpl;
21 class LayerImpl;
22 class RasterizeAndRecordBenchmarkImpl : public MicroBenchmarkImpl {
23 public:
24 explicit RasterizeAndRecordBenchmarkImpl(
25 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner,
26 base::Value* value,
27 const MicroBenchmarkImpl::DoneCallback& callback);
28 ~RasterizeAndRecordBenchmarkImpl() override;
30 // Implements MicroBenchmark interface.
31 void DidCompleteCommit(LayerTreeHostImpl* host) override;
32 void RunOnLayer(PictureLayerImpl* layer) override;
34 private:
35 struct RasterizeResults {
36 RasterizeResults();
37 ~RasterizeResults();
39 int pixels_rasterized;
40 int pixels_rasterized_with_non_solid_color;
41 int pixels_rasterized_as_opaque;
42 base::TimeDelta total_best_time;
43 size_t total_memory_usage;
44 int total_layers;
45 int total_picture_layers;
46 int total_picture_layers_with_no_content;
47 int total_picture_layers_off_screen;
50 RasterizeResults rasterize_results_;
51 int rasterize_repeat_count_;
54 } // namespace cc
56 #endif // CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_IMPL_H_