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

Unified Diff: ui/gl/test/gl_image_test_template.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_helper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/test/gl_image_test_template.h
diff --git a/ui/gl/test/gl_image_test_template.h b/ui/gl/test/gl_image_test_template.h
index 7203f0f63e72507ccb2d67b31f61e7b505b85249..f8122dc59a9fd62ac7f95e402f6c64a51777ca24 100644
--- a/ui/gl/test/gl_image_test_template.h
+++ b/ui/gl/test/gl_image_test_template.h
@@ -110,6 +110,12 @@ void DrawTextureQuad(GLenum target, const gfx::Size& size) {
);
// clang-format on
+ GLuint vao = 0;
+ if (GLHelper::ShouldTestsUseVAOs()) {
+ glGenVertexArraysOES(1, &vao);
+ glBindVertexArrayOES(vao);
+ }
+
GLuint vertex_shader = GLHelper::LoadShader(GL_VERTEX_SHADER, kVertexShader);
GLuint fragment_shader = LoadFragmentShader(target, size);
GLuint program = GLHelper::SetupProgram(vertex_shader, fragment_shader);
@@ -123,6 +129,10 @@ void DrawTextureQuad(GLenum target, const gfx::Size& size) {
GLuint vertex_buffer = GLHelper::SetupQuadVertexBuffer();
GLHelper::DrawQuad(vertex_buffer);
+ if (vao != 0) {
+ glDeleteVertexArraysOES(1, &vao);
+ }
+
glDeleteShader(vertex_shader);
glDeleteShader(fragment_shader);
glDeleteProgram(program);
« no previous file with comments | « ui/gl/gl_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698