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 <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
6 #include <GLES2/gl2ext.h> | 6 #include <GLES2/gl2ext.h> |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "gpu/command_buffer/tests/gl_manager.h" | 9 #include "gpu/command_buffer/tests/gl_manager.h" |
10 #include "gpu/command_buffer/tests/gl_test_utils.h" | 10 #include "gpu/command_buffer/tests/gl_test_utils.h" |
11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 namespace gpu { | 14 namespace gpu { |
15 | 15 |
16 class GLSharedResources : public testing::Test { | 16 class GLSharedResources : public testing::Test { |
17 protected: | 17 protected: |
18 virtual void SetUp() { | 18 virtual void SetUp() { |
19 GLManager::Options options; | 19 GLManager::Options options; |
20 #if ENABLE_DCHECK | |
21 // This can't be false if DCHECK is enabled because a DCHECK in | |
22 // gpu/command_buffer/client/share_group.h will trigger. | |
23 // The test below is making sure things don't break in release. | |
24 options.bind_generates_resource = false; | |
25 #else | |
26 options.bind_generates_resource = true; | 20 options.bind_generates_resource = true; |
27 #endif | |
28 gl1_.Initialize(options); | 21 gl1_.Initialize(options); |
29 options.share_group_manager = &gl1_; | 22 options.share_group_manager = &gl1_; |
30 gl2_.Initialize(options); | 23 gl2_.Initialize(options); |
31 } | 24 } |
32 | 25 |
33 virtual void TearDown() { | 26 virtual void TearDown() { |
34 gl1_.Destroy(); | 27 gl1_.Destroy(); |
35 gl2_.Destroy(); | 28 gl2_.Destroy(); |
36 } | 29 } |
37 | 30 |
(...skipping 11 matching lines...) Expand all Loading... |
49 glDeleteTextures(1, &tex); | 42 glDeleteTextures(1, &tex); |
50 gl1_.MakeCurrent(); | 43 gl1_.MakeCurrent(); |
51 glBindTexture(GL_TEXTURE_2D,tex); | 44 glBindTexture(GL_TEXTURE_2D,tex); |
52 GLTestHelper::CheckGLError("no errors", __LINE__); | 45 GLTestHelper::CheckGLError("no errors", __LINE__); |
53 gl2_.MakeCurrent(); | 46 gl2_.MakeCurrent(); |
54 GLTestHelper::CheckGLError("no errors", __LINE__); | 47 GLTestHelper::CheckGLError("no errors", __LINE__); |
55 } | 48 } |
56 | 49 |
57 } // namespace gpu | 50 } // namespace gpu |
58 | 51 |
OLD | NEW |