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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 const char *kQualityNames[] = { | 55 const char *kQualityNames[] = { |
56 "best", | 56 "best", |
57 "good", | 57 "good", |
58 "fast", | 58 "fast", |
59 }; | 59 }; |
60 | 60 |
61 class GLHelperTest : public testing::Test { | 61 class GLHelperTest : public testing::Test { |
62 protected: | 62 protected: |
63 virtual void SetUp() { | 63 virtual void SetUp() { |
64 WebGraphicsContext3D::Attributes attributes; | 64 WebGraphicsContext3D::Attributes attributes; |
65 context_.reset( | 65 context_ = webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl:: |
66 webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl:: | 66 CreateOffscreenContext(attributes); |
67 CreateOffscreenContext(attributes)); | |
68 context_->makeContextCurrent(); | 67 context_->makeContextCurrent(); |
69 | 68 |
70 helper_.reset(new content::GLHelper(context_.get())); | 69 helper_.reset(new content::GLHelper(context_.get())); |
71 helper_scaling_.reset(new content::GLHelperScaling( | 70 helper_scaling_.reset(new content::GLHelperScaling( |
72 context_.get(), | 71 context_.get(), |
73 helper_.get())); | 72 helper_.get())); |
74 } | 73 } |
75 | 74 |
76 virtual void TearDown() { | 75 virtual void TearDown() { |
77 helper_scaling_.reset(NULL); | 76 helper_scaling_.reset(NULL); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 #if defined(OS_MACOSX) | 313 #if defined(OS_MACOSX) |
315 base::mac::ScopedNSAutoreleasePool pool; | 314 base::mac::ScopedNSAutoreleasePool pool; |
316 #endif | 315 #endif |
317 #if defined(TOOLKIT_GTK) | 316 #if defined(TOOLKIT_GTK) |
318 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); | 317 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); |
319 #endif | 318 #endif |
320 gfx::GLSurface::InitializeOneOff(); | 319 gfx::GLSurface::InitializeOneOff(); |
321 | 320 |
322 return content::UnitTestTestSuite(suite).Run(); | 321 return content::UnitTestTestSuite(suite).Run(); |
323 } | 322 } |
OLD | NEW |