OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 defines tests that implementations of GLImage should pass in order | 5 // This file defines tests that implementations of GLImage should pass in order |
6 // to be conformant. | 6 // to be conformant. |
7 | 7 |
8 #ifndef UI_GL_TEST_GL_IMAGE_TEST_TEMPLATE_H_ | 8 #ifndef UI_GL_TEST_GL_IMAGE_TEST_TEMPLATE_H_ |
9 #define UI_GL_TEST_GL_IMAGE_TEST_TEMPLATE_H_ | 9 #define UI_GL_TEST_GL_IMAGE_TEST_TEMPLATE_H_ |
10 | 10 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 } // namespace | 158 } // namespace |
159 | 159 |
160 template <typename GLImageTestDelegate> | 160 template <typename GLImageTestDelegate> |
161 class GLImageTest : public testing::Test { | 161 class GLImageTest : public testing::Test { |
162 protected: | 162 protected: |
163 // Overridden from testing::Test: | 163 // Overridden from testing::Test: |
164 void SetUp() override { | 164 void SetUp() override { |
165 GLImageTestSupport::InitializeGL(); | 165 GLImageTestSupport::InitializeGL(); |
166 surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size()); | 166 surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size()); |
167 context_ = | 167 context_ = |
168 gl::init::CreateGLContext(nullptr, surface_.get(), PreferIntegratedGpu); | 168 gl::init::CreateGLContext(nullptr, surface_.get(), GLContextAttribs()); |
169 context_->MakeCurrent(surface_.get()); | 169 context_->MakeCurrent(surface_.get()); |
170 } | 170 } |
171 void TearDown() override { | 171 void TearDown() override { |
172 context_->ReleaseCurrent(surface_.get()); | 172 context_->ReleaseCurrent(surface_.get()); |
173 context_ = nullptr; | 173 context_ = nullptr; |
174 surface_ = nullptr; | 174 surface_ = nullptr; |
175 GLImageTestSupport::CleanupGL(); | 175 GLImageTestSupport::CleanupGL(); |
176 } | 176 } |
177 | 177 |
178 protected: | 178 protected: |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 } | 399 } |
400 } | 400 } |
401 | 401 |
402 // The GLImageCopyTest test case verifies that the GLImage implementation | 402 // The GLImageCopyTest test case verifies that the GLImage implementation |
403 // handles CopyTexImage correctly. | 403 // handles CopyTexImage correctly. |
404 REGISTER_TYPED_TEST_CASE_P(GLImageCopyTest, CopyTexImage); | 404 REGISTER_TYPED_TEST_CASE_P(GLImageCopyTest, CopyTexImage); |
405 | 405 |
406 } // namespace gl | 406 } // namespace gl |
407 | 407 |
408 #endif // UI_GL_TEST_GL_IMAGE_TEST_TEMPLATE_H_ | 408 #endif // UI_GL_TEST_GL_IMAGE_TEST_TEMPLATE_H_ |
OLD | NEW |