1 /**
  2  * The MIT License (MIT)
  3  *
  4  * Copyright (c) 2016 DeNA Co., Ltd.
  5  *
  6  * Permission is hereby granted, free of charge, to any person obtaining a copy
  7  * of this software and associated documentation files (the "Software"), to deal
  8  * in the Software without restriction, including without limitation the rights
  9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 10  * copies of the Software, and to permit persons to whom the Software is
 11  * furnished to do so, subject to the following conditions:
 12  *
 13  * The above copyright notice and this permission notice shall be included in
 14  * all copies or substantial portions of the Software.
 15  *
 16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 22  * SOFTWARE.
 23  */
 24 
 25 /// <reference path="base.js"/>
 26 
 27 /**
 28  * A class that stores global counters internally used for debug.
 29  * @constructor
 30  */
 31 createjs.Counter = function() {
 32 };
 33 
 34 if (createjs.DEBUG) {
 35   /**
 36    * The number of renderer objects in the global cache.
 37    * @type {number}
 38    */
 39   createjs.Counter.cachedRenderers = 0;
 40 
 41   /**
 42    * The total number of renderer objects used by this library.
 43    * @type {number}
 44    */
 45   createjs.Counter.totalRenderers = 0;
 46 
 47   /**
 48    * The number of display objects painted in a rendering cycle.
 49    * @type {number}
 50    */
 51   createjs.Counter.paintedObjects = 0;
 52 
 53   /**
 54    * The number of visible display objects in a rendering cycle.
 55    * @type {number}
 56    */
 57   createjs.Counter.visibleObjects = 0;
 58 
 59   /**
 60    * The total number of display objects in a rendering cycle.
 61    * @type {number}
 62    */
 63   createjs.Counter.totalObjects = 0;
 64 
 65   /**
 66    * The number of tweens updated in a rendering cycle.
 67    * @type {number}
 68    */
 69   createjs.Counter.updatedTweens = 0;
 70 
 71   /**
 72    * The number of tweens running in a rendering cycle.
 73    * @type {number}
 74    */
 75   createjs.Counter.runningTweens = 0;
 76 
 77   /**
 78    * The total number of tweens used by an application.
 79    * @type {number}
 80    */
 81   createjs.Counter.totalTweens = 0;
 82 
 83   /**
 84    * Resets the global variables used by this class.
 85    * @const
 86    */
 87   createjs.Counter.reset = function() {
 88     createjs.Counter.cachedRenderers = 0;
 89     createjs.Counter.totalRenderers = 0;
 90     createjs.Counter.paintedObjects = 0;
 91     createjs.Counter.visibleObjects = 0;
 92     createjs.Counter.totalObjects = 0;
 93     createjs.Counter.updatedTweens = 0;
 94     createjs.Counter.runningTweens = 0;
 95     createjs.Counter.totalTweens = 0;
 96   };
 97 
 98     // Export the createjs.Counter class to the global namespace.
 99   createjs.exportObject('createjs.Counter', createjs.Counter, {});
100 }
101