I'm struggling to understand the process of drawing to SurfaceView and therefore the whole Surface/Canvas/Bitmap system, which is used in Android.
I've read all articles and API documentation pages, which I was able to find on android-developers site, a few tutorials of android graphics, LunarLander source code and this question.
Please tell me, which of these statements are true, which are not, and why.
Canvashas its ownBitmapattached to it.Surfacehas its ownCanvasattached to it.- All
View's of window share the sameSurfaceand thus share the sameCanvas. SurfaceViewis subclass ofView, which, unlike otherView's subclasses andViewitself, has its ownSurfaceto draw in.
There is also one additional question:
- Why is there a need for a
Surfaceclass, if there is already aCanvasfor high-level operations with bitmap. Give an example of a situation whereCanvasis non-suitable for doing work whichSurfacecan do.
