Skip to content

Commit dd0010a

Browse files
author
David Gillen
committed
Merge branch 'BlendModes'
2 parents b73d6b2 + ee2f616 commit dd0010a

8 files changed

Lines changed: 1434 additions & 785 deletions

File tree

src/easeljs/display/Container.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,4 +705,4 @@ this.createjs = this.createjs||{};
705705

706706

707707
createjs.Container = createjs.promote(Container, "DisplayObject");
708-
}());
708+
}());

src/easeljs/display/DisplayObject.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ this.createjs = this.createjs||{};
153153
* If a cache is active, this returns the canvas that holds the image of this display object. See {{#crossLink "DisplayObject/cache:method"}}{{/crossLink}}
154154
* for more information. Use this to display the result of a cache. This will be a HTMLCanvasElement unless special cache rules have been deliberately enabled for this cache.
155155
* @property cacheCanvas
156-
* @type {HTMLCanvasElement | Object}
156+
* @type {HTMLCanvasElement | WebGLTexture | Object}
157157
* @default null
158158
* @readonly
159159
**/
@@ -457,6 +457,15 @@ this.createjs = this.createjs||{};
457457
* @default 0
458458
*/
459459
this._webGLRenderStyle = DisplayObject._StageGL_NONE;
460+
461+
/**
462+
* Storage for the calculated position of an object in StageGL. If not using StageGL, you can null it to save memory.
463+
* @property _glMtx
464+
* @protected
465+
* @type {Matrix2D}
466+
* @default null
467+
*/
468+
this._glMtx = new createjs.Matrix2D();
460469
}
461470
var p = createjs.extend(DisplayObject, createjs.EventDispatcher);
462471

@@ -751,7 +760,7 @@ this.createjs = this.createjs||{};
751760
**/
752761
p.draw = function(ctx, ignoreCache) {
753762
var cache = this.bitmapCache;
754-
if(cache && !ignoreCache) {
763+
if (cache && !ignoreCache) {
755764
return cache.draw(ctx);
756765
}
757766
return false;
@@ -826,8 +835,10 @@ this.createjs = this.createjs||{};
826835
* @param {Object} [options=undefined] Specify additional parameters for the cache logic
827836
**/
828837
p.cache = function(x, y, width, height, scale, options) {
829-
if(!this.bitmapCache){
838+
if (!this.bitmapCache){
830839
this.bitmapCache = new createjs.BitmapCache();
840+
} else {
841+
this.bitmapCache._autoGenerated = false;
831842
}
832843
this.bitmapCache.define(this, x, y, width, height, scale, options);
833844
};
@@ -855,7 +866,7 @@ this.createjs = this.createjs||{};
855866
* whatwg spec on compositing</a>.
856867
**/
857868
p.updateCache = function(compositeOperation) {
858-
if(!this.bitmapCache) {
869+
if (!this.bitmapCache) {
859870
throw "cache() must be called before updateCache()";
860871
}
861872
this.bitmapCache.update(compositeOperation);
@@ -866,7 +877,7 @@ this.createjs = this.createjs||{};
866877
* @method uncache
867878
**/
868879
p.uncache = function() {
869-
if(this.bitmapCache) {
880+
if (this.bitmapCache) {
870881
this.bitmapCache.release();
871882
this.bitmapCache = undefined;
872883
}
@@ -996,8 +1007,9 @@ this.createjs = this.createjs||{};
9961007
* @return {Matrix2D} A matrix representing this display object's transform.
9971008
**/
9981009
p.getMatrix = function(matrix) {
999-
var o = this, mtx = matrix&&matrix.identity() || new createjs.Matrix2D();
1000-
return o.transformMatrix ? mtx.copy(o.transformMatrix) : mtx.appendTransform(o.x, o.y, o.scaleX, o.scaleY, o.rotation, o.skewX, o.skewY, o.regX, o.regY);
1010+
var o = this, mtx = matrix || new createjs.Matrix2D();
1011+
return o.transformMatrix ? mtx.copy(o.transformMatrix) :
1012+
(mtx.identity() && mtx.appendTransform(o.x, o.y, o.scaleX, o.scaleY, o.rotation, o.skewX, o.skewY, o.regX, o.regY));
10011013
};
10021014

10031015
/**
@@ -1254,6 +1266,7 @@ this.createjs = this.createjs||{};
12541266
o.hitArea = this.hitArea;
12551267
o.cursor = this.cursor;
12561268
o._bounds = this._bounds;
1269+
o._webGLRenderStyle = this._webGLRenderStyle;
12571270
return o;
12581271
};
12591272

0 commit comments

Comments
 (0)