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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 const int kDefaultRecordRepeatCount = 100; | 33 const int kDefaultRecordRepeatCount = 100; |
34 | 34 |
35 // Parameters for LapTimer. | 35 // Parameters for LapTimer. |
36 const int kTimeLimitMillis = 1; | 36 const int kTimeLimitMillis = 1; |
37 const int kWarmupRuns = 0; | 37 const int kWarmupRuns = 0; |
38 const int kTimeCheckInterval = 1; | 38 const int kTimeCheckInterval = 1; |
39 | 39 |
40 const char* kModeSuffixes[RecordingSource::RECORDING_MODE_COUNT] = { | 40 const char* kModeSuffixes[RecordingSource::RECORDING_MODE_COUNT] = { |
41 "", | 41 "", |
42 "_sk_null_canvas", | |
43 "_painting_disabled", | 42 "_painting_disabled", |
44 "_caching_disabled", | 43 "_caching_disabled", |
45 "_construction_disabled", | 44 "_construction_disabled", |
46 "_subsequence_caching_disabled"}; | 45 "_subsequence_caching_disabled"}; |
47 | 46 |
48 } // namespace | 47 } // namespace |
49 | 48 |
50 RasterizeAndRecordBenchmark::RasterizeAndRecordBenchmark( | 49 RasterizeAndRecordBenchmark::RasterizeAndRecordBenchmark( |
51 std::unique_ptr<base::Value> value, | 50 std::unique_ptr<base::Value> value, |
52 const MicroBenchmark::DoneCallback& callback) | 51 const MicroBenchmark::DoneCallback& callback) |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 ContentLayerClient* painter = layer->client(); | 118 ContentLayerClient* painter = layer->client(); |
120 | 119 |
121 for (int mode_index = 0; mode_index < RecordingSource::RECORDING_MODE_COUNT; | 120 for (int mode_index = 0; mode_index < RecordingSource::RECORDING_MODE_COUNT; |
122 mode_index++) { | 121 mode_index++) { |
123 ContentLayerClient::PaintingControlSetting painting_control = | 122 ContentLayerClient::PaintingControlSetting painting_control = |
124 ContentLayerClient::PAINTING_BEHAVIOR_NORMAL_FOR_TEST; | 123 ContentLayerClient::PAINTING_BEHAVIOR_NORMAL_FOR_TEST; |
125 switch (static_cast<RecordingSource::RecordingMode>(mode_index)) { | 124 switch (static_cast<RecordingSource::RecordingMode>(mode_index)) { |
126 case RecordingSource::RECORD_NORMALLY: | 125 case RecordingSource::RECORD_NORMALLY: |
127 // Already setup for normal recording. | 126 // Already setup for normal recording. |
128 break; | 127 break; |
129 case RecordingSource::RECORD_WITH_SK_NULL_CANVAS: | |
130 // Not supported for Display List recording. | |
131 continue; | |
132 case RecordingSource::RECORD_WITH_PAINTING_DISABLED: | 128 case RecordingSource::RECORD_WITH_PAINTING_DISABLED: |
133 painting_control = ContentLayerClient::DISPLAY_LIST_PAINTING_DISABLED; | 129 painting_control = ContentLayerClient::DISPLAY_LIST_PAINTING_DISABLED; |
134 break; | 130 break; |
135 case RecordingSource::RECORD_WITH_CACHING_DISABLED: | 131 case RecordingSource::RECORD_WITH_CACHING_DISABLED: |
136 painting_control = ContentLayerClient::DISPLAY_LIST_CACHING_DISABLED; | 132 painting_control = ContentLayerClient::DISPLAY_LIST_CACHING_DISABLED; |
137 break; | 133 break; |
138 case RecordingSource::RECORD_WITH_CONSTRUCTION_DISABLED: | 134 case RecordingSource::RECORD_WITH_CONSTRUCTION_DISABLED: |
139 painting_control = | 135 painting_control = |
140 ContentLayerClient::DISPLAY_LIST_CONSTRUCTION_DISABLED; | 136 ContentLayerClient::DISPLAY_LIST_CONSTRUCTION_DISABLED; |
141 break; | 137 break; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 185 } |
190 } | 186 } |
191 | 187 |
192 RasterizeAndRecordBenchmark::RecordResults::RecordResults() | 188 RasterizeAndRecordBenchmark::RecordResults::RecordResults() |
193 : pixels_recorded(0), bytes_used(0) { | 189 : pixels_recorded(0), bytes_used(0) { |
194 } | 190 } |
195 | 191 |
196 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} | 192 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} |
197 | 193 |
198 } // namespace cc | 194 } // namespace cc |
OLD | NEW |