Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2432)

Unified Diff: chrome/browser/resources/vr_shell/vr_shell_ui_scene.js

Issue 2749703007: Add menu mode plumbing for WebVR mode. (Closed)
Patch Set: Rename JS WebVR rendering functions for clarity. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/vr_shell/vr_shell_ui_api.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/vr_shell/vr_shell_ui_scene.js
diff --git a/chrome/browser/resources/vr_shell/vr_shell_ui_scene.js b/chrome/browser/resources/vr_shell/vr_shell_ui_scene.js
index 4ed691a93cc894c83b28809237952bf18e246741..1040382a066f676e10f19bc5b0a0957dc2021f22 100644
--- a/chrome/browser/resources/vr_shell/vr_shell_ui_scene.js
+++ b/chrome/browser/resources/vr_shell/vr_shell_ui_scene.js
@@ -130,23 +130,41 @@ scene.Scene = class {
}
/**
- * Set the background color of the scene.
+ * Configure scene parameters.
+ * @param {api.SceneConfiguration} configuration
+ */
+ configureScene(configuration) {
+ this.commands.push({
+ 'type': api.Command.CONFIGURE_SCENE,
+ 'data': configuration.getCommandPayload(),
+ });
+ }
+
+ /**
* @param {{r: number, b: number, g: number, a: number}} color
*/
setBackgroundColor(color) {
- this.commands.push(
- {'type': api.Command.UPDATE_BACKGROUND, 'data': {'color': color}});
+ let configuration = new api.SceneConfiguration();
+ configuration.setBackgroundColor(color);
+ this.configureScene(configuration);
}
/**
- * Set the radius of background-bounding sphere.
* @param {number} distance
*/
setBackgroundDistance(distance) {
- this.commands.push({
- 'type': api.Command.UPDATE_BACKGROUND,
- 'data': {'distance': distance}
- });
+ let configuration = new api.SceneConfiguration();
+ configuration.setBackgroundDistance(distance);
+ this.configureScene(configuration);
+ }
+
+ /**
+ * @param {boolean} enabled
+ */
+ setWebVrRenderingModeEnabled(enabled) {
+ let configuration = new api.SceneConfiguration();
+ configuration.setWebVrRenderingModeEnabled(enabled);
+ this.configureScene(configuration);
}
/**
« no previous file with comments | « chrome/browser/resources/vr_shell/vr_shell_ui_api.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698