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

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

Issue 109043002: Move more file_util functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « content/child/npapi/plugin_stream_posix.cc ('k') | content/common/mac/font_loader.mm » ('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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 std::vector<unsigned char> compressed; 95 std::vector<unsigned char> compressed;
96 ASSERT_TRUE(gfx::PNGCodec::Encode( 96 ASSERT_TRUE(gfx::PNGCodec::Encode(
97 static_cast<unsigned char*>(bitmap->getPixels()), 97 static_cast<unsigned char*>(bitmap->getPixels()),
98 gfx::PNGCodec::FORMAT_BGRA, 98 gfx::PNGCodec::FORMAT_BGRA,
99 gfx::Size(bitmap->width(), bitmap->height()), 99 gfx::Size(bitmap->width(), bitmap->height()),
100 static_cast<int>(bitmap->rowBytes()), 100 static_cast<int>(bitmap->rowBytes()),
101 true, 101 true,
102 std::vector<gfx::PNGCodec::Comment>(), 102 std::vector<gfx::PNGCodec::Comment>(),
103 &compressed)); 103 &compressed));
104 ASSERT_TRUE(compressed.size()); 104 ASSERT_TRUE(compressed.size());
105 FILE* f = file_util::OpenFile(filename, "wb"); 105 FILE* f = base::OpenFile(filename, "wb");
106 ASSERT_TRUE(f); 106 ASSERT_TRUE(f);
107 ASSERT_EQ(fwrite(&*compressed.begin(), 1, compressed.size(), f), 107 ASSERT_EQ(fwrite(&*compressed.begin(), 1, compressed.size(), f),
108 compressed.size()); 108 compressed.size());
109 file_util::CloseFile(f); 109 base::CloseFile(f);
110 } 110 }
111 111
112 scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl> 112 scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl>
113 context_; 113 context_;
114 scoped_ptr<content::GLHelper> helper_; 114 scoped_ptr<content::GLHelper> helper_;
115 scoped_ptr<content::GLHelperScaling> helper_scaling_; 115 scoped_ptr<content::GLHelperScaling> helper_scaling_;
116 std::deque<GLHelperScaling::ScaleOp> x_ops_, y_ops_; 116 std::deque<GLHelperScaling::ScaleOp> x_ops_, y_ops_;
117 }; 117 };
118 118
119 119
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 #if defined(OS_MACOSX) 314 #if defined(OS_MACOSX)
315 base::mac::ScopedNSAutoreleasePool pool; 315 base::mac::ScopedNSAutoreleasePool pool;
316 #endif 316 #endif
317 #if defined(TOOLKIT_GTK) 317 #if defined(TOOLKIT_GTK)
318 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); 318 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess());
319 #endif 319 #endif
320 gfx::GLSurface::InitializeOneOff(); 320 gfx::GLSurface::InitializeOneOff();
321 321
322 return content::UnitTestTestSuite(suite).Run(); 322 return content::UnitTestTestSuite(suite).Run();
323 } 323 }
OLDNEW
« no previous file with comments | « content/child/npapi/plugin_stream_posix.cc ('k') | content/common/mac/font_loader.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698