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

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

Issue 2428383006: Decouple VR Shell DPR and CSS size from Physical Displays. (Closed)
Patch Set: Address cjgrant's comments. Created 4 years, 1 month 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
Index: chrome/browser/resources/vr_shell/vr_shell_ui.js
diff --git a/chrome/browser/resources/vr_shell/vr_shell_ui.js b/chrome/browser/resources/vr_shell/vr_shell_ui.js
index 68e9d935e90b6d19f4362d2e5fb4ecc6de2c6568..1e5d1f243ea29cea1ab6ed558af4dccfd52c6643 100644
--- a/chrome/browser/resources/vr_shell/vr_shell_ui.js
+++ b/chrome/browser/resources/vr_shell/vr_shell_ui.js
@@ -10,7 +10,6 @@ var vrShellUi = (function() {
let uiRootElement = document.querySelector('#ui');
let uiStyle = window.getComputedStyle(uiRootElement);
- let scaleFactor = uiStyle.getPropertyValue('--scaleFactor');
/** @const */ var ANIM_DURATION = 150;
function getStyleFloat(style, property) {
@@ -70,8 +69,7 @@ var vrShellUi = (function() {
let pixelHeight = Math.ceil(rect.bottom) - pixelY;
let element = new api.UiElement(pixelX, pixelY, pixelWidth, pixelHeight);
- element.setSize(scaleFactor * pixelWidth / 1000,
- scaleFactor * pixelHeight / 1000);
+ element.setSize(pixelWidth / 1000, pixelHeight / 1000);
// Pull additional custom properties from CSS.
let style = window.getComputedStyle(domElement);
@@ -414,6 +412,9 @@ var vrShellUi = (function() {
this.controls.setEnabled(mode == api.Mode.STANDARD && !menuMode);
this.omnibox.setEnabled(mode == api.Mode.STANDARD && !menuMode);
this.secureOriginWarnings.setEnabled(mode == api.Mode.WEB_VR);
+
+ let uiElement = document.querySelector('#ui');
bshe 2016/11/30 23:00:46 nit: use uiRootElement directly?
mthiesse 2016/11/30 23:25:05 Done.
+ api.setUiCssSize(uiElement.clientWidth, uiElement.clientHeight, 1.0);
}
setSecureOrigin(secure) {

Powered by Google App Engine
This is Rietveld 408576698