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

Unified Diff: remoting/webapp/client_session.js

Issue 9331003: Improving the decoder pipeline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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
Index: remoting/webapp/client_session.js
diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js
index f1bd19bc730570069e0ded7a92a50f491c2c4bd8..32c2808853667d51668047dc3782ef5ce0aa67b8 100644
--- a/remoting/webapp/client_session.js
+++ b/remoting/webapp/client_session.js
@@ -435,12 +435,20 @@ remoting.ClientSession.prototype.updateDimensions = function() {
var windowWidth = window.innerWidth;
var windowHeight = window.innerHeight;
- var scale = 1.0;
+
+ // Estimate browser scale factor in order to be able to translate logical
+ // pixels on the page into physical pixels on the screen. Scale factor can
+ // be roughly estimated as a ratio between outerWidht and innerWidth of
+ // the document view. The result is not precise because outerWidth can
+ // include pixels allocated for toolbars, window borders and such.
+ var viewInnerWidth = document.defaultView.innerWidth;
+ var viewOuterWidth = document.defaultView.outerWidth;
+ var scale = Math.round(100.0 * viewInnerWidth / viewOuterWidth) / 100.0;
Wez 2012/02/07 01:56:31 This looks like a change from a different CL, so I
if (this.getScaleToFit()) {
- var scaleFitHeight = 1.0 * windowHeight / this.plugin.desktopHeight;
- var scaleFitWidth = 1.0 * windowWidth / this.plugin.desktopWidth;
- scale = Math.min(1.0, scaleFitHeight, scaleFitWidth);
+ var scaledHeight = 1.0 * windowHeight / (scale * this.plugin.desktopHeight);
+ var scaledWidth = 1.0 * windowWidth / (scale * this.plugin.desktopWidth);
+ scale = Math.min(1.0, scaledHeight, scaledWidth, scale);
}
// Resize the plugin if necessary.
« remoting/protocol/content_description.cc ('K') | « remoting/protocol/content_description.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698