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 <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
6 #include <GLES2/gl2ext.h> | 6 #include <GLES2/gl2ext.h> |
7 | 7 |
8 #include "gpu/command_buffer/tests/gl_manager.h" | 8 #include "gpu/command_buffer/tests/gl_manager.h" |
9 #include "gpu/command_buffer/tests/gl_test_utils.h" | 9 #include "gpu/command_buffer/tests/gl_test_utils.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 SetMatrix(x, z, scale, matrix); | 59 SetMatrix(x, z, scale, matrix); |
60 | 60 |
61 // Set up the model matrix | 61 // Set up the model matrix |
62 glUniformMatrix4fv(matrix_loc_, 1, GL_FALSE, matrix); | 62 glUniformMatrix4fv(matrix_loc_, 1, GL_FALSE, matrix); |
63 glUniform4fv(color_loc_, 1, color); | 63 glUniform4fv(color_loc_, 1, color); |
64 | 64 |
65 glDrawArrays(GL_TRIANGLES, 0, 6); | 65 glDrawArrays(GL_TRIANGLES, 0, 6); |
66 } | 66 } |
67 | 67 |
68 TEST_F(OcclusionQueryTest, Occlusion) { | 68 TEST_F(OcclusionQueryTest, Occlusion) { |
| 69 #ifdef OS_MACOSX |
| 70 EXPECT_TRUE(GLTestHelper::HasExtension("GL_EXT_occlusion_query_boolean")) |
| 71 << "GL_EXT_occlusion_query_boolean is required on OSX"; |
| 72 #endif |
| 73 |
69 if (!GLTestHelper::HasExtension("GL_EXT_occlusion_query_boolean")) { | 74 if (!GLTestHelper::HasExtension("GL_EXT_occlusion_query_boolean")) { |
70 return; | 75 return; |
71 } | 76 } |
72 | 77 |
73 static const char* v_shader_str = | 78 static const char* v_shader_str = |
74 "uniform mat4 worldMatrix;\n" | 79 "uniform mat4 worldMatrix;\n" |
75 "attribute vec3 g_Position;\n" | 80 "attribute vec3 g_Position;\n" |
76 "void main()\n" | 81 "void main()\n" |
77 "{\n" | 82 "{\n" |
78 " gl_Position = worldMatrix *\n" | 83 " gl_Position = worldMatrix *\n" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &result); | 140 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &result); |
136 EXPECT_TRUE(result); | 141 EXPECT_TRUE(result); |
137 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &query_status); | 142 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &query_status); |
138 EXPECT_TRUE(query_status); | 143 EXPECT_TRUE(query_status); |
139 GLTestHelper::CheckGLError("no errors", __LINE__); | 144 GLTestHelper::CheckGLError("no errors", __LINE__); |
140 } | 145 } |
141 | 146 |
142 } // namespace gpu | 147 } // namespace gpu |
143 | 148 |
144 | 149 |
OLD | NEW |