diff --git a/cocos/core/game.js b/cocos/core/game.js index 7c91fcd2dc..593cbe92bc 100644 --- a/cocos/core/game.js +++ b/cocos/core/game.js @@ -698,12 +698,15 @@ class Game extends EventTarget { this._gfxDevice = new cc.WebGLGFXDevice(); } + const nativeWidth = parseInt(screen.width * window.devicePixelRatio); + const nativeHeight = parseInt(screen.height * window.devicePixelRatio); + this._gfxDevice.initialize({ canvasElm: localCanvas, debug: true, devicePixelRatio: window.devicePixelRatio, - nativeWidth: screen.width * window.devicePixelRatio, - nativeHeight: screen.height * window.devicePixelRatio, + nativeWidth, + nativeHeight, }); } diff --git a/cocos/core/platform/CCView.js b/cocos/core/platform/CCView.js index 70ed300bbc..a8071d656e 100644 --- a/cocos/core/platform/CCView.js +++ b/cocos/core/platform/CCView.js @@ -219,8 +219,6 @@ class View extends EventTarget { if (width > 0) view.setDesignResolutionSize(width, height, view._resolutionPolicy); - // cc.director.root.resize(cc.winSize.width, cc.winSize.height); - view._resizing = false; view.emit('canvas-resize'); @@ -559,6 +557,9 @@ class View extends EventTarget { // canvas.width = width * this._devicePixelRatio; // canvas.height = height * this._devicePixelRatio; + canvas.width = width; + canvas.height = height; + canvas.style.width = width + 'px'; canvas.style.height = height + 'px'; diff --git a/cocos/pipeline/render-pipeline.ts b/cocos/pipeline/render-pipeline.ts index f72a964d6d..1a1c59bbef 100644 --- a/cocos/pipeline/render-pipeline.ts +++ b/cocos/pipeline/render-pipeline.ts @@ -218,7 +218,7 @@ export abstract class RenderPipeline { if (width * this._shadingScale > this._shadingWidth || height * this._shadingScale > this._shadingHeight) { this._shadingScale = Math.min(this._shadingWidth / width, this._shadingHeight / height); - console.info('SHADING_SCALE: ' + this._shadingScale); + console.info('SHADING_SCALE: ' + this._shadingScale.toFixed(4)); } for (const flow of this._flows) { @@ -365,7 +365,7 @@ export abstract class RenderPipeline { console.info('USE_SMAA: ' + this._useSMAA); console.info('CC_USE_HDR: ' + this._isHDR); console.info('SHADING_SIZE: ' + this._shadingWidth + ' x ' + this._shadingHeight); - console.info('SHADING_SCALE: ' + this._shadingScale.toFixed(2)); + console.info('SHADING_SCALE: ' + this._shadingScale.toFixed(4)); console.info('SHADING_COLOR_FORMAT: ' + GFXFormatInfos[this._colorFmt].name); console.info('SHADING_DEPTH_FORMAT: ' + GFXFormatInfos[this._depthStencilFmt].name);