Confirmed users
753
edits
Line 171: | Line 171: | ||
== SurfaceTexture == | == 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. | '''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. | 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 | 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; | * '''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). | * '''queueBuffer''' lets the client indicate that it has finished drawing to a buffer, and queues it (e.g. for compositing). | ||