var CONST = require('../const'); var ScaleModes = require('../renderer/ScaleModes'); var IsSizePowerOfTwo = require('../math/pow2/IsSizePowerOfTwo'); var TextureSource = function (texture, source){ this.texture = texture; this.image = source; this.compressionAlgorithm = null ; this.resolution = 1; this.width = source.naturalWidth || source.width || 0; this.height = source.naturalHeight || source.height || 0; this.scaleMode = ScaleModes.DEFAULT; this.premultipliedAlpha = true ; this.mipmapLevel = 0; this.renderable = true ; this.isPowerOf2 = IsSizePowerOfTwo(this.width, this.height); this.glTexture = null ; this.glTextureIndex = 0; this.glLastUsed = 0; this.glDirty = true ; var game = texture.manager.game; if (game.config.renderType === CONST.WEBGL) { game.renderer.createTexture(this); } } ; module.exports = TextureSource;