diff options
author | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-01 19:29:17 +0000 |
---|---|---|
committer | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-01 19:29:17 +0000 |
commit | d239a97eb0202222d14e729002c9f83435f0e04f (patch) | |
tree | a35d063333010b6f267446cfa5f13ca75331d603 | |
parent | 71cdf6bbc73be8c35645d719bcc17f4ef0d8ee64 (diff) | |
download | chromium_src-d239a97eb0202222d14e729002c9f83435f0e04f.zip chromium_src-d239a97eb0202222d14e729002c9f83435f0e04f.tar.gz chromium_src-d239a97eb0202222d14e729002c9f83435f0e04f.tar.bz2 |
Revert 215076 "android: Enable WebGL if context robustess extens..."
> android: Enable WebGL if context robustess extension is supported
>
> If the GL implementation supports the context robustness extension
> (GL_{ARB,EXT}_robustness) and promises to tell us about GPU resets, turn
> on support for WebGL.
>
> This patch also removes the Android-only --enable-webgl command line
> flag. From now on, WebGL support can be forced on with the
> --ignore-gpu-blacklist flag.
>
> BUG=112928
> NOTRY=true
>
> Review URL: https://chromiumcodereview.appspot.com/18696006
TBR=skyostil@chromium.org
Review URL: https://codereview.chromium.org/21615002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215086 0039d316-1c4b-4281-b951-d872f2087c98
-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, 52 insertions, 90 deletions
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 5ab3a04..dff32ea 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -418,11 +418,26 @@ 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, - kOsAll, + kOsDesktop, +#if defined(OS_ANDROID) + SINGLE_VALUE_TYPE("") +#else 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 1bd1f6b..7713cb6 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -157,7 +157,11 @@ 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 0e778c2..cbc2472 100644 --- a/content/browser/gpu/gpu_internals_ui.cc +++ b/content/browser/gpu/gpu_internals_ui.cc @@ -162,10 +162,6 @@ 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); @@ -253,7 +249,11 @@ 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 79f3078..c58653c 100644 --- a/content/browser/gpu/webgl_conformance_test.cc +++ b/content/browser/gpu/webgl_conformance_test.cc @@ -27,6 +27,7 @@ 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 e1a1934..152eceb 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -479,7 +479,11 @@ 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 5749c37..92b73a9 100644 --- a/content/common/gpu/gpu_messages.h +++ b/content/common/gpu/gpu_messages.h @@ -151,7 +151,6 @@ 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 20ffef0..06f4645 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -83,8 +83,13 @@ 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 e716e1d..bbe0d6b 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -38,7 +38,11 @@ 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 5eb09c4..b7da59b 100644 --- a/gpu/config/gpu_control_list.cc +++ b/gpu/config/gpu_control_list.cc @@ -625,24 +625,6 @@ 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; @@ -924,15 +906,6 @@ 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) { @@ -1097,10 +1070,6 @@ 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 62b66ec..3e1f182 100644 --- a/gpu/config/gpu_control_list.h +++ b/gpu/config/gpu_control_list.h @@ -386,10 +386,6 @@ 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); @@ -448,7 +444,6 @@ 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 827c76c..0127f02 100644 --- a/gpu/config/gpu_info.cc +++ b/gpu/config/gpu_info.cc @@ -19,7 +19,6 @@ 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 98ab80c..2489850 100644 --- a/gpu/config/gpu_info.h +++ b/gpu/config/gpu_info.h @@ -120,10 +120,6 @@ 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 0bb83dd..dba8c0b 100644 --- a/gpu/config/gpu_info_collector.cc +++ b/gpu/config/gpu_info_collector.cc @@ -108,14 +108,6 @@ 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()); @@ -143,8 +135,6 @@ 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 8ab8953..d9350f7 100644 --- a/gpu/config/software_rendering_list_json.cc +++ b/gpu/config/software_rendering_list_json.cc @@ -35,28 +35,27 @@ // 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. "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 +// 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 // STRING structure and "version" is a VERSION structure (defined below). -// 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 +// 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 // "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. -// 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 +// 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 // condition is not satisfied, the entry will be ignored. If it is not // present, then the entry applies to all versions of the browser. -// 26. "disabled" is a boolean. If it is present, the entry will be skipped. +// 25. "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 @@ -89,7 +88,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST( { "name": "software rendering list", // Please update the version number whenever you change this file. - "version": "6.5", + "version": "6.4", "entries": [ { "id": 1, @@ -1140,24 +1139,6 @@ 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" - ] } ] } |