OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include <stdio.h> | 5 #include <stdio.h> |
6 #include <cmath> | 6 #include <cmath> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include <GLES2/gl2.h> | 10 #include <GLES2/gl2.h> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 content::GLHelper::SCALER_QUALITY_BEST, | 53 content::GLHelper::SCALER_QUALITY_BEST, |
54 content::GLHelper::SCALER_QUALITY_GOOD, | 54 content::GLHelper::SCALER_QUALITY_GOOD, |
55 content::GLHelper::SCALER_QUALITY_FAST, }; | 55 content::GLHelper::SCALER_QUALITY_FAST, }; |
56 | 56 |
57 const char* kQualityNames[] = {"best", "good", "fast", }; | 57 const char* kQualityNames[] = {"best", "good", "fast", }; |
58 | 58 |
59 class GLHelperTest : public testing::Test { | 59 class GLHelperTest : public testing::Test { |
60 protected: | 60 protected: |
61 virtual void SetUp() { | 61 virtual void SetUp() { |
62 WebGraphicsContext3D::Attributes attributes; | 62 WebGraphicsContext3D::Attributes attributes; |
63 bool lose_context_when_out_of_memory = false; | |
64 context_ = | 63 context_ = |
65 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( | 64 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( |
66 attributes, lose_context_when_out_of_memory); | 65 attributes); |
67 context_->makeContextCurrent(); | 66 context_->makeContextCurrent(); |
68 context_support_ = context_->GetContextSupport(); | 67 context_support_ = context_->GetContextSupport(); |
69 helper_.reset( | 68 helper_.reset( |
70 new content::GLHelper(context_->GetGLInterface(), context_support_)); | 69 new content::GLHelper(context_->GetGLInterface(), context_support_)); |
71 helper_scaling_.reset(new content::GLHelperScaling( | 70 helper_scaling_.reset(new content::GLHelperScaling( |
72 context_->GetGLInterface(), helper_.get())); | 71 context_->GetGLInterface(), helper_.get())); |
73 } | 72 } |
74 | 73 |
75 virtual void TearDown() { | 74 virtual void TearDown() { |
76 helper_scaling_.reset(NULL); | 75 helper_scaling_.reset(NULL); |
(...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1673 #endif | 1672 #endif |
1674 #if defined(TOOLKIT_GTK) | 1673 #if defined(TOOLKIT_GTK) |
1675 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); | 1674 gfx::GtkInitFromCommandLine(*CommandLine::ForCurrentProcess()); |
1676 #endif | 1675 #endif |
1677 gpu::ApplyGpuDriverBugWorkarounds(CommandLine::ForCurrentProcess()); | 1676 gpu::ApplyGpuDriverBugWorkarounds(CommandLine::ForCurrentProcess()); |
1678 | 1677 |
1679 content::UnitTestTestSuite runner(suite); | 1678 content::UnitTestTestSuite runner(suite); |
1680 base::MessageLoop message_loop; | 1679 base::MessageLoop message_loop; |
1681 return runner.Run(); | 1680 return runner.Run(); |
1682 } | 1681 } |
OLD | NEW |