== SurfaceTexture ==
'''SurfaceTexture ''' is the server side of a client-server system, whose client side is '''SurfaceTextureClient'''. As explained above, SurfaceTextureClient is a concrete implementation of ANativeWindow.
The reason to use a client-server system like this is to allow producing and compositing a surface in two different processes.
Let us introduce two important functions that a client needs to call on its ANativeWindow: dequeueBuffer and queueBuffer
* '''dequeueBuffer ''' acquires a new buffer for the client to draw to;* '''queueBuffer ''' lets the client indicate that it has finished drawing to a buffer, and queues it (e.g. for compositing).