Is there a detailed explanation of Surface, SurfaceHolder, EGLSurface, SurfaceView, GLSurfaceView, SurfaceTexture, and TextureView? In particular:
A Surface is generally created by or from a consumer of image buffers (such as a SurfaceTexture , MediaRecorder , or Allocation ), and is handed to some kind of producer (such as OpenGL , MediaPlayer , or CameraDevice ) to draw into. Note: A Surface acts like a weak reference to the consumer it is associated with.
Canvas has its own Bitmap attached to it. Surface has its own Canvas attached to it. All 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.
android.view.SurfaceHolder. Abstract interface to someone holding a display surface. Allows you to control the surface size and format, edit the pixels in the surface, and monitor changes to the surface. This interface is typically available through the SurfaceView class.
The answers to these and many other questions can now be found on the Android Open Source Project web site:
Android System-Level Graphics
The document begins with an explanation of the low-level infrastructure, and then explains how the higher-level features are built from them. The goal is not to provide direct answers to common questions, but rather to describe the system at a level of detail that makes the answers apparent without being overwhelming.
The choice of material and level of detail were heavy influenced by Q&A on stackoverflow.
(Technically this is a link-only answer, but writing 10,000 words here seemed like a bad idea.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With