Skip to content

Commit 17da01e

Browse files
committed
output-layout: use wlr_texture_from_buffer directly
Fixes #1408
1 parent 0f97986 commit 17da01e

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/core/output-layout.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -626,28 +626,21 @@ struct output_layout_output_t
626626
return;
627627
}
628628

629-
wlr_dmabuf_attributes attributes;
630629
if (source_back_buffer == NULL)
631630
{
632631
LOGE("Got empty buffer on ", wo->handle->name);
633632
return;
634633
}
635634

636-
if (!wlr_buffer_get_dmabuf(source_back_buffer, &attributes))
635+
auto texture = wlr_texture_from_buffer(get_core().renderer, source_back_buffer);
636+
if (!texture)
637637
{
638-
LOGE("Failed reading mirrored output contents from ", wo->handle->name);
639-
638+
LOGE("Failed to export texture to dmabuf!");
640639
return;
641640
}
642641

643-
/* We export the output to mirror from to a dmabuf, then create
644-
* a texture from this and use it to render "our" output */
645-
auto texture = wlr_texture_from_dmabuf(
646-
get_core().renderer, &attributes);
647642
render_output(texture);
648-
649643
wlr_texture_destroy(texture);
650-
wlr_dmabuf_attributes_finish(&attributes);
651644
}
652645

653646
void set_enabled(bool enabled)

0 commit comments

Comments
 (0)