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 "base/threading/platform_thread.h" | 8 #include "base/threading/platform_thread.h" |
9 #include "gpu/command_buffer/tests/gl_manager.h" | 9 #include "gpu/command_buffer/tests/gl_manager.h" |
10 #include "gpu/command_buffer/tests/gl_test_utils.h" | 10 #include "gpu/command_buffer/tests/gl_test_utils.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 glFinish(); | 42 glFinish(); |
43 | 43 |
44 query_status = 0; | 44 query_status = 0; |
45 result = 0; | 45 result = 0; |
46 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &result); | 46 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &result); |
47 EXPECT_TRUE(result); | 47 EXPECT_TRUE(result); |
48 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &query_status); | 48 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &query_status); |
49 EXPECT_EQ(static_cast<uint32>(GL_INVALID_ENUM), query_status); | 49 EXPECT_EQ(static_cast<uint32>(GL_INVALID_ENUM), query_status); |
50 } | 50 } |
51 | 51 |
52 TEST_F(QueryTest, LatencyQueryBasic) { | 52 TEST_F(QueryTest, DISABLED_LatencyQueryBasic) { |
53 EXPECT_TRUE(GLTestHelper::HasExtension( | 53 EXPECT_TRUE(GLTestHelper::HasExtension( |
54 "GL_CHROMIUM_command_buffer_latency_query")); | 54 "GL_CHROMIUM_command_buffer_latency_query")); |
55 | 55 |
56 GLuint query = 0; | 56 GLuint query = 0; |
57 glGenQueriesEXT(1, &query); | 57 glGenQueriesEXT(1, &query); |
58 | 58 |
59 GLuint query_result = 0; | 59 GLuint query_result = 0; |
60 GLuint available = 0; | 60 GLuint available = 0; |
61 | 61 |
62 // First test a query with a ~1ms "latency". | 62 // First test a query with a ~1ms "latency". |
(...skipping 30 matching lines...) Expand all Loading... |
93 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &available); | 93 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_AVAILABLE_EXT, &available); |
94 EXPECT_TRUE(available); | 94 EXPECT_TRUE(available); |
95 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &query_result); | 95 glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT, &query_result); |
96 | 96 |
97 EXPECT_LE(query_result, kTimePrecisionMicroseconds); | 97 EXPECT_LE(query_result, kTimePrecisionMicroseconds); |
98 } | 98 } |
99 | 99 |
100 } // namespace gpu | 100 } // namespace gpu |
101 | 101 |
102 | 102 |
OLD | NEW |