mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -05:00
common: Add znew/znew_n() macros
This commit is contained in:
parent
da57483961
commit
a54d378e6c
26 changed files with 47 additions and 47 deletions
|
|
@ -88,7 +88,7 @@ struct lab_data_buffer *
|
|||
buffer_create_cairo(uint32_t width, uint32_t height, float scale,
|
||||
bool free_on_destroy)
|
||||
{
|
||||
struct lab_data_buffer *buffer = xzalloc(sizeof(*buffer));
|
||||
struct lab_data_buffer *buffer = znew(*buffer);
|
||||
buffer->unscaled_width = width;
|
||||
buffer->unscaled_height = height;
|
||||
width *= scale;
|
||||
|
|
@ -127,7 +127,7 @@ struct lab_data_buffer *
|
|||
buffer_create_wrap(void *pixel_data, uint32_t width, uint32_t height,
|
||||
uint32_t stride, bool free_on_destroy)
|
||||
{
|
||||
struct lab_data_buffer *buffer = xzalloc(sizeof(*buffer));
|
||||
struct lab_data_buffer *buffer = znew(*buffer);
|
||||
wlr_buffer_init(&buffer->base, &data_buffer_impl, width, height);
|
||||
buffer->data = pixel_data;
|
||||
buffer->format = DRM_FORMAT_ARGB8888;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue