Skip to content

Commit fbb67ac

Browse files
committed
The CanvasRenderer.DrawImage function has been removed, as has the associated drawImage property from the Canvas Renderer as they're no longer used.
1 parent 702e738 commit fbb67ac

5 files changed

Lines changed: 9 additions & 156 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ The Tile Sprite Game Object has been given an internal overhaul to make it more
139139
* The `Matrix Stack` Component has been removed. It's no longer used internally and was just wasting space.
140140
* You can now specify the `lineHeight` of a Retro Font in the Retro Font Config object (thanks @FelixNemis)
141141
* When a Static Tilemap Layer is generated in WebGL it will use the Cameras `roundPixels` value to clamp the tile coordinates.
142+
* The `CanvasRenderer.DrawImage` function has been removed, as has the associated `drawImage` property from the Canvas Renderer as they're no longer used.
142143

143144
### Game Config Resolution Specific Bug Fixes
144145

src/renderer/canvas/CanvasRenderer.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ var BlitImage = require('./utils/BlitImage');
99
var CanvasSnapshot = require('../snapshot/CanvasSnapshot');
1010
var Class = require('../../utils/Class');
1111
var CONST = require('../../const');
12-
var DrawImage = require('./utils/DrawImage');
1312
var GetBlendModes = require('./utils/GetBlendModes');
1413
var ScaleModes = require('../ScaleModes');
1514
var Smoothing = require('../../display/canvas/Smoothing');
@@ -130,15 +129,6 @@ var CanvasRenderer = new Class({
130129
*/
131130
this.currentContext = this.gameContext;
132131

133-
/**
134-
* Map to the required function.
135-
*
136-
* @name Phaser.Renderer.Canvas.CanvasRenderer#drawImage
137-
* @type {function}
138-
* @since 3.0.0
139-
*/
140-
this.drawImage = DrawImage;
141-
142132
/**
143133
* [description]
144134
*

src/renderer/canvas/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ module.exports = {
1212

1313
BlitImage: require('./utils/BlitImage'),
1414
CanvasRenderer: require('./CanvasRenderer'),
15-
DrawImage: require('./utils/DrawImage'),
1615
GetBlendModes: require('./utils/GetBlendModes'),
1716
SetTransform: require('./utils/SetTransform')
1817

src/renderer/canvas/utils/DrawImage.js

Lines changed: 0 additions & 137 deletions
This file was deleted.

src/textures/TextureManager.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -935,12 +935,12 @@ var TextureManager = new Class({
935935
// y -= this.sprite.texture.trim.y;
936936
// }
937937

938-
var context = this._tempContext;
938+
var ctx = this._tempContext;
939939

940-
context.clearRect(0, 0, 1, 1);
941-
context.drawImage(source, x, y, 1, 1, 0, 0, 1, 1);
940+
ctx.clearRect(0, 0, 1, 1);
941+
ctx.drawImage(source, x, y, 1, 1, 0, 0, 1, 1);
942942

943-
var rgb = context.getImageData(0, 0, 1, 1);
943+
var rgb = ctx.getImageData(0, 0, 1, 1);
944944

945945
return new Color(rgb.data[0], rgb.data[1], rgb.data[2], rgb.data[3]);
946946
}
@@ -977,12 +977,12 @@ var TextureManager = new Class({
977977
x += textureFrame.cutX;
978978
y += textureFrame.cutY;
979979

980-
var context = this._tempContext;
980+
var ctx = this._tempContext;
981981

982-
context.clearRect(0, 0, 1, 1);
983-
context.drawImage(source, x, y, 1, 1, 0, 0, 1, 1);
982+
ctx.clearRect(0, 0, 1, 1);
983+
ctx.drawImage(source, x, y, 1, 1, 0, 0, 1, 1);
984984

985-
var rgb = context.getImageData(0, 0, 1, 1);
985+
var rgb = ctx.getImageData(0, 0, 1, 1);
986986

987987
return rgb.data[3];
988988
}

0 commit comments

Comments
 (0)