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

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

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 virtual void TearDown() { 75 virtual void TearDown() {
76 helper_scaling_.reset(NULL); 76 helper_scaling_.reset(NULL);
77 helper_.reset(NULL); 77 helper_.reset(NULL);
78 context_.reset(NULL); 78 context_.reset(NULL);
79 } 79 }
80 80
81 81
82 void LoadPngFileToSkBitmap(const base::FilePath& filename, 82 void LoadPngFileToSkBitmap(const base::FilePath& filename,
83 SkBitmap* bitmap) { 83 SkBitmap* bitmap) {
84 std::string compressed; 84 std::string compressed;
85 file_util::ReadFileToString(base::MakeAbsoluteFilePath(filename), 85 base::ReadFileToString(base::MakeAbsoluteFilePath(filename), &compressed);
86 &compressed);
87 ASSERT_TRUE(compressed.size()); 86 ASSERT_TRUE(compressed.size());
88 ASSERT_TRUE(gfx::PNGCodec::Decode( 87 ASSERT_TRUE(gfx::PNGCodec::Decode(
89 reinterpret_cast<const unsigned char*>(compressed.data()), 88 reinterpret_cast<const unsigned char*>(compressed.data()),
90 compressed.size(), bitmap)); 89 compressed.size(), bitmap));
91 } 90 }
92 91
93 // Save the image to a png file. Used to create the initial test files. 92 // Save the image to a png file. Used to create the initial test files.
94 void SaveToFile(SkBitmap* bitmap, const base::FilePath& filename) { 93 void SaveToFile(SkBitmap* bitmap, const base::FilePath& filename) {
95 std::vector<unsigned char> compressed; 94 std::vector<unsigned char> compressed;
96 ASSERT_TRUE(gfx::PNGCodec::Encode( 95 ASSERT_TRUE(gfx::PNGCodec::Encode(
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 #if defined(OS_MACOSX) 312 #if defined(OS_MACOSX)
314 base::mac::ScopedNSAutoreleasePool pool; 313 base::mac::ScopedNSAutoreleasePool pool;
315 #endif 314 #endif
316 #if defined(TOOLKIT_GTK) 315 #if defined(TOOLKIT_GTK)
317 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); 316 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess());
318 #endif 317 #endif
319 gfx::GLSurface::InitializeOneOff(); 318 gfx::GLSurface::InitializeOneOff();
320 319
321 return content::UnitTestTestSuite(suite).Run(); 320 return content::UnitTestTestSuite(suite).Run();
322 } 321 }
OLDNEW
« no previous file with comments | « content/child/npapi/plugin_host.cc ('k') | content/common/gpu/media/video_decode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698