Commit deed0fd3 authored by husky@chromium.org's avatar husky@chromium.org

Disable WebGL on Android by default (but allow it to be enabled)

WebGL can run on Android but we need to assess how robust and secure
it is. This patch adds an --enable-experimental-webgl flag to allow
us to run conformance tests on various devices.

BUG=138958
TEST=Manual testing with flag, no change if flag is not used


Review URL: https://chromiumcodereview.appspot.com/10830011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148368 0039d316-1c4b-4281-b951-d872f2087c98
parent dccfc8f1
...@@ -332,7 +332,11 @@ Value* GetFeatureStatus() { ...@@ -332,7 +332,11 @@ Value* GetFeatureStatus() {
{ {
"webgl", "webgl",
flags & content::GPU_FEATURE_TYPE_WEBGL, flags & content::GPU_FEATURE_TYPE_WEBGL,
#if defined(OS_ANDROID)
!command_line.HasSwitch(switches::kEnableExperimentalWebGL),
#else
command_line.HasSwitch(switches::kDisableExperimentalWebGL), command_line.HasSwitch(switches::kDisableExperimentalWebGL),
#endif
"WebGL has been disabled, either via about:flags or command line.", "WebGL has been disabled, either via about:flags or command line.",
false false
}, },
...@@ -577,7 +581,11 @@ void UpdateStats() { ...@@ -577,7 +581,11 @@ void UpdateStats() {
const bool kGpuFeatureUserFlags[] = { const bool kGpuFeatureUserFlags[] = {
command_line.HasSwitch(switches::kDisableAccelerated2dCanvas), command_line.HasSwitch(switches::kDisableAccelerated2dCanvas),
command_line.HasSwitch(switches::kDisableAcceleratedCompositing), command_line.HasSwitch(switches::kDisableAcceleratedCompositing),
#if defined(OS_ANDROID)
!command_line.HasSwitch(switches::kEnableExperimentalWebGL)
#else
command_line.HasSwitch(switches::kDisableExperimentalWebGL) command_line.HasSwitch(switches::kDisableExperimentalWebGL)
#endif
}; };
#if defined(OS_WIN) #if defined(OS_WIN)
const std::string kGpuBlacklistFeatureHistogramNamesWin[] = { const std::string kGpuBlacklistFeatureHistogramNamesWin[] = {
......
...@@ -108,9 +108,6 @@ void SetContentCommandLineFlags(int max_render_process_count, ...@@ -108,9 +108,6 @@ void SetContentCommandLineFlags(int max_render_process_count,
// standalone process. // standalone process.
parsed_command_line->AppendSwitch(switches::kInProcessGPU); parsed_command_line->AppendSwitch(switches::kInProcessGPU);
// Disable WebGL for now (See http://b/5634125)
parsed_command_line->AppendSwitch(switches::kDisableExperimentalWebGL);
// Always use fixed layout and viewport tag. // Always use fixed layout and viewport tag.
parsed_command_line->AppendSwitch(switches::kEnableFixedLayout); parsed_command_line->AppendSwitch(switches::kEnableFixedLayout);
parsed_command_line->AppendSwitch(switches::kEnableViewport); parsed_command_line->AppendSwitch(switches::kEnableViewport);
......
...@@ -164,8 +164,10 @@ void GpuDataManagerImpl::AppendRendererCommandLine( ...@@ -164,8 +164,10 @@ void GpuDataManagerImpl::AppendRendererCommandLine(
uint32 flags = GetGpuFeatureType(); uint32 flags = GetGpuFeatureType();
if ((flags & content::GPU_FEATURE_TYPE_WEBGL)) { if ((flags & content::GPU_FEATURE_TYPE_WEBGL)) {
#if !defined(OS_ANDROID)
if (!command_line->HasSwitch(switches::kDisableExperimentalWebGL)) if (!command_line->HasSwitch(switches::kDisableExperimentalWebGL))
command_line->AppendSwitch(switches::kDisableExperimentalWebGL); command_line->AppendSwitch(switches::kDisableExperimentalWebGL);
#endif
if (!command_line->HasSwitch(switches::kDisablePepper3dForUntrustedUse)) if (!command_line->HasSwitch(switches::kDisablePepper3dForUntrustedUse))
command_line->AppendSwitch(switches::kDisablePepper3dForUntrustedUse); command_line->AppendSwitch(switches::kDisablePepper3dForUntrustedUse);
} }
......
...@@ -434,7 +434,11 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh, ...@@ -434,7 +434,11 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh,
prefs.experimental_webgl_enabled = prefs.experimental_webgl_enabled =
GpuProcessHost::gpu_enabled() && GpuProcessHost::gpu_enabled() &&
!command_line.HasSwitch(switches::kDisable3DAPIs) && !command_line.HasSwitch(switches::kDisable3DAPIs) &&
#if defined(OS_ANDROID)
command_line.HasSwitch(switches::kEnableExperimentalWebGL);
#else
!command_line.HasSwitch(switches::kDisableExperimentalWebGL); !command_line.HasSwitch(switches::kDisableExperimentalWebGL);
#endif
prefs.flash_3d_enabled = prefs.flash_3d_enabled =
GpuProcessHost::gpu_enabled() && GpuProcessHost::gpu_enabled() &&
......
...@@ -86,8 +86,13 @@ const char kDisableDesktopNotifications[] = "disable-desktop-notifications"; ...@@ -86,8 +86,13 @@ const char kDisableDesktopNotifications[] = "disable-desktop-notifications";
// Disables device orientation events. // Disables device orientation events.
const char kDisableDeviceOrientation[] = "disable-device-orientation"; 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. // Disable experimental WebGL support.
const char kDisableExperimentalWebGL[] = "disable-webgl"; const char kDisableExperimentalWebGL[] = "disable-webgl";
#endif
// Blacklist the GPU for accelerated compositing. // Blacklist the GPU for accelerated compositing.
const char kBlacklistAcceleratedCompositing[] = const char kBlacklistAcceleratedCompositing[] =
......
...@@ -37,7 +37,11 @@ extern const char kDisableDataTransferItems[]; ...@@ -37,7 +37,11 @@ extern const char kDisableDataTransferItems[];
CONTENT_EXPORT extern const char kDisableDeferred2dCanvas[]; CONTENT_EXPORT extern const char kDisableDeferred2dCanvas[];
extern const char kDisableDesktopNotifications[]; extern const char kDisableDesktopNotifications[];
CONTENT_EXPORT extern const char kDisableDeviceOrientation[]; CONTENT_EXPORT extern const char kDisableDeviceOrientation[];
#if defined(OS_ANDROID)
CONTENT_EXPORT extern const char kEnableExperimentalWebGL[];
#else
CONTENT_EXPORT extern const char kDisableExperimentalWebGL[]; CONTENT_EXPORT extern const char kDisableExperimentalWebGL[];
#endif
CONTENT_EXPORT extern const char kBlacklistAcceleratedCompositing[]; CONTENT_EXPORT extern const char kBlacklistAcceleratedCompositing[];
CONTENT_EXPORT extern const char kBlacklistWebGL[]; CONTENT_EXPORT extern const char kBlacklistWebGL[];
extern const char kDisableFileSystem[]; extern const char kDisableFileSystem[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment