Drawing bunch of rotated rectangles on android canvas
<p>I have a task to draw many rectangles on canvas, but all of them have a rotation angle by which they have to be rotated on canvas. Many of suggestions I ran into while searching for solution of this problem indicated the way to draw a rectangle and rotate the canvas (Canvas.rotate(angle)), but it rotates all canvas and is only possible with one rectangle. What could be the best way to draw many of rotated rectangles on canvas? I want to draw rectangles (single color, with Paint), but not bitmaps, due to time efficiency and memory.</p>

<p>The primary way I would do currently is creating a load of canvases and drawing one rectangle on each of them and rotating canvases considering the angle of rectangles. I think that it is not a smart way due to many canvases and for each of them I should create a separate <code>SurfaceHolder</code> and it is a mess... </p>

<p>Note that for each rectangle I have coordinates of all of its 4 corners, its width, height, center, angle.</p>