OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "gpu/command_buffer/service/context_group.h" | 5 #include "gpu/command_buffer/service/context_group.h" |
6 #include "app/gfx/gl/gl_mock.h" | 6 #include "app/gfx/gl/gl_mock.h" |
7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "gpu/command_buffer/service/texture_manager.h" | 8 #include "gpu/command_buffer/service/texture_manager.h" |
9 #include "gpu/GLES2/gles2_command_buffer.h" | 9 #include "gpu/GLES2/gles2_command_buffer.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 EXPECT_EQ(0u, group_.max_vertex_texture_image_units()); | 115 EXPECT_EQ(0u, group_.max_vertex_texture_image_units()); |
116 EXPECT_EQ(0u, group_.max_fragment_uniform_vectors()); | 116 EXPECT_EQ(0u, group_.max_fragment_uniform_vectors()); |
117 EXPECT_EQ(0u, group_.max_varying_vectors()); | 117 EXPECT_EQ(0u, group_.max_varying_vectors()); |
118 EXPECT_EQ(0u, group_.max_vertex_uniform_vectors()); | 118 EXPECT_EQ(0u, group_.max_vertex_uniform_vectors()); |
119 EXPECT_TRUE(group_.buffer_manager() == NULL); | 119 EXPECT_TRUE(group_.buffer_manager() == NULL); |
120 EXPECT_TRUE(group_.framebuffer_manager() == NULL); | 120 EXPECT_TRUE(group_.framebuffer_manager() == NULL); |
121 EXPECT_TRUE(group_.renderbuffer_manager() == NULL); | 121 EXPECT_TRUE(group_.renderbuffer_manager() == NULL); |
122 EXPECT_TRUE(group_.texture_manager() == NULL); | 122 EXPECT_TRUE(group_.texture_manager() == NULL); |
123 EXPECT_TRUE(group_.program_manager() == NULL); | 123 EXPECT_TRUE(group_.program_manager() == NULL); |
124 EXPECT_TRUE(group_.shader_manager() == NULL); | 124 EXPECT_TRUE(group_.shader_manager() == NULL); |
| 125 EXPECT_FALSE(group_.extension_flags().ext_framebuffer_multisample); |
125 } | 126 } |
126 | 127 |
127 TEST_F(ContextGroupTest, InitializeNoExtensions) { | 128 TEST_F(ContextGroupTest, InitializeNoExtensions) { |
128 SetupInitExpectations(""); | 129 SetupInitExpectations(""); |
129 group_.Initialize(); | 130 group_.Initialize(); |
130 // Check a couple of random extensions that should not be there. | 131 // Check a couple of random extensions that should not be there. |
131 EXPECT_THAT(group_.extensions(), Not(HasSubstr("GL_OES_texture_npot"))); | 132 EXPECT_THAT(group_.extensions(), Not(HasSubstr("GL_OES_texture_npot"))); |
132 EXPECT_THAT(group_.extensions(), | 133 EXPECT_THAT(group_.extensions(), |
133 Not(HasSubstr("GL_EXT_texture_compression_dxt1"))); | 134 Not(HasSubstr("GL_EXT_texture_compression_dxt1"))); |
134 EXPECT_FALSE(group_.texture_manager()->npot_ok()); | 135 EXPECT_FALSE(group_.texture_manager()->npot_ok()); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 EXPECT_THAT(group_.extensions(), Not(HasSubstr("GL_OES_texture_float"))); | 280 EXPECT_THAT(group_.extensions(), Not(HasSubstr("GL_OES_texture_float"))); |
280 EXPECT_THAT(group_.extensions(), HasSubstr("GL_OES_texture_half_float")); | 281 EXPECT_THAT(group_.extensions(), HasSubstr("GL_OES_texture_half_float")); |
281 EXPECT_THAT(group_.extensions(), | 282 EXPECT_THAT(group_.extensions(), |
282 Not(HasSubstr("GL_OES_texture_float_linear"))); | 283 Not(HasSubstr("GL_OES_texture_float_linear"))); |
283 EXPECT_THAT(group_.extensions(), | 284 EXPECT_THAT(group_.extensions(), |
284 HasSubstr("GL_OES_texture_half_float_linear")); | 285 HasSubstr("GL_OES_texture_half_float_linear")); |
285 EXPECT_FALSE(group_.validators()->pixel_type.IsValid(GL_FLOAT)); | 286 EXPECT_FALSE(group_.validators()->pixel_type.IsValid(GL_FLOAT)); |
286 EXPECT_TRUE(group_.validators()->pixel_type.IsValid(GL_HALF_FLOAT_OES)); | 287 EXPECT_TRUE(group_.validators()->pixel_type.IsValid(GL_HALF_FLOAT_OES)); |
287 } | 288 } |
288 | 289 |
| 290 TEST_F(ContextGroupTest, InitializeEXT_framebuffer_multisample) { |
| 291 SetupInitExpectations("GL_EXT_framebuffer_multisample"); |
| 292 group_.Initialize(); |
| 293 EXPECT_TRUE(group_.extension_flags().ext_framebuffer_multisample); |
| 294 EXPECT_THAT(group_.extensions(), HasSubstr("GL_EXT_framebuffer_multisample")); |
| 295 EXPECT_THAT(group_.extensions(), HasSubstr("GL_EXT_framebuffer_blit")); |
| 296 EXPECT_TRUE(group_.validators()->frame_buffer_target.IsValid( |
| 297 GL_READ_FRAMEBUFFER_EXT)); |
| 298 EXPECT_TRUE(group_.validators()->frame_buffer_target.IsValid( |
| 299 GL_DRAW_FRAMEBUFFER_EXT)); |
| 300 EXPECT_TRUE(group_.validators()->g_l_state.IsValid( |
| 301 GL_READ_FRAMEBUFFER_BINDING_EXT)); |
| 302 EXPECT_TRUE(group_.validators()->g_l_state.IsValid( |
| 303 GL_DRAW_FRAMEBUFFER_BINDING_EXT)); |
| 304 EXPECT_TRUE(group_.validators()->render_buffer_parameter.IsValid( |
| 305 GL_MAX_SAMPLES_EXT)); |
| 306 } |
| 307 |
289 } // namespace gles2 | 308 } // namespace gles2 |
290 } // namespace gpu | 309 } // namespace gpu |
291 | 310 |
292 | 311 |
OLD | NEW |