@@ -81,7 +81,7 @@ cc.DrawingPrimitiveWebGL = cc.Class.extend(/** @lends cc.DrawingPrimitiveWebGL#
8181 this . lazy_init ( ) ;
8282
8383 var glContext = this . _renderContext ;
84- this . _shader . use ( ) ;
84+ this . _glProgramState . apply ( ) ;
8585 this . _shader . setUniformForModelViewAndProjectionMatrixWithMat4 ( ) ;
8686 glContext . enableVertexAttribArray ( cc . VERTEX_ATTRIB_POSITION ) ;
8787 this . _shader . setUniformLocationWith4fv ( this . _colorLocation , this . _colorArray ) ;
@@ -110,7 +110,7 @@ cc.DrawingPrimitiveWebGL = cc.Class.extend(/** @lends cc.DrawingPrimitiveWebGL#
110110 this . lazy_init ( ) ;
111111
112112 var glContext = this . _renderContext ;
113- this . _shader . use ( ) ;
113+ this . _glProgramState . apply ( ) ;
114114 this . _shader . setUniformForModelViewAndProjectionMatrixWithMat4 ( ) ;
115115 glContext . enableVertexAttribArray ( cc . VERTEX_ATTRIB_POSITION ) ;
116116 this . _shader . setUniformLocationWith4fv ( this . _colorLocation , this . _colorArray ) ;
@@ -145,7 +145,7 @@ cc.DrawingPrimitiveWebGL = cc.Class.extend(/** @lends cc.DrawingPrimitiveWebGL#
145145 this . lazy_init ( ) ;
146146
147147 var glContext = this . _renderContext ;
148- this . _shader . use ( ) ;
148+ this . _glProgramState . apply ( ) ;
149149 this . _shader . setUniformForModelViewAndProjectionMatrixWithMat4 ( ) ;
150150 glContext . enableVertexAttribArray ( cc . VERTEX_ATTRIB_POSITION ) ;
151151 this . _shader . setUniformLocationWith4fv ( this . _colorLocation , this . _colorArray ) ;
@@ -200,7 +200,7 @@ cc.DrawingPrimitiveWebGL = cc.Class.extend(/** @lends cc.DrawingPrimitiveWebGL#
200200 this . lazy_init ( ) ;
201201
202202 var glContext = this . _renderContext ;
203- this . _shader . use ( ) ;
203+ this . _glProgramState . apply ( ) ;
204204 this . _shader . setUniformForModelViewAndProjectionMatrixWithMat4 ( ) ;
205205 glContext . enableVertexAttribArray ( cc . VERTEX_ATTRIB_POSITION ) ;
206206 this . _shader . setUniformLocationWith4fv ( this . _colorLocation , this . _colorArray ) ;
@@ -231,7 +231,7 @@ cc.DrawingPrimitiveWebGL = cc.Class.extend(/** @lends cc.DrawingPrimitiveWebGL#
231231 this . setDrawColor ( color . r , color . g , color . b , color . a ) ;
232232
233233 var glContext = this . _renderContext ;
234- this . _shader . use ( ) ;
234+ this . _glProgramState . apply ( ) ;
235235 this . _shader . setUniformForModelViewAndProjectionMatrixWithMat4 ( ) ;
236236 glContext . enableVertexAttribArray ( cc . VERTEX_ATTRIB_POSITION ) ;
237237 this . _shader . setUniformLocationWith4fv ( this . _colorLocation , this . _colorArray ) ;
@@ -279,7 +279,7 @@ cc.DrawingPrimitiveWebGL = cc.Class.extend(/** @lends cc.DrawingPrimitiveWebGL#
279279 vertices [ ( segments + 1 ) * 2 + 1 ] = center . y ;
280280
281281 var glContext = this . _renderContext ;
282- this . _shader . use ( ) ;
282+ this . _glProgramState . apply ( ) ;
283283 this . _shader . setUniformForModelViewAndProjectionMatrixWithMat4 ( ) ;
284284 glContext . enableVertexAttribArray ( cc . VERTEX_ATTRIB_POSITION ) ;
285285 this . _shader . setUniformLocationWith4fv ( this . _colorLocation , this . _colorArray ) ;
@@ -317,7 +317,7 @@ cc.DrawingPrimitiveWebGL = cc.Class.extend(/** @lends cc.DrawingPrimitiveWebGL#
317317 vertices [ segments * 2 + 1 ] = destination . y ;
318318
319319 var glContext = this . _renderContext ;
320- this . _shader . use ( ) ;
320+ this . _glProgramState . apply ( ) ;
321321 this . _shader . setUniformForModelViewAndProjectionMatrixWithMat4 ( ) ;
322322 glContext . enableVertexAttribArray ( cc . VERTEX_ATTRIB_POSITION ) ;
323323 this . _shader . setUniformLocationWith4fv ( this . _colorLocation , this . _colorArray ) ;
@@ -356,7 +356,7 @@ cc.DrawingPrimitiveWebGL = cc.Class.extend(/** @lends cc.DrawingPrimitiveWebGL#
356356 vertices [ segments * 2 + 1 ] = destination . y ;
357357
358358 var glContext = this . _renderContext ;
359- this . _shader . use ( ) ;
359+ this . _glProgramState . apply ( ) ;
360360 this . _shader . setUniformForModelViewAndProjectionMatrixWithMat4 ( ) ;
361361 glContext . enableVertexAttribArray ( cc . VERTEX_ATTRIB_POSITION ) ;
362362 this . _shader . setUniformLocationWith4fv ( this . _colorLocation , this . _colorArray ) ;
@@ -416,7 +416,7 @@ cc.DrawingPrimitiveWebGL = cc.Class.extend(/** @lends cc.DrawingPrimitiveWebGL#
416416 }
417417
418418 var glContext = this . _renderContext ;
419- this . _shader . use ( ) ;
419+ this . _glProgramState . apply ( ) ;
420420 this . _shader . setUniformForModelViewAndProjectionMatrixWithMat4 ( ) ;
421421 glContext . enableVertexAttribArray ( cc . VERTEX_ATTRIB_POSITION ) ;
422422 this . _shader . setUniformLocationWith4fv ( this . _colorLocation , this . _colorArray ) ;
0 commit comments