Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: ui/gl/gl_helper.cc

Issue 2094823002: gl_unittests: on a core profile, use VAOs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify ShouldTestsUseVAOs Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/gl_helper.h ('k') | ui/gl/test/gl_image_test_template.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/gl/gl_helper.h ('k') | ui/gl/test/gl_image_test_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698