| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 "cc/debug/rasterize_and_record_benchmark.h" | 5 #include "cc/debug/rasterize_and_record_benchmark.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner) { | 102 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner) { |
| 103 return make_scoped_ptr(new RasterizeAndRecordBenchmarkImpl( | 103 return make_scoped_ptr(new RasterizeAndRecordBenchmarkImpl( |
| 104 origin_task_runner, settings_.get(), | 104 origin_task_runner, settings_.get(), |
| 105 base::Bind(&RasterizeAndRecordBenchmark::RecordRasterResults, | 105 base::Bind(&RasterizeAndRecordBenchmark::RecordRasterResults, |
| 106 weak_ptr_factory_.GetWeakPtr()))); | 106 weak_ptr_factory_.GetWeakPtr()))); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void RasterizeAndRecordBenchmark::RunOnLayer(PictureLayer* layer) { | 109 void RasterizeAndRecordBenchmark::RunOnLayer(PictureLayer* layer) { |
| 110 DCHECK(host_); | 110 DCHECK(host_); |
| 111 | 111 |
| 112 gfx::Rect visible_layer_rect = layer->visible_content_rect(); | 112 gfx::Rect visible_layer_rect = layer->visible_layer_rect(); |
| 113 if (visible_layer_rect.IsEmpty()) | 113 if (visible_layer_rect.IsEmpty()) |
| 114 return; | 114 return; |
| 115 | 115 |
| 116 if (host_->settings().use_display_lists) { | 116 if (host_->settings().use_display_lists) { |
| 117 RunOnDisplayListLayer(layer, visible_layer_rect); | 117 RunOnDisplayListLayer(layer, visible_layer_rect); |
| 118 } else { | 118 } else { |
| 119 RunOnPictureLayer(layer, visible_layer_rect); | 119 RunOnPictureLayer(layer, visible_layer_rect); |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 } | 245 } |
| 246 } | 246 } |
| 247 | 247 |
| 248 RasterizeAndRecordBenchmark::RecordResults::RecordResults() | 248 RasterizeAndRecordBenchmark::RecordResults::RecordResults() |
| 249 : pixels_recorded(0), bytes_used(0) { | 249 : pixels_recorded(0), bytes_used(0) { |
| 250 } | 250 } |
| 251 | 251 |
| 252 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} | 252 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} |
| 253 | 253 |
| 254 } // namespace cc | 254 } // namespace cc |
| OLD | NEW |