mirror of
https://github.com/photonstorm/phaser
synced 2025-01-11 12:48:50 +00:00
23 lines
653 B
JavaScript
23 lines
653 B
JavaScript
var TextWebGLRenderer = function (renderer, src, interpolationPercentage, camera)
|
|
{
|
|
if (this.renderMask !== this.renderFlags)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (src.dirty)
|
|
{
|
|
var w = src.canvas.width;
|
|
var h = src.canvas.height;
|
|
var resize = !(src.prevWidth < w || src.prevHeight < h);
|
|
|
|
src.canvasTexture = renderer.uploadCanvasToGPU(src.canvas, src.canvasTexture, resize);
|
|
src.prevWidth = w;
|
|
src.prevHeight = h;
|
|
src.dirty = false;
|
|
}
|
|
|
|
renderer.spriteBatch.addSpriteTexture(src, camera, src.canvasTexture, src.prevWidth, src.prevHeight);
|
|
};
|
|
|
|
module.exports = TextWebGLRenderer;
|