Done.
Description:
Add "WebVR experimental rendering optimizations" flag
This is intended to support features such as direct-draw-to-surface
which are considered experimental or risky, so that they can be
manually enabled for initial testing. It is also in preparation
for a finch experiment for future rollout.
BUG=655733
Affected files (+21, -0 lines):
M chrome/app/generated_resources.grd
M chrome/browser/about_flags.cc
M content/public/common/content_features.h
M content/public/common/content_features.cc
M content/public/common/content_switches.h
M content/public/common/content_switches.cc
M tools/metrics/histograms/histograms.xml
Index: chrome/app/generated_resources.grd
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index ce15d8ea301fb9ea4c56a5fbe9d532e85d16ec75..29eb3c7bac88e8617d4793bb1f913753ac4e45be 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -5504,6 +5504,12 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_FLAGS_WEBVR_DESCRIPTION" desc="Description for the flag to enable WebVR APIs.">
Enabling this option allows web applications to access experimental Virtual Reality APIs.
</message>
+ <message name="IDS_FLAGS_WEBVR_EXPERIMENTAL_RENDERING_NAME" desc="Name of the 'Enable WebVR experimental optimizations' flag.">
+ WebVR experimental rendering optimizations
+ </message>
+ <message name="IDS_FLAGS_WEBVR_EXPERIMENTAL_RENDERING_DESCRIPTION" desc="Description for the flag to enable experimental WebVR rendering optimizations.">
+ Enabling this option activates experimental rendering path optimizations for WebVR.
+ </message>
<message name="IDS_FLAGS_GAMEPAD_EXTENSIONS_NAME" desc="Name of the flag which allows users to enable experimental extensions to the Gamepad API.">
Gamepad Extensions
</message>
Index: chrome/browser/about_flags.cc
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 855e4aeb2525d3ee4ec4a44977032db4c0971cd0..a01de4d6ba0fe286faf318e4c9c26add0e16d311 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1612,6 +1612,10 @@ const FeatureEntry kFeatureEntries[] = {
{"enable-webvr", IDS_FLAGS_WEBVR_NAME, IDS_FLAGS_WEBVR_DESCRIPTION, kOsAll,
SINGLE_VALUE_TYPE(switches::kEnableWebVR)},
#if defined(ENABLE_WEBVR)
+ {"enable-webvr-experimental-rendering",
+ IDS_FLAGS_WEBVR_EXPERIMENTAL_RENDERING_NAME,
+ IDS_FLAGS_WEBVR_EXPERIMENTAL_RENDERING_DESCRIPTION, kOsAll,
+ SINGLE_VALUE_TYPE(switches::kEnableWebVRExperimentalRendering)},
{"enable-vr-shell", IDS_FLAGS_ENABLE_VR_SHELL_NAME,
IDS_FLAGS_ENABLE_VR_SHELL_DESCRIPTION, kOsAndroid,
FEATURE_VALUE_TYPE(features::kVrShell)},
Index: content/public/common/content_features.cc
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
index e9a64b515cdcca10ad73e2aaf61da1c77ad5ffef..d9be0ee08fd1ec4e2e58ce2b50d1c1d11a013df7 100644
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -253,6 +253,10 @@ const base::Feature kWebRtcHWH264Encoding{
//
https://wicg.github.io/webusb const base::Feature kWebUsb{"WebUSB", base::FEATURE_ENABLED_BY_DEFAULT};
+// Enables WebVR experimental rendering optimizations.
+const base::Feature kWebVrExperimentalRendering{
+ "WebVrExperimentalRendering", base::FEATURE_DISABLED_BY_DEFAULT};
+
// Make sendBeacon throw for a Blob with a non simple type.
const base::Feature kSendBeaconThrowForBlobWithNonSimpleType{
"SendBeaconThrowForBlobWithNonSimpleType",
Index: content/public/common/content_features.h
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h
index 359a95152ef08c00415f7b88dc65c689dd054337..9ecc990641fd72ea7274fa3acde829627f9cf37d 100644
--- a/content/public/common/content_features.h
+++ b/content/public/common/content_features.h
@@ -67,6 +67,7 @@ CONTENT_EXPORT extern const base::Feature kWebRtcEcdsaDefault;
CONTENT_EXPORT extern const base::Feature kWebRtcHWH264Encoding;
CONTENT_EXPORT extern const base::Feature kWebRtcUseGpuMemoryBufferVideoFrames;
CONTENT_EXPORT extern const base::Feature kWebUsb;
+CONTENT_EXPORT extern const base::Feature kWebVrExperimentalRendering;
CONTENT_EXPORT
extern const base::Feature kSendBeaconThrowForBlobWithNonSimpleType;
Index: content/public/common/content_switches.cc
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index 5a7fb6c3ce1de82f7a5aa354cf16963b46e88cdd..43531c6afa5deb558d4bc2285ab145afaa4093e8 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -535,6 +535,10 @@ const char kEnableWebGLImageChromium[] = "enable-webgl-image-chromium";
// Enables interaction with virtual reality devices.
const char kEnableWebVR[] = "enable-webvr";
+// Enables experimental rendering optimizations for WebVR.
+const char kEnableWebVRExperimentalRendering[] =
+ "enable-webvr-experimental-rendering";
+
// Enable rasterizer that writes directly to GPU memory associated with tiles.
const char kEnableZeroCopy[] = "enable-zero-copy";
Index: content/public/common/content_switches.h
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index 5c4f9a5a78344c1e7b3922c0fa76b86a85190dbc..210899be821ed22728df968b69238e780347d4dd 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -163,6 +163,7 @@ CONTENT_EXPORT extern const char kEnableWebFontsInterventionTrigger[];
CONTENT_EXPORT extern const char kEnableWebGLDraftExtensions[];
CONTENT_EXPORT extern const char kEnableWebGLImageChromium[];
CONTENT_EXPORT extern const char kEnableWebVR[];
+CONTENT_EXPORT extern const char kEnableWebVRExperimentalRendering[];
CONTENT_EXPORT extern const char kEnableZeroCopy[];
CONTENT_EXPORT extern const char kExplicitlyAllowedPorts[];
CONTENT_EXPORT extern const char kFieldTrialHandle[];
Index: tools/metrics/histograms/histograms.xml
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index da838472d9a1087a76b4e814fe3e83dfa9de6dc7..b9548b02d88964f9e913ab3d3066bf68b007f5d7 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -96713,6 +96713,7 @@ value.
<int value="-1478876902" label="disable-permission-action-reporting"/>
<int value="-1473668019" label="token-binding:disabled"/>
<int value="-1473136627" label="enable-web-payments"/>
+ <int value="-1473098749" label="enable-webvr-experimental-rendering"/>
<int value="-1467332609" label="tab-management-experiment-type-anise"/>
<int value="-1466990325" label="CrosCompUpdates:enabled"/>
<int value="-1460462432" label="disable-media-source"/>