Commit c234ff9c authored by xidachen's avatar xidachen Committed by Commit bot

Expose --disable-gpu-compositing browser arg to Blink

Currently in Blink, there is no indication whether a compositor is GPU
accelerated or software. This CL plumbs it to Blink, so that we can
query whether --disable-gpu-compositing or --disable-gpu is set or not.

BUG=650795

Review-Url: https://codereview.chromium.org/2377883002
Cr-Commit-Position: refs/heads/master@{#422672}
parent 77b42df8
......@@ -117,6 +117,12 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (command_line.HasSwitch(switches::kForceDisplayList2dCanvas))
WebRuntimeFeatures::forceDisplayList2dCanvas(true);
if (command_line.HasSwitch(switches::kDisableGpuCompositing) ||
command_line.HasSwitch(switches::kDisableGpu))
WebRuntimeFeatures::enableGpuCompositing(false);
else
WebRuntimeFeatures::enableGpuCompositing(true);
if (command_line.HasSwitch(
switches::kEnableCanvas2dDynamicRenderingModeSwitching))
WebRuntimeFeatures::enableCanvas2dDynamicRenderingModeSwitching(true);
......
......@@ -105,6 +105,7 @@ GamepadExtensions
GeometryInterfaces status=experimental, implied_by=CompositorWorker
GetUserMedia status=stable
GlobalCacheStorage status=stable
GpuCompositing
IDBObserver status=experimental
ImageCapture status=experimental
ImageOrientation status=test
......
......@@ -104,6 +104,10 @@ void WebRuntimeFeatures::enableDisplayList2dCanvas(bool enable) {
RuntimeEnabledFeatures::setDisplayList2dCanvasEnabled(enable);
}
void WebRuntimeFeatures::enableGpuCompositing(bool enable) {
RuntimeEnabledFeatures::setGpuCompositingEnabled(enable);
}
void WebRuntimeFeatures::enableCanvas2dDynamicRenderingModeSwitching(
bool enable) {
RuntimeEnabledFeatures::setEnableCanvas2dDynamicRenderingModeSwitchingEnabled(
......
......@@ -81,6 +81,7 @@ class WebRuntimeFeatures {
BLINK_EXPORT static void enableFeaturePolicy(bool);
BLINK_EXPORT static void enableFileSystem(bool);
BLINK_EXPORT static void enableGamepadExtensions(bool);
BLINK_EXPORT static void enableGpuCompositing(bool);
BLINK_EXPORT static void enableInputMultipleFieldsUI(bool);
BLINK_EXPORT static void enableMediaCapture(bool);
BLINK_EXPORT static void enableMediaDocumentDownloadButton(bool);
......
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