| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This small program is used to measure the performance of the various | 5 // This small program is used to measure the performance of the various |
| 6 // resize algorithms offered by the ImageOperations::Resize function. | 6 // resize algorithms offered by the ImageOperations::Resize function. |
| 7 // It will generate an empty source bitmap, and rescale it to specified | 7 // It will generate an empty source bitmap, and rescale it to specified |
| 8 // dimensions. It will repeat this operation multiple time to get more accurate | 8 // dimensions. It will repeat this operation multiple time to get more accurate |
| 9 // average throughput. Because it uses elapsed time to do its math, it is only | 9 // average throughput. Because it uses elapsed time to do its math, it is only |
| 10 // accurate on an idle system (but that approach was deemed more accurate | 10 // accurate on an idle system (but that approach was deemed more accurate |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 bool Benchmark::ParseArgs(const CommandLine* command_line) { | 179 bool Benchmark::ParseArgs(const CommandLine* command_line) { |
| 180 const CommandLine::SwitchMap& switches = command_line->GetSwitches(); | 180 const CommandLine::SwitchMap& switches = command_line->GetSwitches(); |
| 181 bool fNeedHelp = false; | 181 bool fNeedHelp = false; |
| 182 | 182 |
| 183 for (CommandLine::SwitchMap::const_iterator iter = switches.begin(); | 183 for (CommandLine::SwitchMap::const_iterator iter = switches.begin(); |
| 184 iter != switches.end(); | 184 iter != switches.end(); |
| 185 ++iter) { | 185 ++iter) { |
| 186 const std::string& s = iter->first; | 186 const std::string& s = iter->first; |
| 187 std::string value; | 187 std::string value; |
| 188 #if defined(OS_WIN) | 188 #if defined(OS_WIN) |
| 189 value = WideToUTF8(iter->second); | 189 value = base::WideToUTF8(iter->second); |
| 190 #else | 190 #else |
| 191 value = iter->second; | 191 value = iter->second; |
| 192 #endif | 192 #endif |
| 193 if (s == "source") { | 193 if (s == "source") { |
| 194 source_.FromString(value); | 194 source_.FromString(value); |
| 195 } else if (s == "destination") { | 195 } else if (s == "destination") { |
| 196 dest_.FromString(value); | 196 dest_.FromString(value); |
| 197 } else if (s == "iterations") { | 197 } else if (s == "iterations") { |
| 198 if (base::StringToInt(value, &num_iterations_) == false) { | 198 if (base::StringToInt(value, &num_iterations_) == false) { |
| 199 fNeedHelp = true; | 199 fNeedHelp = true; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 return 1; | 284 return 1; |
| 285 } | 285 } |
| 286 | 286 |
| 287 if (!bench.Run()) { | 287 if (!bench.Run()) { |
| 288 printf("Failed to run benchmark\n"); | 288 printf("Failed to run benchmark\n"); |
| 289 return 1; | 289 return 1; |
| 290 } | 290 } |
| 291 | 291 |
| 292 return 0; | 292 return 0; |
| 293 } | 293 } |
| OLD | NEW |