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

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

Issue 169603002: Add initial support for NV_path_rendering extension to gpu command buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format Created 6 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
OLDNEW
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "gpu/command_buffer/service/gpu_service_test.h" 10 #include "gpu/command_buffer/service/gpu_service_test.h"
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 base::IntToString(gpu::EXIT_ON_CONTEXT_LOST) + "," + 1043 base::IntToString(gpu::EXIT_ON_CONTEXT_LOST) + "," +
1044 base::IntToString(gpu::MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024) + "," + 1044 base::IntToString(gpu::MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024) + "," +
1045 base::IntToString(gpu::MAX_TEXTURE_SIZE_LIMIT_4096)); 1045 base::IntToString(gpu::MAX_TEXTURE_SIZE_LIMIT_4096));
1046 // Workarounds should get parsed without the need for a context. 1046 // Workarounds should get parsed without the need for a context.
1047 SetupWithCommandLine(command_line); 1047 SetupWithCommandLine(command_line);
1048 EXPECT_TRUE(info_->workarounds().exit_on_context_lost); 1048 EXPECT_TRUE(info_->workarounds().exit_on_context_lost);
1049 EXPECT_EQ(1024, info_->workarounds().max_cube_map_texture_size); 1049 EXPECT_EQ(1024, info_->workarounds().max_cube_map_texture_size);
1050 EXPECT_EQ(4096, info_->workarounds().max_texture_size); 1050 EXPECT_EQ(4096, info_->workarounds().max_texture_size);
1051 } 1051 }
1052 1052
1053
1053 TEST_F(FeatureInfoTest, InitializeWithARBSync) { 1054 TEST_F(FeatureInfoTest, InitializeWithARBSync) {
1054 SetupInitExpectations("GL_ARB_sync"); 1055 SetupInitExpectations("GL_ARB_sync");
1055 EXPECT_TRUE(info_->feature_flags().chromium_sync_query); 1056 EXPECT_TRUE(info_->feature_flags().chromium_sync_query);
1056 EXPECT_TRUE(gfx::GLFence::IsSupported()); 1057 EXPECT_TRUE(gfx::GLFence::IsSupported());
1057 } 1058 }
1058 1059
1059 TEST_F(FeatureInfoTest, InitializeWithNVFence) { 1060 TEST_F(FeatureInfoTest, InitializeWithNVFence) {
1060 SetupInitExpectations("GL_NV_fence"); 1061 SetupInitExpectations("GL_NV_fence");
1061 EXPECT_TRUE(info_->feature_flags().chromium_sync_query); 1062 EXPECT_TRUE(info_->feature_flags().chromium_sync_query);
1062 EXPECT_TRUE(gfx::GLFence::IsSupported()); 1063 EXPECT_TRUE(gfx::GLFence::IsSupported());
1063 } 1064 }
1064 1065
1065 TEST_F(FeatureInfoTest, ARBSyncDisabled) { 1066 TEST_F(FeatureInfoTest, ARBSyncDisabled) {
1066 CommandLine command_line(0, NULL); 1067 CommandLine command_line(0, NULL);
1067 command_line.AppendSwitchASCII( 1068 command_line.AppendSwitchASCII(
1068 switches::kGpuDriverBugWorkarounds, 1069 switches::kGpuDriverBugWorkarounds,
1069 base::IntToString(gpu::DISABLE_ARB_SYNC)); 1070 base::IntToString(gpu::DISABLE_ARB_SYNC));
1070 SetupInitExpectationsWithCommandLine("GL_ARB_sync", command_line); 1071 SetupInitExpectationsWithCommandLine("GL_ARB_sync", command_line);
1071 EXPECT_FALSE(info_->feature_flags().chromium_sync_query); 1072 EXPECT_FALSE(info_->feature_flags().chromium_sync_query);
1072 EXPECT_FALSE(gfx::GLFence::IsSupported()); 1073 EXPECT_FALSE(gfx::GLFence::IsSupported());
1073 } 1074 }
1074 1075
1076 TEST_F(FeatureInfoTest, InitializeCHROMIUM_path_rendering) {
1077 SetupInitExpectationsWithGLVersion(
1078 "GL_NV_path_rendering GL_EXT_direct_state_access", "", "4.3");
1079 EXPECT_TRUE(info_->feature_flags().chromium_path_rendering);
1080 EXPECT_THAT(info_->extensions(), HasSubstr("GL_CHROMIUM_path_rendering"));
1081 }
1082
1083 TEST_F(FeatureInfoTest, InitializeCHROMIUM_path_rendering2) {
1084 SetupInitExpectationsWithGLVersion(
1085 "GL_NV_path_rendering", "", "OpenGL ES 3.1");
1086 EXPECT_TRUE(info_->feature_flags().chromium_path_rendering);
1087 EXPECT_THAT(info_->extensions(), HasSubstr("GL_CHROMIUM_path_rendering"));
1088 }
1089
1090 TEST_F(FeatureInfoTest, InitializeNoCHROMIUM_path_rendering) {
1091 SetupInitExpectationsWithGLVersion("", "", "4.3");
1092 EXPECT_FALSE(info_->feature_flags().chromium_path_rendering);
1093 EXPECT_THAT(info_->extensions(),
1094 Not(HasSubstr("GL_CHROMIUM_path_rendering")));
1095 }
1096
1097 TEST_F(FeatureInfoTest, InitializeNoCHROMIUM_path_rendering2) {
1098 SetupInitExpectationsWithGLVersion("GL_NV_path_rendering", "", "4.3");
1099 EXPECT_FALSE(info_->feature_flags().chromium_path_rendering);
1100 EXPECT_THAT(info_->extensions(),
1101 Not(HasSubstr("GL_CHROMIUM_path_rendering")));
1102 }
1103
1075 } // namespace gles2 1104 } // namespace gles2
1076 } // namespace gpu 1105 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698