File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 36
36
- added a shared createjs.deprecate() method, which wraps old methods and property getter/setters to display
37
37
a console warning when used.
38
38
- added a DeprecatedMethods unit test
39
+ - fixed minor issues with webgl/benchmark demo
39
40
40
41
41
42
Version 0.8.2 [November 26, 2015]
Original file line number Diff line number Diff line change 168
168
examples . hideDistractor ( ) ;
169
169
}
170
170
171
+ // because of the significance of some variables that might change, restart anew when major properties change
171
172
function init ( ) {
172
173
if ( ! isReady ) { return ; }
173
174
176
177
canvas . parentNode . removeChild ( canvas ) ;
177
178
}
178
179
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 ) ;
180
183
}
181
184
182
185
// make new stages and canvases
183
186
canvas = document . createElement ( "canvas" ) ;
184
187
canvas . width = CANVAS_WIDTH ;
185
188
canvas . height = CANVAS_HEIGHT ;
186
189
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 } ) ;
188
192
stage . setClearColor ( 0x000000 ) ;
189
193
} else {
190
194
stage = new createjs . Stage ( canvas ) ;
191
195
}
192
196
container = new createjs . Container ( ) ;
193
197
stage . addChild ( container ) ;
194
198
195
-
196
199
// insert to DOM
197
200
outDOM . insertBefore ( canvas , document . getElementById ( "stats" ) ) ;
198
201
}
You can’t perform that action at this time.
0 commit comments