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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 SetMatrix(x, z, scale, matrix); | 61 SetMatrix(x, z, scale, matrix); |
62 | 62 |
63 // Set up the model matrix | 63 // Set up the model matrix |
64 glUniformMatrix4fv(matrix_loc_, 1, GL_FALSE, matrix); | 64 glUniformMatrix4fv(matrix_loc_, 1, GL_FALSE, matrix); |
65 glUniform4fv(color_loc_, 1, color); | 65 glUniform4fv(color_loc_, 1, color); |
66 | 66 |
67 glDrawArrays(GL_TRIANGLES, 0, 6); | 67 glDrawArrays(GL_TRIANGLES, 0, 6); |
68 } | 68 } |
69 | 69 |
70 TEST_F(OcclusionQueryTest, Occlusion) { | 70 TEST_F(OcclusionQueryTest, Occlusion) { |
71 #ifdef OS_MACOSX | 71 #if defined(OS_MACOSX) |
72 EXPECT_TRUE(GLTestHelper::HasExtension("GL_EXT_occlusion_query_boolean")) | 72 EXPECT_TRUE(GLTestHelper::HasExtension("GL_EXT_occlusion_query_boolean")) |
73 << "GL_EXT_occlusion_query_boolean is required on OSX"; | 73 << "GL_EXT_occlusion_query_boolean is required on OSX"; |
74 #endif | 74 #endif |
75 | 75 |
76 if (!GLTestHelper::HasExtension("GL_EXT_occlusion_query_boolean")) { | 76 if (!GLTestHelper::HasExtension("GL_EXT_occlusion_query_boolean")) { |
77 return; | 77 return; |
78 } | 78 } |
79 | 79 |
80 static const char* v_shader_str = | 80 static const char* v_shader_str = |
81 "uniform mat4 worldMatrix;\n" | 81 "uniform mat4 worldMatrix;\n" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &result); | 142 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &result); |
143 EXPECT_TRUE(result); | 143 EXPECT_TRUE(result); |
144 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &query_status); | 144 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &query_status); |
145 EXPECT_TRUE(query_status); | 145 EXPECT_TRUE(query_status); |
146 GLTestHelper::CheckGLError("no errors", __LINE__); | 146 GLTestHelper::CheckGLError("no errors", __LINE__); |
147 } | 147 } |
148 | 148 |
149 } // namespace gpu | 149 } // namespace gpu |
150 | 150 |
151 | 151 |
OLD | NEW |