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 // This file looks like a unit test, but it contains benchmarks and test | 5 // This file looks like a unit test, but it contains benchmarks and test |
6 // utilities intended for manual evaluation of the scalers in | 6 // utilities intended for manual evaluation of the scalers in |
7 // gl_helper*. These tests produce output in the form of files and printouts, | 7 // gl_helper*. These tests produce output in the form of files and printouts, |
8 // but cannot really "fail". There is no point in making these tests part | 8 // but cannot really "fail". There is no point in making these tests part |
9 // of any test automation run. | 9 // of any test automation run. |
10 | 10 |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 dst_size.width(), | 285 dst_size.width(), |
286 dst_size.height()); | 286 dst_size.height()); |
287 output_pixels.allocPixels(); | 287 output_pixels.allocPixels(); |
288 SkAutoLockPixels lock(output_pixels); | 288 SkAutoLockPixels lock(output_pixels); |
289 | 289 |
290 helper_->ReadbackTextureSync( | 290 helper_->ReadbackTextureSync( |
291 dst_texture, | 291 dst_texture, |
292 gfx::Rect(0, 0, | 292 gfx::Rect(0, 0, |
293 dst_size.width(), | 293 dst_size.width(), |
294 dst_size.height()), | 294 dst_size.height()), |
295 static_cast<unsigned char *>(output_pixels.getPixels())); | 295 static_cast<unsigned char *>(output_pixels.getPixels()), |
| 296 SkBitmap::kARGB_8888_Config); |
296 context_->deleteTexture(dst_texture); | 297 context_->deleteTexture(dst_texture); |
297 std::string filename = base::StringPrintf("testoutput_%s_%d.ppm", | 298 std::string filename = base::StringPrintf("testoutput_%s_%d.ppm", |
298 kQualityNames[q], | 299 kQualityNames[q], |
299 percents[p]); | 300 percents[p]); |
300 VLOG(0) << "Writing " << filename; | 301 VLOG(0) << "Writing " << filename; |
301 SaveToFile(&output_pixels, base::FilePath::FromUTF8Unsafe(filename)); | 302 SaveToFile(&output_pixels, base::FilePath::FromUTF8Unsafe(filename)); |
302 } | 303 } |
303 } | 304 } |
304 context_->deleteTexture(src_texture); | 305 context_->deleteTexture(src_texture); |
305 context_->deleteFramebuffer(framebuffer); | 306 context_->deleteFramebuffer(framebuffer); |
306 } | 307 } |
307 | 308 |
308 } // namespace | 309 } // namespace |
309 | 310 |
310 // These tests needs to run against a proper GL environment, so we | 311 // These tests needs to run against a proper GL environment, so we |
311 // need to set it up before we can run the tests. | 312 // need to set it up before we can run the tests. |
312 int main(int argc, char** argv) { | 313 int main(int argc, char** argv) { |
313 CommandLine::Init(argc, argv); | 314 CommandLine::Init(argc, argv); |
314 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); | 315 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); |
315 #if defined(OS_MACOSX) | 316 #if defined(OS_MACOSX) |
316 base::mac::ScopedNSAutoreleasePool pool; | 317 base::mac::ScopedNSAutoreleasePool pool; |
317 #endif | 318 #endif |
318 #if defined(TOOLKIT_GTK) | 319 #if defined(TOOLKIT_GTK) |
319 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); | 320 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); |
320 #endif | 321 #endif |
321 gfx::GLSurface::InitializeOneOff(); | 322 gfx::GLSurface::InitializeOneOff(); |
322 | 323 |
323 return content::UnitTestTestSuite(suite).Run(); | 324 return content::UnitTestTestSuite(suite).Run(); |
324 } | 325 } |
OLD | NEW |