Skip to content

Commit

Permalink
Honor windows.devicePixelRatio by default
Browse files Browse the repository at this point in the history
Cesium now honors `window.devicePixelRatio` by default, which greatly
improving performance on mobile devices and high DPI displays by rendering
at the browser-recommended resolution.

This change also decreases bandwidth usage because we request far fewer
tiles when rendering at lower resolutions.
  • Loading branch information
mramato committed Nov 21, 2015
1 parent 06be660 commit 0e788d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -33,6 +33,7 @@ Change Log
* Added `createOpenStreetMapImageryProvider` function to replace the `OpenStreetMapImageryProvider` class. This function returns a constructed `UrlTemplateImageryProvider`.
* Fixed an issue with tile selection when below the surface of the ellipsoid. [#3170](https://github.com/AnalyticalGraphicsInc/cesium/issues/3170)
* Fixed an issue with loading skeletons for skinned glTF models. [#3224](https://github.com/AnalyticalGraphicsInc/cesium/pull/3224)
* Cesium now honors `window.devicePixelRatio` by default, which greatly improving performance on mobile devices and high DPI displays by rendering at the browser-recommended resolution. To use the previous behavior, set `Viewer.resolutionScale` to `window.devicePixelRatio`.

### 1.15 - 2015-11-02

Expand Down
2 changes: 1 addition & 1 deletion Source/Widgets/CesiumWidget/CesiumWidget.js
Expand Up @@ -98,7 +98,7 @@ define([
var canvas = widget._canvas;
var width = canvas.clientWidth;
var height = canvas.clientHeight;
var zoomFactor = defaultValue(window.devicePixelRatio, 1.0) * widget._resolutionScale;
var zoomFactor = (1.0 / defaultValue(window.devicePixelRatio, 1.0)) * widget._resolutionScale;

widget._canvasWidth = width;
widget._canvasHeight = height;
Expand Down

0 comments on commit 0e788d1

Please sign in to comment.