File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -494,18 +494,21 @@ cc.TextureCache = cc.Class.extend(/** @lends cc.TextureCache# */{
494494 cc . log ( "cocos2d: '" + key + "' id=" + selTexture . getHtmlElementObj ( ) . src + " " + selTexture . getPixelsWide ( ) + " x " + selTexture . getPixelsHigh ( ) ) ;
495495 else {
496496 cc . log ( "cocos2d: '" + key + "' id= HTMLCanvasElement " + selTexture . getPixelsWide ( ) + " x " + selTexture . getPixelsHigh ( ) ) ;
497- totalBytes += selTexture . getPixelsWide ( ) * selTexture . getPixelsHigh ( ) * 4 ;
498497 }
498+ totalBytes += selTexture . getPixelsWide ( ) * selTexture . getPixelsHigh ( ) * 4 ;
499499 }
500500
501501 var locTextureColorsCache = this . _textureColorsCache ;
502502 for ( key in locTextureColorsCache ) {
503- var selCanvas = locTextureColorsCache [ key ] ;
504- count ++ ;
505- cc . log ( "cocos2d: '" + key + "' id= HTMLCanvasElement " + selCanvas . getPixelsWide ( ) + " x " + selCanvas . getPixelsHigh ( ) ) ;
506- totalBytes += selCanvas . getPixelsWide ( ) * selCanvas . getPixelsHigh ( ) * 4 ;
507- }
503+ var selCanvasColorsArr = locTextureColorsCache [ key ] ;
504+ for ( var selCanvasKey in selCanvasColorsArr ) {
505+ var selCanvas = selCanvasColorsArr [ selCanvasKey ] ;
506+ count ++ ;
507+ cc . log ( "cocos2d: '" + key + "' id= HTMLCanvasElement " + selCanvas . width + " x " + selCanvas . height ) ;
508+ totalBytes += selCanvas . width * selCanvas . height * 4 ;
509+ }
508510
511+ }
509512 cc . log ( "cocos2d: TextureCache dumpDebugInfo: " + count + " textures, HTMLCanvasElement for "
510513 + ( totalBytes / 1024 ) + " KB (" + ( totalBytes / ( 1024.0 * 1024.0 ) ) . toFixed ( 2 ) + " MB)" ) ;
511514 }
You can’t perform that action at this time.
0 commit comments