@@ -193,6 +193,15 @@ this.createjs = this.createjs||{};
193193 * @default 0
194194 **/
195195 this . _drawHeight = 0 ;
196+
197+ /**
198+ * Internal tracking of the last requested bounds, may happen repeadtedly so stored to avoid object creation
199+ * @property _boundRect
200+ * @protected
201+ * @type {Rectangle }
202+ * @default 0
203+ **/
204+ this . _boundRect = new createjs . Rectangle ( ) ;
196205 }
197206 var p = BitmapCache . prototype ;
198207
@@ -401,6 +410,19 @@ this.createjs = this.createjs||{};
401410 return true ;
402411 } ;
403412
413+ /**
414+ * Determine the bounds of the shape in local space.
415+ * @method getBounds
416+ * @returns {Rectangle }
417+ */
418+ p . getBounds = function ( ) {
419+ var scale = this . scale ;
420+ return this . _boundRect . setValue (
421+ this . _filterOffX / scale , this . _filterOffY / scale ,
422+ this . width / scale , this . height / scale
423+ ) ;
424+ } ;
425+
404426// private methods:
405427 /**
406428 * Create or resize the invisible canvas/surface that is needed for the display object(s) to draw to,
@@ -410,8 +432,10 @@ this.createjs = this.createjs||{};
410432 * @protected
411433 **/
412434 p . _updateSurface = function ( ) {
435+ var surface ;
436+
413437 if ( ! this . _options || ! this . _options . useGL ) {
414- var surface = this . target . cacheCanvas ;
438+ surface = this . target . cacheCanvas ;
415439
416440 // create it if it's missing
417441 if ( ! surface ) {
@@ -451,7 +475,7 @@ this.createjs = this.createjs||{};
451475 }
452476
453477 // now size render surfaces
454- var surface = this . target . cacheCanvas ;
478+ surface = this . target . cacheCanvas ;
455479 var stageGL = this . _webGLCache ;
456480
457481 // if we have a dedicated stage we've gotta size it
@@ -483,7 +507,6 @@ this.createjs = this.createjs||{};
483507 var webGL = this . _webGLCache ;
484508
485509 if ( webGL ) {
486- //TODO: auto split blur into an x/y pass
487510 webGL . cacheDraw ( target , target . filters , this ) ;
488511
489512 // we may of swapped around which element the surface is, so we re-fetch it
0 commit comments