File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636- added a shared createjs.deprecate() method, which wraps old methods and property getter/setters to display
3737 a console warning when used.
3838- added a DeprecatedMethods unit test
39+ - fixed minor issues with webgl/benchmark demo
3940
4041
4142Version 0.8.2 [November 26, 2015]
Original file line number Diff line number Diff line change 168168 examples . hideDistractor ( ) ;
169169 }
170170
171+ // because of the significance of some variables that might change, restart anew when major properties change
171172 function init ( ) {
172173 if ( ! isReady ) { return ; }
173174
176177 canvas . parentNode . removeChild ( canvas ) ;
177178 }
178179 if ( stage && stage . releaseTexture ) {
179- stage . releaseTexture ( cjsSprites . spriteSheet . _images [ 0 ] ) ; // CJS cleanup for multi stage-use
180+ // As we're removing the old canvas, we have to clean up, this allows us to use the images on a new canvas.
181+ // Each canvas has a new WebGL context (by necessity) and images can't be shared between contexts.
182+ stage . releaseTexture ( stage ) ;
180183 }
181184
182185 // make new stages and canvases
183186 canvas = document . createElement ( "canvas" ) ;
184187 canvas . width = CANVAS_WIDTH ;
185188 canvas . height = CANVAS_HEIGHT ;
186189 if ( guiProps . allowWebGL ) {
187- stage = new createjs . StageGL ( canvas , { transparent : false , autoPurge : - 1 } ) ;
190+ // we know we wont be unloading textures, so turn off the cleanup routine to get maximum speed
191+ stage = new createjs . StageGL ( canvas , { autoPurge : - 1 } ) ;
188192 stage . setClearColor ( 0x000000 ) ;
189193 } else {
190194 stage = new createjs . Stage ( canvas ) ;
191195 }
192196 container = new createjs . Container ( ) ;
193197 stage . addChild ( container ) ;
194198
195-
196199 // insert to DOM
197200 outDOM . insertBefore ( canvas , document . getElementById ( "stats" ) ) ;
198201 }
You can’t perform that action at this time.
0 commit comments