| 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); | |
| 297 context_->deleteTexture(dst_texture); | 296 context_->deleteTexture(dst_texture); |
| 298 std::string filename = base::StringPrintf("testoutput_%s_%d.ppm", | 297 std::string filename = base::StringPrintf("testoutput_%s_%d.ppm", |
| 299 kQualityNames[q], | 298 kQualityNames[q], |
| 300 percents[p]); | 299 percents[p]); |
| 301 VLOG(0) << "Writing " << filename; | 300 VLOG(0) << "Writing " << filename; |
| 302 SaveToFile(&output_pixels, base::FilePath::FromUTF8Unsafe(filename)); | 301 SaveToFile(&output_pixels, base::FilePath::FromUTF8Unsafe(filename)); |
| 303 } | 302 } |
| 304 } | 303 } |
| 305 context_->deleteTexture(src_texture); | 304 context_->deleteTexture(src_texture); |
| 306 context_->deleteFramebuffer(framebuffer); | 305 context_->deleteFramebuffer(framebuffer); |
| 307 } | 306 } |
| 308 | 307 |
| 309 } // namespace | 308 } // namespace |
| 310 | 309 |
| 311 // These tests needs to run against a proper GL environment, so we | 310 // These tests needs to run against a proper GL environment, so we |
| 312 // need to set it up before we can run the tests. | 311 // need to set it up before we can run the tests. |
| 313 int main(int argc, char** argv) { | 312 int main(int argc, char** argv) { |
| 314 CommandLine::Init(argc, argv); | 313 CommandLine::Init(argc, argv); |
| 315 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); | 314 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); |
| 316 #if defined(OS_MACOSX) | 315 #if defined(OS_MACOSX) |
| 317 base::mac::ScopedNSAutoreleasePool pool; | 316 base::mac::ScopedNSAutoreleasePool pool; |
| 318 #endif | 317 #endif |
| 319 #if defined(TOOLKIT_GTK) | 318 #if defined(TOOLKIT_GTK) |
| 320 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); | 319 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); |
| 321 #endif | 320 #endif |
| 322 gfx::GLSurface::InitializeOneOff(); | 321 gfx::GLSurface::InitializeOneOff(); |
| 323 | 322 |
| 324 return content::UnitTestTestSuite(suite).Run(); | 323 return content::UnitTestTestSuite(suite).Run(); |
| 325 } | 324 } |
| OLD | NEW |