Copyright © 2012 Collabora, Ltd. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the copyright holders not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The copyright holders make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Interface used in the Android wrapper libEGL to share graphics buffers between the server and the client. This creator method initialises the native_handle_t object with everything except the file descriptors, which have to be submitted separately. Pass the Android native_handle_t to the server and attach it to the new wl_buffer object. The android_wlegl_handle object must be destroyed immediately after this request. The Android native_handle_t is a semi-opaque object, that contains an EGL implementation specific number of int32 values and file descriptors. We cannot send a variable size array of file descriptors over the Wayland protocol, so we send them one by one. On creation a server_side_buffer object will immediately send the "buffer_fd" and "buffer_ints" events needed by the client to reference the gralloc buffer, followed by the "buffer" event carrying the wl_buffer object. This event will be sent after the ints and all the fds have been sent Optional metadata sent before the buffer event. The first buffer_fd contains one uncompressed 32-bit RGB plane at byte offset zero. drm_format is its DRM FourCC and stride is its row pitch in bytes. The server has verified the layout and allocation bounds using Android mapper metadata, not inferred them from opaque handle ints. Absence of this event means the layout is unspecified.