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_PICTURE_RECORD_BENCHMARK_H_
6 #define CC_DEBUG_PICTURE_RECORD_BENCHMARK_H_
12 #include "base/time/time.h"
13 #include "cc/debug/micro_benchmark_controller.h"
19 class CC_EXPORT PictureRecordBenchmark
: public MicroBenchmark
{
21 explicit PictureRecordBenchmark(scoped_ptr
<base::Value
> value
,
22 const MicroBenchmark::DoneCallback
& callback
);
23 virtual ~PictureRecordBenchmark();
25 // Implements MicroBenchmark interface.
26 virtual void DidUpdateLayers(LayerTreeHost
* host
) OVERRIDE
;
27 virtual void RunOnLayer(PictureLayer
* layer
) OVERRIDE
;
30 void Run(Layer
* layer
);
32 typedef std::pair
<base::TimeDelta
, unsigned> TotalTime
;
33 std::map
<std::pair
<int, int>, TotalTime
> times_
;
34 std::vector
<std::pair
<int, int> > dimensions_
;
39 #endif // CC_DEBUG_PICTURE_RECORD_BENCHMARK_H_