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_implementation.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() { | |
Corentin Wallez
2016/06/23 20:00:04
AFAIK, after the GLContextGLX change this will alw
piman
2016/06/23 20:09:01
I think we still run the tests on GLES 2.0 (e.g. A
| |
101 auto version = reinterpret_cast<const char*>(glGetString(GL_VERSION)); | |
102 auto renderer = reinterpret_cast<const char*>(glGetString(GL_RENDERER)); | |
103 auto extensions = gl::GetGLExtensionsFromCurrentContext(); | |
104 | |
105 return GLVersionInfo(version, renderer, extensions.c_str()) | |
piman
2016/06/23 20:09:01
nit: you should be able to use GLContext::GetCurre
| |
106 .is_desktop_core_profile; | |
107 } | |
108 | |
97 } // namespace gl | 109 } // namespace gl |
OLD | NEW |