Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 base::Bind(&RasterizeAndRecordBenchmark::RecordRasterResults, | 107 base::Bind(&RasterizeAndRecordBenchmark::RecordRasterResults, |
| 108 weak_ptr_factory_.GetWeakPtr()))); | 108 weak_ptr_factory_.GetWeakPtr()))); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void RasterizeAndRecordBenchmark::RunOnLayer(PictureLayer* layer) { | 111 void RasterizeAndRecordBenchmark::RunOnLayer(PictureLayer* layer) { |
| 112 DCHECK(host_); | 112 DCHECK(host_); |
| 113 | 113 |
| 114 if (!layer->DrawsContent()) | 114 if (!layer->DrawsContent()) |
| 115 return; | 115 return; |
| 116 | 116 |
| 117 gfx::Rect visible_layer_rect = layer->visible_layer_rect_for_testing(); | |
| 118 if (visible_layer_rect.IsEmpty()) | |
| 119 return; | |
|
ajuma
2016/04/04 20:47:17
This seems like the most realistic thing to do (si
jaydasika
2016/04/04 21:29:16
Done.
| |
| 120 | |
| 121 ContentLayerClient* painter = layer->client(); | 117 ContentLayerClient* painter = layer->client(); |
| 122 | 118 |
| 123 for (int mode_index = 0; mode_index < RecordingSource::RECORDING_MODE_COUNT; | 119 for (int mode_index = 0; mode_index < RecordingSource::RECORDING_MODE_COUNT; |
| 124 mode_index++) { | 120 mode_index++) { |
| 125 ContentLayerClient::PaintingControlSetting painting_control = | 121 ContentLayerClient::PaintingControlSetting painting_control = |
| 126 ContentLayerClient::PAINTING_BEHAVIOR_NORMAL_FOR_TEST; | 122 ContentLayerClient::PAINTING_BEHAVIOR_NORMAL_FOR_TEST; |
| 127 switch (static_cast<RecordingSource::RecordingMode>(mode_index)) { | 123 switch (static_cast<RecordingSource::RecordingMode>(mode_index)) { |
| 128 case RecordingSource::RECORD_NORMALLY: | 124 case RecordingSource::RECORD_NORMALLY: |
| 129 // Already setup for normal recording. | 125 // Already setup for normal recording. |
| 130 break; | 126 break; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 } | 187 } |
| 192 } | 188 } |
| 193 | 189 |
| 194 RasterizeAndRecordBenchmark::RecordResults::RecordResults() | 190 RasterizeAndRecordBenchmark::RecordResults::RecordResults() |
| 195 : pixels_recorded(0), bytes_used(0) { | 191 : pixels_recorded(0), bytes_used(0) { |
| 196 } | 192 } |
| 197 | 193 |
| 198 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} | 194 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} |
| 199 | 195 |
| 200 } // namespace cc | 196 } // namespace cc |
| OLD | NEW |