diff --git a/src/platforms/browser/doc.js b/src/platforms/browser/doc.js index 691dafe4..2893e92c 100644 --- a/src/platforms/browser/doc.js +++ b/src/platforms/browser/doc.js @@ -47,7 +47,6 @@ var Document = Class(lib.PubSub, function () { overflow: 'hidden', width: '100%', height: '100%', - transform: 'skewx(0.00001deg)' } }); diff --git a/src/platforms/browser/webgl/WebGLContext2D.js b/src/platforms/browser/webgl/WebGLContext2D.js index 95c5ad79..c9d20bd8 100644 --- a/src/platforms/browser/webgl/WebGLContext2D.js +++ b/src/platforms/browser/webgl/WebGLContext2D.js @@ -140,11 +140,14 @@ var GLManager = Class(function() { this._canvas = document.createElement('canvas'); this._canvas.width = this.width; this._canvas.height = this.height; - this._canvas.getWebGLContext = this._canvas.getContext.bind(this._canvas, 'webgl', { - alpha: true, - premultipliedAlpha: true, - preserveDrawingBuffer: true - }); + + var webGLContextOptions = merge({ premultipliedAlpha: true }, CONFIG.webGLContextOptions, { + alpha: true, + preserveDrawingBuffer: true, + antialias: false + }); + + this._canvas.getWebGLContext = this._canvas.getContext.bind(this._canvas, 'webgl', webGLContextOptions); this._indexCache = new Uint16Array(MAX_BATCH_SIZE * 6); this._vertexCache = new ArrayBuffer(MAX_BATCH_SIZE * STRIDE * 4); diff --git a/src/ui/resource/loader.js b/src/ui/resource/loader.js index ed5a94fd..9de0403a 100644 --- a/src/ui/resource/loader.js +++ b/src/ui/resource/loader.js @@ -418,7 +418,7 @@ var Loader = Class(Emitter, function () { return; } - var next = function (failed) { + var next = bind(this, function (failed) { // If already complete, stub this out if (numLoaded >= numResources) { return; } @@ -440,6 +440,11 @@ var Loader = Class(Emitter, function () { // Call the progress callback with isComplete == true cb && cb(src, failed, true, numLoaded, numResources); + // Emit progress event + this.emit('progress', { + progress: this.progress + }); + // If a timeout was set, clear it if (_timeout) { clearTimeout(_timeout); @@ -452,10 +457,15 @@ var Loader = Class(Emitter, function () { // Call the progress callback with the current progress cb && cb(src, failed, false, numLoaded, numResources); + // Emit progress event + this.emit('progress', { + progress: this.progress + }); + // Restart on next image in list setTimeout(loadResource, 0); } - }; + }); // IF this is the type of resource that has a reload method, if (res.reload && res.complete) {