Skip to content

Commit 1e15012

Browse files
committed
PIXI.CanvasPool has been moved into the Phaser utils folder, and renamed to Phaser.CanvasPool. All references to PIXI.CanvasPool have been updated to match the new namespace.
1 parent 508e5ae commit 1e15012

14 files changed

Lines changed: 206 additions & 21 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
336336
* Phaser.SpriteBatch was incorrectly applying the prototypes, causing the Sprite Batch render methods to be replaced by the normal DisplayObjectContainer ones, meaning nothing was really batched at all. This has now been fixed, and PIXI.SpriteBatch removed, as it's no longer required.
337337
* PIXI.RenderTexture has been removed, and all functionality merged in to Phaser.RenderTexture, to cut down on the number of internal classes and inheritance going on.
338338
* PIXI.TilingSprite has been removed, and all functionality merged in to Phaser.TileSprite, to cut down on the number of internal classes and inheritance going on.
339+
* PIXI.CanvasPool has been moved into the Phaser `utils` folder, and renamed to `Phaser.CanvasPool`. All references to PIXI.CanvasPool have been updated to match the new namespace.
339340

340341
### Bug Fixes
341342

src/gameobjects/BitmapData.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ Phaser.BitmapData.prototype = {
280280

281281
if (this._swapCanvas === undefined)
282282
{
283-
this._swapCanvas = PIXI.CanvasPool.create(this, this.width, this.height);
283+
this._swapCanvas = Phaser.CanvasPool.create(this, this.width, this.height);
284284
}
285285

286286
var c = this._swapCanvas;
@@ -343,7 +343,7 @@ Phaser.BitmapData.prototype = {
343343

344344
if (this._swapCanvas === undefined)
345345
{
346-
this._swapCanvas = PIXI.CanvasPool.create(this, this.width, this.height);
346+
this._swapCanvas = Phaser.CanvasPool.create(this, this.width, this.height);
347347
}
348348

349349
var c = this._swapCanvas;
@@ -2032,7 +2032,7 @@ Phaser.BitmapData.prototype = {
20322032

20332033
this.texture.destroy(true);
20342034

2035-
PIXI.CanvasPool.remove(this);
2035+
Phaser.CanvasPool.remove(this);
20362036

20372037
},
20382038

src/gameobjects/Text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Phaser.Text = function (game, x, y, text, style) {
8383
/**
8484
* @property {HTMLCanvasElement} canvas - The canvas element that the text is rendered.
8585
*/
86-
this.canvas = PIXI.CanvasPool.create(this);
86+
this.canvas = Phaser.CanvasPool.create(this);
8787

8888
/**
8989
* @property {HTMLCanvasElement} context - The context of the canvas element that the text is rendered to.

src/input/Input.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ Phaser.Input.prototype = {
418418

419419
this.activePointer = this.mousePointer;
420420

421-
this.hitCanvas = PIXI.CanvasPool.create(this, 1, 1);
421+
this.hitCanvas = Phaser.CanvasPool.create(this, 1, 1);
422422
this.hitContext = this.hitCanvas.getContext('2d');
423423

424424
this.mouse.start();
@@ -464,7 +464,7 @@ Phaser.Input.prototype = {
464464

465465
this.moveCallbacks = [];
466466

467-
PIXI.CanvasPool.remove(this);
467+
Phaser.CanvasPool.remove(this);
468468

469469
this.game.canvas.removeEventListener('click', this._onClickTrampoline);
470470

src/pixi/renderers/canvas/utils/CanvasBuffer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ PIXI.CanvasBuffer = function(width, height)
3434
* @property canvas
3535
* @type HTMLCanvasElement
3636
*/
37-
this.canvas = PIXI.CanvasPool.create(this, this.width, this.height);
37+
this.canvas = Phaser.CanvasPool.create(this, this.width, this.height);
3838

3939
/**
4040
* A CanvasRenderingContext2D object representing a two-dimensional rendering context.
@@ -82,5 +82,5 @@ PIXI.CanvasBuffer.prototype.resize = function(width, height)
8282
*/
8383
PIXI.CanvasBuffer.prototype.destroy = function()
8484
{
85-
PIXI.CanvasPool.remove(this);
85+
Phaser.CanvasPool.remove(this);
8686
};

src/pixi/renderers/canvas/utils/CanvasTinter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ PIXI.CanvasTinter = function() {};
2121
*/
2222
PIXI.CanvasTinter.getTintedTexture = function(sprite, color)
2323
{
24-
var canvas = sprite.tintedTexture || PIXI.CanvasPool.create(this);
24+
var canvas = sprite.tintedTexture || Phaser.CanvasPool.create(this);
2525

2626
PIXI.CanvasTinter.tintMethod(sprite.texture, color, canvas);
2727

src/pixi/renderers/webgl/WebGLRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ PIXI.WebGLRenderer.prototype.destroy = function()
584584
this.gl = null;
585585
this.renderSession = null;
586586

587-
PIXI.CanvasPool.remove(this);
587+
Phaser.CanvasPool.remove(this);
588588

589589
PIXI.instances[this.glContextId] = null;
590590

src/pixi/textures/BaseTexture.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ PIXI.BaseTexture.prototype.destroy = function()
167167
{
168168
if (this.source)
169169
{
170-
PIXI.CanvasPool.removeByCanvas(this.source);
170+
Phaser.CanvasPool.removeByCanvas(this.source);
171171
}
172172

173173
this.source = null;

src/pixi/utils/Utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ PIXI.canUseNewCanvasBlendModes = function()
4141
var yellow = new Image();
4242
yellow.src = pngHead + '/wCKxvRF' + pngEnd;
4343

44-
var canvas = PIXI.CanvasPool.create(this, 6, 1);
44+
var canvas = Phaser.CanvasPool.create(this, 6, 1);
4545
var context = canvas.getContext('2d');
4646
context.globalCompositeOperation = 'multiply';
4747
context.drawImage(magenta, 0, 0);
@@ -54,7 +54,7 @@ PIXI.canUseNewCanvasBlendModes = function()
5454

5555
var data = context.getImageData(2,0,1,1).data;
5656

57-
PIXI.CanvasPool.remove(this);
57+
Phaser.CanvasPool.remove(this);
5858

5959
return (data[0] === 255 && data[1] === 0 && data[2] === 0);
6060

src/tilemap/TilemapLayer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Phaser.TilemapLayer = function (game, tilemap, index, width, height) {
5656
* @property {HTMLCanvasElement} canvas
5757
* @protected
5858
*/
59-
this.canvas = PIXI.CanvasPool.create(this, width, height);
59+
this.canvas = Phaser.CanvasPool.create(this, width, height);
6060

6161
/**
6262
* The 2d context of the canvas.
@@ -263,7 +263,7 @@ Phaser.TilemapLayer.ensureSharedCopyCanvas = function () {
263263

264264
if (!this.sharedCopyCanvas)
265265
{
266-
this.sharedCopyCanvas = PIXI.CanvasPool.create(this, 2, 2);
266+
this.sharedCopyCanvas = Phaser.CanvasPool.create(this, 2, 2);
267267
}
268268

269269
return this.sharedCopyCanvas;
@@ -355,7 +355,7 @@ Phaser.TilemapLayer.prototype._renderWebGL = function (renderSession) {
355355
*/
356356
Phaser.TilemapLayer.prototype.destroy = function() {
357357

358-
PIXI.CanvasPool.remove(this);
358+
Phaser.CanvasPool.remove(this);
359359

360360
Phaser.Component.Destroy.prototype.destroy.call(this);
361361

0 commit comments

Comments
 (0)