mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-14 08:56:26 -05:00
buffer: introduce wlr_buffer_get_data_ptr
The function has been place in an internal header for API stability reasons.
This commit is contained in:
parent
9f33d8ad39
commit
0b9288ec0b
3 changed files with 25 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include <wlr/types/wlr_linux_dmabuf_v1.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "render/pixel_format.h"
|
||||
#include "types/wlr_buffer.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
void wlr_buffer_init(struct wlr_buffer *buffer,
|
||||
|
|
@ -65,6 +66,13 @@ bool wlr_buffer_get_dmabuf(struct wlr_buffer *buffer,
|
|||
return buffer->impl->get_dmabuf(buffer, attribs);
|
||||
}
|
||||
|
||||
bool buffer_get_data_ptr(struct wlr_buffer *buffer, void **data,
|
||||
size_t *size) {
|
||||
if (!buffer->impl->get_data_ptr) {
|
||||
return false;
|
||||
}
|
||||
return buffer->impl->get_data_ptr(buffer, data, size);
|
||||
}
|
||||
|
||||
bool wlr_resource_is_buffer(struct wl_resource *resource) {
|
||||
return strcmp(wl_resource_get_class(resource), wl_buffer_interface.name) == 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue