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_
12 #include "base/time/time.h"
13 #include "cc/debug/micro_benchmark_impl.h"
14 #include "cc/resources/task_graph_runner.h"
18 class LayerTreeHostImpl
;
19 class PictureLayerImpl
;
21 class RasterizeAndRecordBenchmarkImpl
: public MicroBenchmarkImpl
{
23 explicit RasterizeAndRecordBenchmarkImpl(
24 scoped_refptr
<base::MessageLoopProxy
> origin_loop
,
26 const MicroBenchmarkImpl::DoneCallback
& callback
);
27 virtual ~RasterizeAndRecordBenchmarkImpl();
29 // Implements MicroBenchmark interface.
30 virtual void DidCompleteCommit(LayerTreeHostImpl
* host
) OVERRIDE
;
31 virtual void RunOnLayer(PictureLayerImpl
* layer
) OVERRIDE
;
34 void Run(LayerImpl
* layer
);
36 struct RasterizeResults
{
40 int pixels_rasterized
;
41 int pixels_rasterized_with_non_solid_color
;
42 int pixels_rasterized_as_opaque
;
43 base::TimeDelta total_best_time
;
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_
;
52 NamespaceToken task_namespace_
;
57 #endif // CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_IMPL_H_