Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: gpu/command_buffer/service/feature_info_unittest.cc

Issue 7458008: Support GL_OES_EGL_image_external (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fix typo which hung the windows gpu_unittests by corrupting the stack Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/service/feature_info.cc ('k') | gpu/command_buffer/service/gl_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/feature_info.h" 5 #include "gpu/command_buffer/service/feature_info.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "gpu/command_buffer/common/gl_mock.h" 8 #include "gpu/command_buffer/common/gl_mock.h"
9 #include "gpu/command_buffer/service/test_helper.h" 9 #include "gpu/command_buffer/service/test_helper.h"
10 #include "gpu/command_buffer/service/texture_manager.h" 10 #include "gpu/command_buffer/service/texture_manager.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 }; 53 };
54 54
55 TEST_F(FeatureInfoTest, Basic) { 55 TEST_F(FeatureInfoTest, Basic) {
56 // Test it starts off uninitialized. 56 // Test it starts off uninitialized.
57 EXPECT_FALSE(info_.feature_flags().chromium_framebuffer_multisample); 57 EXPECT_FALSE(info_.feature_flags().chromium_framebuffer_multisample);
58 EXPECT_FALSE(info_.feature_flags().oes_standard_derivatives); 58 EXPECT_FALSE(info_.feature_flags().oes_standard_derivatives);
59 EXPECT_FALSE(info_.feature_flags().npot_ok); 59 EXPECT_FALSE(info_.feature_flags().npot_ok);
60 EXPECT_FALSE(info_.feature_flags().enable_texture_float_linear); 60 EXPECT_FALSE(info_.feature_flags().enable_texture_float_linear);
61 EXPECT_FALSE(info_.feature_flags().enable_texture_half_float_linear); 61 EXPECT_FALSE(info_.feature_flags().enable_texture_half_float_linear);
62 EXPECT_FALSE(info_.feature_flags().chromium_webglsl); 62 EXPECT_FALSE(info_.feature_flags().chromium_webglsl);
63 EXPECT_FALSE(info_.feature_flags().oes_egl_image_external);
63 } 64 }
64 65
65 TEST_F(FeatureInfoTest, InitializeNoExtensions) { 66 TEST_F(FeatureInfoTest, InitializeNoExtensions) {
66 SetupInitExpectations(""); 67 SetupInitExpectations("");
67 info_.Initialize(NULL); 68 info_.Initialize(NULL);
68 // Check default extensions are there 69 // Check default extensions are there
69 EXPECT_THAT(info_.extensions(), 70 EXPECT_THAT(info_.extensions(),
70 HasSubstr("GL_CHROMIUM_copy_texture_to_parent_texture")); 71 HasSubstr("GL_CHROMIUM_copy_texture_to_parent_texture"));
71 EXPECT_THAT(info_.extensions(), HasSubstr("GL_CHROMIUM_resource_safe")); 72 EXPECT_THAT(info_.extensions(), HasSubstr("GL_CHROMIUM_resource_safe"));
72 EXPECT_THAT(info_.extensions(), HasSubstr("GL_CHROMIUM_strict_attribs")); 73 EXPECT_THAT(info_.extensions(), HasSubstr("GL_CHROMIUM_strict_attribs"));
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 SetupInitExpectations("GL_OES_rgb8_rgba8"); 407 SetupInitExpectations("GL_OES_rgb8_rgba8");
407 info_.Initialize(NULL); 408 info_.Initialize(NULL);
408 EXPECT_THAT(info_.extensions(), 409 EXPECT_THAT(info_.extensions(),
409 HasSubstr("GL_OES_rgb8_rgba8")); 410 HasSubstr("GL_OES_rgb8_rgba8"));
410 EXPECT_TRUE(info_.validators()->render_buffer_format.IsValid( 411 EXPECT_TRUE(info_.validators()->render_buffer_format.IsValid(
411 GL_RGB8_OES)); 412 GL_RGB8_OES));
412 EXPECT_TRUE(info_.validators()->render_buffer_format.IsValid( 413 EXPECT_TRUE(info_.validators()->render_buffer_format.IsValid(
413 GL_RGBA8_OES)); 414 GL_RGBA8_OES));
414 } 415 }
415 416
417 TEST_F(FeatureInfoTest, InitializeOES_EGL_image_external) {
418 SetupInitExpectations("GL_OES_EGL_image_external");
419 info_.Initialize(NULL);
420 EXPECT_THAT(info_.extensions(),
421 HasSubstr("GL_OES_EGL_image_external"));
422 EXPECT_TRUE(info_.feature_flags().oes_egl_image_external);
423 EXPECT_TRUE(info_.validators()->texture_bind_target.IsValid(
424 GL_TEXTURE_EXTERNAL_OES));
425 EXPECT_TRUE(info_.validators()->get_tex_param_target.IsValid(
426 GL_TEXTURE_EXTERNAL_OES));
427 EXPECT_TRUE(info_.validators()->texture_parameter.IsValid(
428 GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES));
429 EXPECT_TRUE(info_.validators()->g_l_state.IsValid(
430 GL_TEXTURE_BINDING_EXTERNAL_OES));
431 }
432
416 } // namespace gles2 433 } // namespace gles2
417 } // namespace gpu 434 } // namespace gpu
418 435
419 436
420 437
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/feature_info.cc ('k') | gpu/command_buffer/service/gl_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698