wlmaker
Loading...
Searching...
No Matches
Macros | Functions
gfxbuf.h File Reference
#include <cairo.h>
#include <libbase/libbase.h>
#include <wlr/types/wlr_buffer.h>
Include dependency graph for gfxbuf.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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)
 

Detailed Description

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.

Function Documentation

◆ bs_gfxbuf_create_wlr_buffer()

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.

Parameters
width
height
Returns
A struct wlr_buffer. Must be released using wlr_buffer_drop().

◆ bs_gfxbuf_from_wlr_buffer()

bs_gfxbuf_t * bs_gfxbuf_from_wlr_buffer ( struct wlr_buffer *  wlr_buffer_ptr)

Returns the libbase graphics buffer for the struct wlr_buffer.

Parameters
wlr_buffer_ptrPointer to a struct wlr_buffer. Must be a wlr_buffer that was previously created by bs_gfxbuf_create_wlr_buffer.
Returns
Pointer to the libbase graphics buffer. The wlr_buffer_ptr must outlive the bs_gfxbuf_t*. Must not be destroyed.

◆ cairo_create_from_wlr_buffer()

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.

Parameters
wlr_buffer_ptrPointer to a struct wlr_buffer. Must be a wlr_buffer that was previously created by bs_gfxbuf_create_wlr_buffer.
Returns
Pointer to the the cairo. The wlr_buffer_ptr must outlive the cairo_t*. It must be destroyed using cairo_destroy.

◆ wlr_buffer_drop_nullify()

void wlr_buffer_drop_nullify ( struct wlr_buffer **  wlr_buffer_ptr_ptr)

Drops a WLR buffer, and sets the pointer to NULL.

Parameters
wlr_buffer_ptr_ptrPoints 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.