Skip to content

Commit 60c8eec

Browse files
author
David
committed
Minor code clean up
1 parent 2fede38 commit 60c8eec

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/easeljs/display/DisplayObject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ this.createjs = this.createjs||{};
719719
},
720720
scale: {
721721
get: function() { return this.scaleX; },
722-
set: function(scale) { this.scaleX = this.scaleY = scale; },
722+
set: function(scale) { this.scaleX = this.scaleY = scale; }
723723
}
724724
});
725725
} catch (e) {}

src/easeljs/display/StageGL.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ this.createjs = this.createjs||{};
14791479
var texture = this.getBaseTexture(w, h);
14801480

14811481
if(!texture) {
1482-
msg = "Problem creating texture, possible cause: using too much VRAM, please try releasing texture memory";
1482+
var msg = "Problem creating texture, possible cause: using too much VRAM, please try releasing texture memory";
14831483
(console.error && console.error(msg)) || console.log(msg);
14841484

14851485
texture = this._baseTextures[0];
@@ -1644,16 +1644,16 @@ this.createjs = this.createjs||{};
16441644
*/
16451645
p._createShader = function (gl, type, str) {
16461646
// inject the static number
1647-
str = str.replace(/{{count}}/g, this._batchTextureCount);
1647+
str = str.replace(/\{\{count}}/g, this._batchTextureCount);
16481648

16491649
// resolve issue with no dynamic samplers by creating correct samplers in if else chain
16501650
// TODO: WebGL 2.0 does not need this support
16511651
var insert = "";
16521652
for (var i = 1; i<this._batchTextureCount; i++) {
16531653
insert += "} else if (indexPicker <= "+ i +".5) { color = texture2D(uSampler["+ i +"], vTextureCoord);";
16541654
}
1655-
str = str.replace(/{{alternates}}/g, insert);
1656-
str = str.replace(/{{fragColor}}/g, this._premultiply ? StageGL.REGULAR_FRAG_COLOR_PREMULTIPLY : StageGL.REGULAR_FRAG_COLOR_NORMAL);
1655+
str = str.replace(/\{\{alternates}}/g, insert);
1656+
str = str.replace(/\{\{fragColor}}/g, this._premultiply ? StageGL.REGULAR_FRAG_COLOR_PREMULTIPLY : StageGL.REGULAR_FRAG_COLOR_NORMAL);
16571657

16581658
// actually compile the shader
16591659
var shader = gl.createShader(type);

src/easeljs/filters/BitmapCache.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,10 @@ this.createjs = this.createjs||{};
410410
* @protected
411411
**/
412412
p._updateSurface = function() {
413+
var surface;
414+
413415
if (!this._options || !this._options.useGL) {
414-
var surface = this.target.cacheCanvas;
416+
surface = this.target.cacheCanvas;
415417

416418
// create it if it's missing
417419
if(!surface) {
@@ -451,7 +453,7 @@ this.createjs = this.createjs||{};
451453
}
452454

453455
// now size render surfaces
454-
var surface = this.target.cacheCanvas;
456+
surface = this.target.cacheCanvas;
455457
var stageGL = this._webGLCache;
456458

457459
// if we have a dedicated stage we've gotta size it
@@ -483,7 +485,6 @@ this.createjs = this.createjs||{};
483485
var webGL = this._webGLCache;
484486

485487
if (webGL){
486-
//TODO: auto split blur into an x/y pass
487488
webGL.cacheDraw(target, target.filters, this);
488489

489490
// we may of swapped around which element the surface is, so we re-fetch it

0 commit comments

Comments
 (0)