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.
Canvas
has its own Bitmap
attached to it. Surface
has its own Canvas
attached to it.View
's of window share the same Surface
and thus share the same Canvas
.SurfaceView
is subclass of View
, which, unlike other View
's subclasses and View
itself, has its own Surface
to draw in.There is also one additional question:
Surface
class, if there is already a Canvas
for high-level operations with bitmap. Give an example of a situation where Canvas
is non-suitable for doing work which Surface
can do.