Skip to content

Commit c9de2b5

Browse files
committed
Limit device pixel ratio at 2, to avoid performance penalty in too high resolution
1 parent e80dd1c commit c9de2b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: cocos2d/core/platform/CCEGLView.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ cc.ContainerStrategy = cc.Class.extend(/** @lends cc.ContainerStrategy# */{
900900
// Setup pixel ratio for retina display
901901
var devicePixelRatio = view._devicePixelRatio = 1;
902902
if (view.isRetinaEnabled())
903-
devicePixelRatio = view._devicePixelRatio = window.devicePixelRatio || 1;
903+
devicePixelRatio = view._devicePixelRatio = Math.min(2, window.devicePixelRatio || 1);
904904
// Setup canvas
905905
locCanvasElement.width = w * devicePixelRatio;
906906
locCanvasElement.height = h * devicePixelRatio;

0 commit comments

Comments
 (0)