cocos2d/cocos2d-html5 — pull request #1534 by csaftoiu (2014-01-30 01:54:16+00:00)
Title: Deep-copy verts in drawPoly for consistency

The WebGL .drawPoly copies the verts parameter in the process of using it internally. I suspect the JSB version does too(?). In any case, I make use of this functionality to optimize a drawing function by always re-using the same set of points, instead of computing a new set each time. This breaks when using the canvas mode. To restore compatibility I propose the canvas version also copies the vertices.

I've also added a drawPoly_ which *doesn't* copy the vertex list - the old behavior - if efficiency is desired. This is parallel to how cc._p re-uses the same point in JSB.

One alternative would be for my code to check whether it's using the canvas version and, if so, to make a copy myself - this is not as neat as the library being consistent, though.