Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: content/common/gpu/client/gl_helper_benchmark.cc

Issue 133363004: content_gl_tests should skip RGB565 test if the prior detection of format support fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize variables before operating getintegerv Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/common/gpu/client/gl_helper.cc ('k') | content/common/gpu/client/gl_helper_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « content/common/gpu/client/gl_helper.cc ('k') | content/common/gpu/client/gl_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698