| 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 bool lose_context_when_out_of_memory = false; |
| 65 context_ = webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl:: | 66 context_ = webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl:: |
| 66 CreateOffscreenContext(attributes); | 67 CreateOffscreenContext(attributes, lose_context_when_out_of_memory); |
| 67 context_->makeContextCurrent(); | 68 context_->makeContextCurrent(); |
| 68 | 69 |
| 69 helper_.reset( | 70 helper_.reset( |
| 70 new content::GLHelper(context_->GetGLInterface(), | 71 new content::GLHelper(context_->GetGLInterface(), |
| 71 context_->GetContextSupport())); | 72 context_->GetContextSupport())); |
| 72 helper_scaling_.reset(new content::GLHelperScaling( | 73 helper_scaling_.reset(new content::GLHelperScaling( |
| 73 context_->GetGLInterface(), | 74 context_->GetGLInterface(), |
| 74 helper_.get())); | 75 helper_.get())); |
| 75 } | 76 } |
| 76 | 77 |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 #if defined(OS_MACOSX) | 317 #if defined(OS_MACOSX) |
| 317 base::mac::ScopedNSAutoreleasePool pool; | 318 base::mac::ScopedNSAutoreleasePool pool; |
| 318 #endif | 319 #endif |
| 319 #if defined(TOOLKIT_GTK) | 320 #if defined(TOOLKIT_GTK) |
| 320 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); | 321 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); |
| 321 #endif | 322 #endif |
| 322 gfx::GLSurface::InitializeOneOff(); | 323 gfx::GLSurface::InitializeOneOff(); |
| 323 | 324 |
| 324 return content::UnitTestTestSuite(suite).Run(); | 325 return content::UnitTestTestSuite(suite).Run(); |
| 325 } | 326 } |
| OLD | NEW |