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. 4 5 #ifndef CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_IMPL_H_ 6 #define CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_IMPL_H_ 7 8 #include <map> 9 #include <utility> 10 #include <vector> 11 12 #include "base/time/time.h" 13 #include "cc/debug/micro_benchmark_impl.h" 14 15 namespace cc { 16 17 class LayerTreeHostImpl; 18 class PictureLayerImpl; 19 class LayerImpl; 20 class RasterizeAndRecordBenchmarkImpl : public MicroBenchmarkImpl { 21 public: 22 explicit RasterizeAndRecordBenchmarkImpl( 23 scoped_refptr<base::MessageLoopProxy> origin_loop, 24 base::Value* value, 25 const MicroBenchmarkImpl::DoneCallback& callback); 26 virtual ~RasterizeAndRecordBenchmarkImpl(); 27 28 // Implements MicroBenchmark interface. 29 virtual void DidCompleteCommit(LayerTreeHostImpl* host) OVERRIDE; 30 virtual void RunOnLayer(PictureLayerImpl* layer) OVERRIDE; 31 32 private: 33 void Run(LayerImpl* layer); 34 35 struct RasterizeResults { 36 RasterizeResults(); 37 ~RasterizeResults(); 38 39 int pixels_rasterized; 40 base::TimeDelta total_best_time; 41 }; 42 43 RasterizeResults rasterize_results_; 44 int rasterize_repeat_count_; 45 }; 46 47 } // namespace cc 48 49 #endif // CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_IMPL_H_ 50