Struct wayland_client::wayland::shm::WlShmPool [] [src]

pub struct WlShmPool {
    // some fields omitted
}

a shared memory pool

The wl_shm_pool object encapsulates a piece of memory shared between the compositor and client. Through the wl_shm_pool object, the client can allocate shared memory wl_buffer objects. All objects created through the same pool share the same underlying mapped memory. Reusing the mapped memory avoids the setup/teardown overhead and is useful when interactively resizing a surface or for many small buffers.

Methods

impl WlShmPool
[src]

fn create_buffer(&self, offset: i32, width: i32, height: i32, stride: i32, format: u32) -> WlBuffer

create a buffer from the pool

Create a wl_buffer object from the pool.

The buffer is created offset bytes into the pool and has width and height as specified. The stride arguments specifies the number of bytes from beginning of one row to the beginning of the next. The format is the pixel format of the buffer and must be one of those advertised through the wl_shm.format event.

A buffer will keep a reference to the pool it was created from so it is valid to destroy the pool immediately after creating a buffer from it.

fn destroy(self)

destroy the pool

Destroy the shared memory pool.

The mmapped memory will be released when all buffers that have been created from this pool are gone.

fn resize(&self, size: i32)

change the size of the pool mapping

This request will cause the server to remap the backing memory for the pool from the file descriptor passed when the pool was created, but using the new size. This request can only be used to make the pool bigger.

Trait Implementations

impl Sync for WlShmPool
[src]

impl Send for WlShmPool
[src]

impl Proxy for WlShmPool
[src]

fn ptr(&self) -> *mut wl_proxy

fn interface() -> *mut wl_interface

fn interface_name() -> &'static str

The internal name of this interface, as advertized by the registry if it is a global.

fn version() -> u32

The maximum version of this interface handled by the library.

fn id(&self) -> ProxyId

Get the id of this proxy

unsafe fn from_ptr(ptr: *mut wl_proxy) -> WlShmPool

Creates a proxy from a fresh ptr

unsafe fn from_ptr_no_own(ptr: *mut wl_proxy) -> WlShmPool

Creates a proxy from a ptr that is managed elsewhere Read more

fn set_evt_iterator(&mut self, evt: &EventIterator)

Set the event iterator associated to this proxy

impl Debug for WlShmPool
[src]

fn fmt(&self, fmt: &mut Formatter) -> Result<()Error>

Formats the value using the given formatter.

impl Drop for WlShmPool
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more