I am wondering if there is a way to draw filled areas (like a filled polygon) with the Android Canvas without using the Path
class and call canvas.drawPath(...)
.
The reason I want to do this without Path
is because I have to draw very large datasets and canvas.drawPath(...)
is not hardware accelerated and therefore slow.
The performance when using canvas.drawLines(...)
is much better because of hardware acceleration, however I have not found a way to draw the polygon filled using this approach (even when the lines are all connected).
Even calling paint.setStyle(Style.FILL)
did not fill the polygon when using drawLines(...)
.
Is there a way to draw a filled-polygon without using the Path
approach?
Or is there any other way to improve performance using the Canvas
?