Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ppapi/tests/test_graphics_3d.h" | 5 #include "ppapi/tests/test_graphics_3d.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
| 8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
| 9 #include <stdio.h> | 9 #include <stdio.h> |
| 10 #include <stdlib.h> | 10 #include <stdlib.h> |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 ASSERT_NE(0, a_query); | 120 ASSERT_NE(0, a_query); |
| 121 glBeginQueryEXT(GL_ANY_SAMPLES_PASSED_EXT, a_query); | 121 glBeginQueryEXT(GL_ANY_SAMPLES_PASSED_EXT, a_query); |
| 122 is_a_query = glIsQueryEXT(a_query); | 122 is_a_query = glIsQueryEXT(a_query); |
| 123 ASSERT_EQ(is_a_query, GL_TRUE); | 123 ASSERT_EQ(is_a_query, GL_TRUE); |
| 124 glEndQueryEXT(GL_ANY_SAMPLES_PASSED_EXT); | 124 glEndQueryEXT(GL_ANY_SAMPLES_PASSED_EXT); |
| 125 glDeleteQueriesEXT(1, &a_query); | 125 glDeleteQueriesEXT(1, &a_query); |
| 126 } | 126 } |
| 127 if (strstr(ext, "GL_ANGLE_instanced_arrays")) { | 127 if (strstr(ext, "GL_ANGLE_instanced_arrays")) { |
| 128 glDrawArraysInstancedANGLE(GL_TRIANGLE_STRIP, 0, 0, 0); | 128 glDrawArraysInstancedANGLE(GL_TRIANGLE_STRIP, 0, 0, 0); |
| 129 } | 129 } |
| 130 if (strstr(ext, "GL_OES_vertex_array_object")) { | |
| 131 GLuint a_vertex_array; | |
|
piman
2014/07/16 23:32:40
nit: = 0
Zachary Kuznia
2014/07/17 04:41:28
Done. Fixed the one above, too.
| |
| 132 GLboolean is_a_vertex_array; | |
|
piman
2014/07/16 23:32:40
nit: declare on first use
Zachary Kuznia
2014/07/17 04:41:27
Done.
| |
| 133 glGenVertexArraysOES(1, &a_vertex_array); | |
| 134 ASSERT_NE(0, a_vertex_array); | |
| 135 glBindVertexArrayOES(a_vertex_array); | |
| 136 is_a_vertex_array = glIsVertexArrayOES(a_vertex_array); | |
| 137 ASSERT_EQ(is_a_vertex_array, GL_TRUE); | |
| 138 glBindVertexArrayOES(0); | |
| 139 glDeleteVertexArraysOES(1, &a_vertex_array); | |
| 140 } | |
| 130 glSetCurrentContextPPAPI(kInvalidContext); | 141 glSetCurrentContextPPAPI(kInvalidContext); |
| 131 | 142 |
| 132 int32_t rv = SwapBuffersSync(&context); | 143 int32_t rv = SwapBuffersSync(&context); |
| 133 ASSERT_EQ(PP_OK, rv); | 144 ASSERT_EQ(PP_OK, rv); |
| 134 | 145 |
| 135 PASS(); | 146 PASS(); |
| 136 } | 147 } |
| 137 | 148 |
| 138 int32_t TestGraphics3D::SwapBuffersSync(pp::Graphics3D* context) { | 149 int32_t TestGraphics3D::SwapBuffersSync(pp::Graphics3D* context) { |
| 139 TestCompletionCallback callback(instance_->pp_instance(), callback_type()); | 150 TestCompletionCallback callback(instance_->pp_instance(), callback_type()); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 ASSERT_EQ(NULL, glGetString(GL_VERSION)); | 200 ASSERT_EQ(NULL, glGetString(GL_VERSION)); |
| 190 ASSERT_EQ(-1, glGetUniformLocation(0, NULL)); | 201 ASSERT_EQ(-1, glGetUniformLocation(0, NULL)); |
| 191 ASSERT_EQ(GL_FALSE, glIsBuffer(0)); | 202 ASSERT_EQ(GL_FALSE, glIsBuffer(0)); |
| 192 ASSERT_EQ(0, glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER)); | 203 ASSERT_EQ(0, glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER)); |
| 193 glClearColor(1.0f, 1.0f, 1.0f, 1.0f); | 204 glClearColor(1.0f, 1.0f, 1.0f, 1.0f); |
| 194 glClear(GL_COLOR_BUFFER_BIT); | 205 glClear(GL_COLOR_BUFFER_BIT); |
| 195 | 206 |
| 196 PASS(); | 207 PASS(); |
| 197 } | 208 } |
| 198 | 209 |
| OLD | NEW |