| 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 "gpu/command_buffer/service/feature_info.h" | 5 #include "gpu/command_buffer/service/feature_info.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 const char* renderer, | 98 const char* renderer, |
| 99 const char* version, | 99 const char* version, |
| 100 const base::CommandLine& command_line) { | 100 const base::CommandLine& command_line) { |
| 101 GpuServiceTest::SetUpWithGLVersion(version, extensions); | 101 GpuServiceTest::SetUpWithGLVersion(version, extensions); |
| 102 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( | 102 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( |
| 103 gl_.get(), extensions, renderer, version); | 103 gl_.get(), extensions, renderer, version); |
| 104 info_ = new FeatureInfo(command_line); | 104 info_ = new FeatureInfo(command_line); |
| 105 info_->InitializeForTesting(); | 105 info_->InitializeForTesting(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void SetupInitExpectationsWithGLVersionAndContextTypeAndCommandLine( | |
| 109 const char* extensions, | |
| 110 const char* renderer, | |
| 111 const char* version, | |
| 112 ContextType context_type, | |
| 113 const base::CommandLine& command_line) { | |
| 114 GpuServiceTest::SetUpWithGLVersion(version, extensions); | |
| 115 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( | |
| 116 gl_.get(), extensions, renderer, version); | |
| 117 info_ = new FeatureInfo(command_line); | |
| 118 info_->Initialize(context_type, DisallowedFeatures()); | |
| 119 } | |
| 120 | |
| 121 void SetupWithCommandLine(const base::CommandLine& command_line) { | 108 void SetupWithCommandLine(const base::CommandLine& command_line) { |
| 122 GpuServiceTest::SetUp(); | 109 GpuServiceTest::SetUp(); |
| 123 info_ = new FeatureInfo(command_line); | 110 info_ = new FeatureInfo(command_line); |
| 124 } | 111 } |
| 125 | 112 |
| 126 void SetupInitExpectationsWithCommandLine( | 113 void SetupInitExpectationsWithCommandLine( |
| 127 const char* extensions, | 114 const char* extensions, |
| 128 const base::CommandLine& command_line) { | 115 const base::CommandLine& command_line) { |
| 129 GpuServiceTest::SetUpWithGLVersion("2.0", extensions); | 116 GpuServiceTest::SetUpWithGLVersion("2.0", extensions); |
| 130 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( | 117 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( |
| (...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1416 EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_RG_EXT)); | 1403 EXPECT_TRUE(info_->validators()->read_pixel_format.IsValid(GL_RG_EXT)); |
| 1417 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_R8_EXT)); | 1404 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_R8_EXT)); |
| 1418 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT)); | 1405 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT)); |
| 1419 } | 1406 } |
| 1420 | 1407 |
| 1421 TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) { | 1408 TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) { |
| 1422 SetupInitExpectations("GL_APPLE_ycbcr_422"); | 1409 SetupInitExpectations("GL_APPLE_ycbcr_422"); |
| 1423 EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422); | 1410 EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422); |
| 1424 } | 1411 } |
| 1425 | 1412 |
| 1426 TEST_P(FeatureInfoTest, DisableMsaaOnNonWebGLContexts) { | |
| 1427 base::CommandLine command_line(0, NULL); | |
| 1428 command_line.AppendSwitchASCII( | |
| 1429 switches::kGpuDriverBugWorkarounds, | |
| 1430 base::IntToString(gpu::DISABLE_MSAA_ON_NON_WEBGL_CONTEXTS)); | |
| 1431 SetupInitExpectationsWithGLVersionAndContextTypeAndCommandLine( | |
| 1432 "GL_EXT_multisampled_render_to_texture GL_EXT_framebuffer_multisample", | |
| 1433 "", "", CONTEXT_TYPE_OPENGLES2, command_line); | |
| 1434 EXPECT_FALSE(info_->feature_flags().multisampled_render_to_texture); | |
| 1435 EXPECT_FALSE(info_->feature_flags().chromium_framebuffer_multisample); | |
| 1436 } | |
| 1437 | |
| 1438 TEST_P(FeatureInfoTest, DontDisableMsaaOnWebGLContexts) { | |
| 1439 base::CommandLine command_line(0, NULL); | |
| 1440 command_line.AppendSwitchASCII( | |
| 1441 switches::kGpuDriverBugWorkarounds, | |
| 1442 base::IntToString(gpu::DISABLE_MSAA_ON_NON_WEBGL_CONTEXTS)); | |
| 1443 SetupInitExpectationsWithGLVersionAndContextTypeAndCommandLine( | |
| 1444 "GL_EXT_multisampled_render_to_texture GL_EXT_framebuffer_multisample", | |
| 1445 "", "", CONTEXT_TYPE_WEBGL1, command_line); | |
| 1446 EXPECT_TRUE(info_->feature_flags().multisampled_render_to_texture); | |
| 1447 EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample); | |
| 1448 } | |
| 1449 | |
| 1450 } // namespace gles2 | 1413 } // namespace gles2 |
| 1451 } // namespace gpu | 1414 } // namespace gpu |
| OLD | NEW |