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 #include "ui/gl/gl_helper.h" | 5 #include "ui/gl/gl_helper.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ui/gl/gl_context.h" |
| 11 #include "ui/gl/gl_version_info.h" |
10 #include "ui/gl/scoped_binders.h" | 12 #include "ui/gl/scoped_binders.h" |
11 | 13 |
12 namespace gl { | 14 namespace gl { |
13 | 15 |
14 // static | 16 // static |
15 GLuint GLHelper::CompileShader(GLenum type, const char* src) { | 17 GLuint GLHelper::CompileShader(GLenum type, const char* src) { |
16 GLuint shader = glCreateShader(type); | 18 GLuint shader = glCreateShader(type); |
17 // Load the shader source. | 19 // Load the shader source. |
18 glShaderSource(shader, 1, &src, nullptr); | 20 glShaderSource(shader, 1, &src, nullptr); |
19 // Compile the shader. | 21 // Compile the shader. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 ScopedCapability disable_blending(GL_BLEND, GL_FALSE); | 89 ScopedCapability disable_blending(GL_BLEND, GL_FALSE); |
88 ScopedCapability disable_culling(GL_CULL_FACE, GL_FALSE); | 90 ScopedCapability disable_culling(GL_CULL_FACE, GL_FALSE); |
89 ScopedCapability disable_dithering(GL_DITHER, GL_FALSE); | 91 ScopedCapability disable_dithering(GL_DITHER, GL_FALSE); |
90 ScopedCapability disable_depth_test(GL_DEPTH_TEST, GL_FALSE); | 92 ScopedCapability disable_depth_test(GL_DEPTH_TEST, GL_FALSE); |
91 ScopedCapability disable_scissor_test(GL_SCISSOR_TEST, GL_FALSE); | 93 ScopedCapability disable_scissor_test(GL_SCISSOR_TEST, GL_FALSE); |
92 ScopedColorMask color_mask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); | 94 ScopedColorMask color_mask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); |
93 | 95 |
94 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); | 96 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); |
95 } | 97 } |
96 | 98 |
| 99 // static |
| 100 bool GLHelper::ShouldTestsUseVAOs() { |
| 101 return GLContext::GetCurrent()->GetVersionInfo()->is_desktop_core_profile; |
| 102 } |
| 103 |
97 } // namespace gl | 104 } // namespace gl |
OLD | NEW |