@@ -13,7 +13,7 @@ var CanvasRenderer = function (game)
1313 // Needed?
1414 this . type = CONST . CANVAS ;
1515
16- // Read all the following from game config
16+ // Read all the following from game config (or State config?)
1717 this . clearBeforeRender = true ;
1818
1919 this . transparent = false ;
@@ -50,10 +50,6 @@ var CanvasRenderer = function (game)
5050 this . currentBlendMode = 0 ;
5151 this . currentScaleMode = 0 ;
5252
53- this . startTime = 0 ;
54- this . endTime = 0 ;
55- this . drawCount = 0 ;
56-
5753 // this.tintMethod = this.tintWithPerPixel;
5854
5955 this . init ( ) ;
@@ -86,7 +82,7 @@ CanvasRenderer.prototype = {
8682
8783 // if (this.smoothProperty)
8884 // {
89- // this.context[this.smoothProperty] = (this.scaleMode === Phaser.scaleModes .LINEAR);
85+ // this.context[this.smoothProperty] = (this.scaleMode === ScaleModes .LINEAR);
9086 // }
9187 } ,
9288
@@ -109,38 +105,32 @@ CanvasRenderer.prototype = {
109105
110106 // TODO: A State should have the option of having its own canvas to draw to
111107
112- this . startTime = Date . now ( ) ;
113-
114108 ctx . setTransform ( 1 , 0 , 0 , 1 , 0 , 0 ) ;
115109
116110 // If the alpha or blend mode didn't change since the last render, then don't set them again (saves 2 ops)
117111
118112 if ( this . currentAlpha !== 1 )
119113 {
120114 ctx . globalAlpha = 1 ;
115+ this . currentAlpha = 1 ;
121116 }
122117
123118 if ( this . currentBlendMode !== 0 )
124119 {
125120 ctx . globalCompositeOperation = 'source-over' ;
121+ this . currentBlendMode = 0 ;
126122 }
127123
128- this . currentBlendMode = 0 ;
129124 this . currentScaleMode = 0 ;
130- this . currentAlpha = 1 ;
131125
132126 if ( this . clearBeforeRender )
133127 {
134128 ctx . clearRect ( 0 , 0 , this . width , this . height ) ;
135129 }
136130
137- this . drawCount = 0 ;
138-
139131 // Could move to the State Systems or MainLoop
140132 this . game . state . renderChildren ( this , state , interpolationPercentage ) ;
141133
142- this . endTime = Date . now ( ) ;
143-
144134 // console.log('%c render end ', 'color: #ffffff; background: #ff0000;');
145135
146136 // Add Post-render hook
0 commit comments