diff options
-rw-r--r-- | chrome/browser/about_flags.cc | 17 | ||||
-rw-r--r-- | content/browser/gpu/gpu_data_manager_impl_private.cc | 4 | ||||
-rw-r--r-- | content/browser/gpu/gpu_internals_ui.cc | 8 | ||||
-rw-r--r-- | content/browser/gpu/webgl_conformance_test.cc | 1 | ||||
-rw-r--r-- | content/browser/web_contents/web_contents_impl.cc | 4 | ||||
-rw-r--r-- | content/common/gpu/gpu_messages.h | 1 | ||||
-rw-r--r-- | content/public/common/content_switches.cc | 5 | ||||
-rw-r--r-- | content/public/common/content_switches.h | 4 | ||||
-rw-r--r-- | gpu/config/gpu_control_list.cc | 31 | ||||
-rw-r--r-- | gpu/config/gpu_control_list.h | 5 | ||||
-rw-r--r-- | gpu/config/gpu_info.cc | 1 | ||||
-rw-r--r-- | gpu/config/gpu_info.h | 4 | ||||
-rw-r--r-- | gpu/config/gpu_info_collector.cc | 10 | ||||
-rw-r--r-- | gpu/config/software_rendering_list_json.cc | 47 |
14 files changed, 90 insertions, 52 deletions
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index dff32ea..5ab3a04 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -418,26 +418,11 @@ const Experiment kExperiments[] = { SINGLE_VALUE_TYPE(switches::kDisableGpuVsync) }, { - "enable-webgl", - IDS_FLAGS_ENABLE_WEBGL_NAME, - IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION, - kOsAndroid, -#if defined(OS_ANDROID) - SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL) -#else - SINGLE_VALUE_TYPE("") -#endif - }, - { "disable-webgl", IDS_FLAGS_DISABLE_WEBGL_NAME, IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION, - kOsDesktop, -#if defined(OS_ANDROID) - SINGLE_VALUE_TYPE("") -#else + kOsAll, SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL) -#endif }, { "disable-webrtc", diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc index 7713cb6..1bd1f6b 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -157,11 +157,7 @@ void UpdateStats(const gpu::GpuBlacklist* blacklist, const bool kGpuFeatureUserFlags[] = { command_line.HasSwitch(switches::kDisableAccelerated2dCanvas), command_line.HasSwitch(switches::kDisableAcceleratedCompositing), -#if defined(OS_ANDROID) - !command_line.HasSwitch(switches::kEnableExperimentalWebGL), -#else command_line.HasSwitch(switches::kDisableExperimentalWebGL), -#endif command_line.HasSwitch(switches::kDisableImageTransportSurface) }; #if defined(OS_WIN) diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc index cbc2472..0e778c2 100644 --- a/content/browser/gpu/gpu_internals_ui.cc +++ b/content/browser/gpu/gpu_internals_ui.cc @@ -162,6 +162,10 @@ base::DictionaryValue* GpuInfoAsDictionaryValue() { gpu_info.gl_ws_version)); basic_info->Append(NewDescriptionValuePair("Window system binding extensions", gpu_info.gl_ws_extensions)); + std::string reset_strategy = + base::StringPrintf("0x%04x", gpu_info.gl_reset_notification_strategy); + basic_info->Append(NewDescriptionValuePair( + "Reset notification strategy", reset_strategy)); base::DictionaryValue* info = new base::DictionaryValue(); info->Set("basic_info", basic_info); @@ -249,11 +253,7 @@ base::Value* GetFeatureStatus() { { "webgl", manager->IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL), -#if defined(OS_ANDROID) - !command_line.HasSwitch(switches::kEnableExperimentalWebGL), -#else command_line.HasSwitch(switches::kDisableExperimentalWebGL), -#endif "WebGL has been disabled, either via about:flags or command line.", false }, diff --git a/content/browser/gpu/webgl_conformance_test.cc b/content/browser/gpu/webgl_conformance_test.cc index c58653c..79f3078 100644 --- a/content/browser/gpu/webgl_conformance_test.cc +++ b/content/browser/gpu/webgl_conformance_test.cc @@ -27,7 +27,6 @@ class WebGLConformanceTest : public ContentBrowserTest { // Allow privileged WebGL extensions. command_line->AppendSwitch(switches::kEnablePrivilegedWebGLExtensions); #if defined(OS_ANDROID) - command_line->AppendSwitch(switches::kEnableExperimentalWebGL); command_line->AppendSwitch( switches::kDisableGestureRequirementForMediaPlayback); #endif diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 152eceb..e1a1934 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -479,11 +479,7 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh, prefs.experimental_webgl_enabled = GpuProcessHost::gpu_enabled() && !command_line.HasSwitch(switches::kDisable3DAPIs) && -#if defined(OS_ANDROID) - command_line.HasSwitch(switches::kEnableExperimentalWebGL); -#else !command_line.HasSwitch(switches::kDisableExperimentalWebGL); -#endif prefs.flash_3d_enabled = GpuProcessHost::gpu_enabled() && diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h index 92b73a9..5749c37 100644 --- a/content/common/gpu/gpu_messages.h +++ b/content/common/gpu/gpu_messages.h @@ -151,6 +151,7 @@ IPC_STRUCT_TRAITS_BEGIN(gpu::GPUInfo) IPC_STRUCT_TRAITS_MEMBER(gl_ws_vendor) IPC_STRUCT_TRAITS_MEMBER(gl_ws_version) IPC_STRUCT_TRAITS_MEMBER(gl_ws_extensions) + IPC_STRUCT_TRAITS_MEMBER(gl_reset_notification_strategy) IPC_STRUCT_TRAITS_MEMBER(can_lose_context) IPC_STRUCT_TRAITS_MEMBER(performance_stats) IPC_STRUCT_TRAITS_MEMBER(software_rendering) diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index 06f4645..20ffef0 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -83,13 +83,8 @@ const char kDisableDesktopNotifications[] = "disable-desktop-notifications"; // Disables device orientation events. const char kDisableDeviceOrientation[] = "disable-device-orientation"; -#if defined(OS_ANDROID) -// WebGL is disabled by default on Android. -const char kEnableExperimentalWebGL[] = "enable-webgl"; -#else // Disable experimental WebGL support. const char kDisableExperimentalWebGL[] = "disable-webgl"; -#endif // Blacklist the GPU for accelerated compositing. const char kBlacklistAcceleratedCompositing[] = diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index bbe0d6b..e716e1d 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -38,11 +38,7 @@ CONTENT_EXPORT extern const char kDisableDeviceOrientation[]; #if defined(OS_CHROMEOS) CONTENT_EXPORT extern const char kEnableEncodedScreenCapture[]; #endif -#if defined(OS_ANDROID) -CONTENT_EXPORT extern const char kEnableExperimentalWebGL[]; -#else CONTENT_EXPORT extern const char kDisableExperimentalWebGL[]; -#endif CONTENT_EXPORT extern const char kBlacklistAcceleratedCompositing[]; CONTENT_EXPORT extern const char kBlacklistWebGL[]; extern const char kDisableFileSystem[]; diff --git a/gpu/config/gpu_control_list.cc b/gpu/config/gpu_control_list.cc index b7da59b..5eb09c4 100644 --- a/gpu/config/gpu_control_list.cc +++ b/gpu/config/gpu_control_list.cc @@ -625,6 +625,24 @@ GpuControlList::GpuControlListEntry::GetEntryFromValue( dictionary_entry_count++; } + const base::DictionaryValue* gl_reset_notification_strategy_value = NULL; + if (value->GetDictionary("gl_reset_notification_strategy", + &gl_reset_notification_strategy_value)) { + std::string op; + std::string int_value; + std::string int_value2; + gl_reset_notification_strategy_value->GetString(kOp, &op); + gl_reset_notification_strategy_value->GetString("value", &int_value); + gl_reset_notification_strategy_value->GetString("value2", &int_value2); + if (!entry->SetGLResetNotificationStrategyInfo( + op, int_value, int_value2)) { + LOG(WARNING) << "Malformed gl_reset_notification_strategy entry " + << entry->id(); + return NULL; + } + dictionary_entry_count++; + } + const base::DictionaryValue* cpu_brand_value = NULL; if (value->GetDictionary("cpu_info", &cpu_brand_value)) { std::string cpu_op; @@ -906,6 +924,15 @@ bool GpuControlList::GpuControlListEntry::SetGLExtensionsInfo( return gl_extensions_info_->IsValid(); } +bool GpuControlList::GpuControlListEntry::SetGLResetNotificationStrategyInfo( + const std::string& op, + const std::string& int_string, + const std::string& int_string2) { + gl_reset_notification_strategy_info_.reset( + new IntInfo(op, int_string, int_string2)); + return gl_reset_notification_strategy_info_->IsValid(); +} + bool GpuControlList::GpuControlListEntry::SetCpuBrand( const std::string& cpu_op, const std::string& cpu_value) { @@ -1070,6 +1097,10 @@ bool GpuControlList::GpuControlListEntry::Contains( if (gl_extensions_info_.get() != NULL && !gpu_info.gl_extensions.empty() && !gl_extensions_info_->Contains(gpu_info.gl_extensions)) return false; + if (gl_reset_notification_strategy_info_.get() != NULL && + !gl_reset_notification_strategy_info_->Contains( + gpu_info.gl_reset_notification_strategy)) + return false; if (perf_graphics_info_.get() != NULL && (gpu_info.performance_stats.graphics == 0.0 || !perf_graphics_info_->Contains(gpu_info.performance_stats.graphics))) diff --git a/gpu/config/gpu_control_list.h b/gpu/config/gpu_control_list.h index 3e1f182..62b66ec 100644 --- a/gpu/config/gpu_control_list.h +++ b/gpu/config/gpu_control_list.h @@ -386,6 +386,10 @@ class GPU_EXPORT GpuControlList { bool SetGLExtensionsInfo(const std::string& extensions_op, const std::string& extensions_value); + bool SetGLResetNotificationStrategyInfo(const std::string& op, + const std::string& int_string, + const std::string& int_string2); + bool SetCpuBrand(const std::string& cpu_op, const std::string& cpu_value); @@ -444,6 +448,7 @@ class GPU_EXPORT GpuControlList { scoped_ptr<StringInfo> gl_vendor_info_; scoped_ptr<StringInfo> gl_renderer_info_; scoped_ptr<StringInfo> gl_extensions_info_; + scoped_ptr<IntInfo> gl_reset_notification_strategy_info_; scoped_ptr<StringInfo> cpu_brand_; scoped_ptr<FloatInfo> perf_graphics_info_; scoped_ptr<FloatInfo> perf_gaming_info_; diff --git a/gpu/config/gpu_info.cc b/gpu/config/gpu_info.cc index 0127f02..827c76c 100644 --- a/gpu/config/gpu_info.cc +++ b/gpu/config/gpu_info.cc @@ -19,6 +19,7 @@ GPUInfo::GPUInfo() amd_switchable(false), lenovo_dcute(false), adapter_luid(0), + gl_reset_notification_strategy(0), can_lose_context(false), software_rendering(false), sandboxed(false) { diff --git a/gpu/config/gpu_info.h b/gpu/config/gpu_info.h index 2489850..98ab80c 100644 --- a/gpu/config/gpu_info.h +++ b/gpu/config/gpu_info.h @@ -120,6 +120,10 @@ struct GPU_EXPORT GPUInfo { // GL window system binding extensions. "" if not available. std::string gl_ws_extensions; + // GL reset notification strategy as defined by GL_ARB_robustness. 0 if GPU + // reset detection or notification not available. + uint32 gl_reset_notification_strategy; + // The device semantics, i.e. whether the Vista and Windows 7 specific // semantics are available. bool can_lose_context; diff --git a/gpu/config/gpu_info_collector.cc b/gpu/config/gpu_info_collector.cc index dba8c0b..0bb83dd 100644 --- a/gpu/config/gpu_info_collector.cc +++ b/gpu/config/gpu_info_collector.cc @@ -108,6 +108,14 @@ bool CollectGraphicsInfoGL(GPUInfo* gpu_info) { gpu_info->gl_ws_extensions = window_system_binding_info.extensions; } + bool supports_robustness = + gpu_info->gl_extensions.find("GL_EXT_robustness") != std::string::npos || + gpu_info->gl_extensions.find("GL_ARB_robustness") != std::string::npos; + if (supports_robustness) { + glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, + reinterpret_cast<GLint*>(&gpu_info->gl_reset_notification_strategy)); + } + // TODO(kbr): remove once the destruction of a current context automatically // clears the current context. context->ReleaseCurrent(surface.get()); @@ -135,6 +143,8 @@ void MergeGPUInfoGL(GPUInfo* basic_gpu_info, basic_gpu_info->gl_ws_vendor = context_gpu_info.gl_ws_vendor; basic_gpu_info->gl_ws_version = context_gpu_info.gl_ws_version; basic_gpu_info->gl_ws_extensions = context_gpu_info.gl_ws_extensions; + basic_gpu_info->gl_reset_notification_strategy = + context_gpu_info.gl_reset_notification_strategy; if (!context_gpu_info.driver_vendor.empty()) basic_gpu_info->driver_vendor = context_gpu_info.driver_vendor; diff --git a/gpu/config/software_rendering_list_json.cc b/gpu/config/software_rendering_list_json.cc index d9350f7..8ab8953 100644 --- a/gpu/config/software_rendering_list_json.cc +++ b/gpu/config/software_rendering_list_json.cc @@ -35,27 +35,28 @@ // 10. "gl_vendor" is a STRING structure (defined below). // 11. "gl_renderer" is a STRING structure (defined below). // 12. "gl_extensions" is a STRING structure (defined below). -// 13. "perf_graphics" is a FLOAT structure (defined below). -// 14. "perf_gaming" is a FLOAT structure (defined below). -// 15. "perf_overall" is a FLOAT structure (defined below). -// 16. "machine_model" contais "name" and an optional "version". "name" is a +// 13. "gl_reset_notification_strategy" is an INT structure (defined below). +// 14. "perf_graphics" is a FLOAT structure (defined below). +// 15. "perf_gaming" is a FLOAT structure (defined below). +// 16. "perf_overall" is a FLOAT structure (defined below). +// 17. "machine_model" contais "name" and an optional "version". "name" is a // STRING structure and "version" is a VERSION structure (defined below). -// 17. "gpu_count" is a INT structure (defined below). -// 18 "cpu_info" is a STRING structure (defined below). -// 19. "exceptions" is a list of entries. -// 20. "features" is a list of gpu feature strings, valid values include +// 18. "gpu_count" is a INT structure (defined below). +// 19 "cpu_info" is a STRING structure (defined below). +// 20. "exceptions" is a list of entries. +// 21. "features" is a list of gpu feature strings, valid values include // "accelerated_2d_canvas", "accelerated_compositing", "webgl", // "multisampling", "flash_3d", "flash_stage3d", "texture_sharing", // "accelerated_video", "accelerated_video_decode", "panel_fitting", // "force_compositing_mode", and "all". // This field is mandatory. -// 21. "description" has the description of the entry. -// 22. "webkit_bugs" is an array of associated webkit bug numbers. -// 23. "cr_bugs" is an array of associated webkit bug numbers. -// 24. "browser_version" is a VERSION structure (defined below). If this +// 22. "description" has the description of the entry. +// 23. "webkit_bugs" is an array of associated webkit bug numbers. +// 24. "cr_bugs" is an array of associated webkit bug numbers. +// 25. "browser_version" is a VERSION structure (defined below). If this // condition is not satisfied, the entry will be ignored. If it is not // present, then the entry applies to all versions of the browser. -// 25. "disabled" is a boolean. If it is present, the entry will be skipped. +// 26. "disabled" is a boolean. If it is present, the entry will be skipped. // This can not be used in exceptions. // // VERSION includes "op", "style", "number", and "number2". "op" can be any of @@ -88,7 +89,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST( { "name": "software rendering list", // Please update the version number whenever you change this file. - "version": "6.4", + "version": "6.5", "entries": [ { "id": 1, @@ -1139,6 +1140,24 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST( "features": [ "texture_sharing" ] + }, + { + "id": 76, + "description": "WebGL is disabled on Android unless GPU reset notification is supported", + "os": { + "type": "android" + }, + "exceptions": [ + { + "gl_reset_notification_strategy": { + "op": "=", + "value": "33362" + } + } + ], + "features": [ + "webgl" + ] } ] } |