Presents a buffer returned by android_display_import_buffer on the given surface.
Presenting the same buffer object for the same guest resource lets the Android display
stack reuse its per-buffer caches instead of re-importing the buffer on every flip.
Creates an AHardwareBuffer from ahb_info and returns an owned reference to it, or null on
failure. The buffer keeps its own copies of the file descriptors, so ahb_info does not
need to outlive the call. The returned buffer must be released with
android_display_release_buffer.
Constructs an AndroidDisplayContext for this backend. This awlays returns a valid (ex:
non-null) handle to the context. The name parameter is from crosvm commandline and the
client of crosvm will use it to locate and communicate to the AndroidDisplayContext. For
example, this can be a path to UNIX domain socket where a RPC binder server listens on.
error_callback is a function pointer to an error reporting function, and will be used by
this and other functions below when something goes wrong. The returned context should be
destroyed by calling destroy_android_display_context if this backend is no longer in use.
Creates an Android Surface (which is also called as Window) of given size. If the surface
canβt be created for whatever reason, null pointer is returned, in which case we shouldnβt
proceed further.
Obtains one buffer from the given Android Surface. The information about the buffer (buffer
address, size, stride, etc) is reported via the ANativeWindow_Buffer struct. It shouldnβt
be null. The size of the buffer is guaranteed to be bigger than (width * stride * 4) bytes.
This function locks the buffer for the client, which means the caller has the exclusive
access to the buffer until it is returned back to Android display stack (surfaceflinger) by
calling post_android_surface_buffer. This function may fail (in which case false is
returned), then the caller shouldnβt try to read out_buffer or use the buffer in any way.
Posts the buffer obtained from get_android_surface_buffer to the Android display system
so that it can be displayed on the screen. Once this is called, the caller shouldnβt use
the buffer any more.