wlmaker
|
#include "gfxbuf.h"
#include <drm_fourcc.h>
#include <libbase/libbase.h>
#include <wlr/interfaces/wlr_buffer.h>
#include <wlr/types/wlr_buffer.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
Classes | |
struct | wlmaker_gfxbuf_t |
Functions | |
static wlmaker_gfxbuf_t * | wlmaker_gfxbuf_from_wlr_buffer (struct wlr_buffer *wlr_buffer_ptr) |
static void | wlmaker_gfxbuf_impl_destroy (struct wlr_buffer *wlr_buffer_ptr) |
static bool | wlmaker_gfxbuf_impl_begin_data_ptr_access (struct wlr_buffer *wlr_buffer_ptr, uint32_t flags, void **data_ptr_ptr, uint32_t *format_ptr, size_t *stride_ptr) |
static void | wlmaker_gfxbuf_impl_end_data_ptr_access (struct wlr_buffer *wlr_buffer_ptr) |
struct wlr_buffer * | bs_gfxbuf_create_wlr_buffer (unsigned width, unsigned height) |
void | wlr_buffer_drop_nullify (struct wlr_buffer **wlr_buffer_ptr_ptr) |
bs_gfxbuf_t * | bs_gfxbuf_from_wlr_buffer (struct wlr_buffer *wlr_buffer_ptr) |
cairo_t * | cairo_create_from_wlr_buffer (struct wlr_buffer *wlr_buffer_ptr) |
Variables | |
static const struct wlr_buffer_impl | wlmaker_gfxbuf_impl |
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.
struct wlr_buffer * bs_gfxbuf_create_wlr_buffer | ( | unsigned | width, |
unsigned | height | ||
) |
Creates a wlroots buffer tied to a libbase graphics buffer.
This creates a libbase graphics buffer, and wraps it as struct wlr_buffer
.
width | |
height |
bs_gfxbuf_t * bs_gfxbuf_from_wlr_buffer | ( | struct wlr_buffer * | wlr_buffer_ptr | ) |
Returns the libbase graphics buffer for the struct wlr_buffer
.
wlr_buffer_ptr | Pointer to a struct wlr_buffer . Must be a wlr_buffer that was previously created by bs_gfxbuf_create_wlr_buffer. |
wlr_buffer_ptr
must outlive the bs_gfxbuf_t*
. Must not be destroyed. cairo_t * cairo_create_from_wlr_buffer | ( | struct wlr_buffer * | wlr_buffer_ptr | ) |
Returns a cairo_t
for the WLR buffer backed by a libbase graphics buffer.
wlr_buffer_ptr | Pointer to a struct wlr_buffer . Must be a wlr_buffer that was previously created by bs_gfxbuf_create_wlr_buffer. |
wlr_buffer_ptr
must outlive the cairo_t*
. It must be destroyed using cairo_destroy
.
|
static |
Returns the wlmaker_gfxbuf_t for wlr_buffer_ptr
.
wlr_buffer_ptr | Pointer to a struct wlr_buffer . Must be a wlr_buffer that was previously created by bs_gfxbuf_create_wlr_buffer. |
|
static |
struct wlr_buffer_impl
callback: Set up for data access.
wlr_buffer_ptr | |
flags | unused. |
data_ptr_ptr | Output argument, point to the surface data. |
format_ptr | Output argument, set to the surface's format. |
stride_ptr | Output argument, set to the surface's stride. |
|
static |
struct wlr_buffer_impl
callback: Destroys the graphics buffer.
This function Will be called only once producer and all consumers of the corresponding wlr_buffer have lifted their locks (references).
wlr_buffer_ptr |
|
static |
struct wlr_buffer_impl
callback: End data access. Here, a no-op.
void wlr_buffer_drop_nullify | ( | struct wlr_buffer ** | wlr_buffer_ptr_ptr | ) |
Drops a WLR buffer, and sets the pointer to NULL.
wlr_buffer_ptr_ptr | Points to a pointer to a WLR buffer. The pointer to the WLR buffer may be NULL; in that case, the call is a no-op. |
|
static |
Implementation callbacks for wlroots' struct wlr_buffer
.