OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/renderer/all_rendering_benchmarks.h" | 5 #include "content/renderer/all_rendering_benchmarks.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 WebRect tile = *it; | 166 WebRect tile = *it; |
167 scoped_ptr<WebCanvas> canvas( | 167 scoped_ptr<WebCanvas> canvas( |
168 skia::CreateBitmapCanvas(tile.width, tile.height, false)); | 168 skia::CreateBitmapCanvas(tile.width, tile.height, false)); |
169 TimeTicks before_time = TimeTicks::HighResNow(); | 169 TimeTicks before_time = TimeTicks::HighResNow(); |
170 canvas->translate(-tile.x, -tile.y); | 170 canvas->translate(-tile.x, -tile.y); |
171 picture_.draw(canvas.get()); | 171 picture_.draw(canvas.get()); |
172 paint_time_total_ += (TimeTicks::HighResNow() - before_time); | 172 paint_time_total_ += (TimeTicks::HighResNow() - before_time); |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
176 virtual double Run(WebViewBenchmarkSupport* support) { | 176 virtual double Run(WebViewBenchmarkSupport* support) OVERRIDE { |
177 paint_time_total_ = TimeDelta(); | 177 paint_time_total_ = TimeDelta(); |
178 support->paint(this, paint_mode_); | 178 support->paint(this, paint_mode_); |
179 return paint_time_total_.InMillisecondsF(); | 179 return paint_time_total_.InMillisecondsF(); |
180 } | 180 } |
181 | 181 |
182 private: | 182 private: |
183 virtual vector<WebRect> GetRepaintTiles(const WebSize& layer_size) const = 0; | 183 virtual vector<WebRect> GetRepaintTiles(const WebSize& layer_size) const = 0; |
184 | 184 |
185 TimeDelta paint_time_total_; | 185 TimeDelta paint_time_total_; |
186 SkPicture picture_; | 186 SkPicture picture_; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 WebViewBenchmarkSupport::PaintModeEverything, | 281 WebViewBenchmarkSupport::PaintModeEverything, |
282 64)); | 282 64)); |
283 benchmarks.push_back(new LayerWidthTiledReplayBenchmark( | 283 benchmarks.push_back(new LayerWidthTiledReplayBenchmark( |
284 "RepaintEverythingToLayerWidthx512BitmapMs", | 284 "RepaintEverythingToLayerWidthx512BitmapMs", |
285 WebViewBenchmarkSupport::PaintModeEverything, | 285 WebViewBenchmarkSupport::PaintModeEverything, |
286 512)); | 286 512)); |
287 return benchmarks.Pass(); | 287 return benchmarks.Pass(); |
288 } | 288 } |
289 | 289 |
290 } // namespace content | 290 } // namespace content |
OLD | NEW |