wlmaker
|
#include "buffer.h"
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <wayland-client.h>
Classes | |
struct | buffer_t |
struct | _wlclient_buffer_t |
Functions | |
static void | handle_wl_buffer_release (void *data_ptr, struct wl_buffer *wl_buffer_ptr) |
static int | shm_creat (const char *app_id_ptr, size_t size) |
static buffer_t * | create_buffer (struct wl_shm_pool *wl_shm_pool_ptr, void *data_base_ptr, size_t ofs, unsigned width, unsigned height, unsigned bytes_per_line) |
static void | buffer_destroy (buffer_t *buffer_ptr) |
wlclient_buffer_t * | wlclient_buffer_create (const wlclient_t *wlclient_ptr, unsigned width, unsigned height, wlclient_buffer_ready_callback_t ready_callback, void *ready_callback_ud_ptr) |
void | wlclient_buffer_destroy (wlclient_buffer_t *client_buffer_ptr) |
bs_gfxbuf_t * | bs_gfxbuf_from_wlclient_buffer (wlclient_buffer_t *client_buffer_ptr) |
void | wlclient_buffer_attach_to_surface_and_commit (wlclient_buffer_t *client_buffer_ptr, struct wl_surface *wl_surface_ptr) |
Variables | |
static const uint32_t | SHM_OPEN_RETRIES = 256 |
static const struct wl_buffer_listener | wl_buffer_listener |
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
bs_gfxbuf_t * bs_gfxbuf_from_wlclient_buffer | ( | wlclient_buffer_t * | buffer_ptr | ) |
Returns thebs_gfxbuf_t
corresponding to the client buffer.
buffer_ptr |
bs_gfxbuf_t
. The bs_gfxbuf_t
remains valid throughout the lifetime of buffer_ptr, and does not need to be released by the caller.
|
static |
Destroys the actual buffer.
|
static |
Creates the actual buffer.
|
static |
Handles the release
notification of the wl_buffer interface.
data_ptr | |
wl_buffer_ptr |
|
static |
Creates a POSIX shared memory object and allocates size
bytes to it.
app_id_ptr | |
size |
void wlclient_buffer_attach_to_surface_and_commit | ( | wlclient_buffer_t * | buffer_ptr, |
struct wl_surface * | wl_surface_ptr ) |
Attaches the buffer to the surface and commits it.
buffer_ptr | |
wl_surface_ptr |
wlclient_buffer_t * wlclient_buffer_create | ( | const wlclient_t * | wlclient_ptr, |
unsigned | width, | ||
unsigned | height, | ||
wlclient_buffer_ready_callback_t | ready_callback, | ||
void * | ready_callback_ud_ptr ) |
Creates a wlclient wayland buffer with the given dimensions.
wlclient_ptr | |
width | |
height | |
ready_callback | |
ready_callback_ud_ptr |
void wlclient_buffer_destroy | ( | wlclient_buffer_t * | buffer_ptr | ) |
Destroys the wlclient wayland buffer.
buffer_ptr |
|
static |
How many attempts to try shm_open before giving up.
|
static |
Listener implementation for the wl_buffer
.