|
|
|
@ -6,6 +6,7 @@
|
|
|
|
|
#include <time.h>
|
|
|
|
|
#include <wayland-server.h>
|
|
|
|
|
#include <wlr/interfaces/wlr_output.h>
|
|
|
|
|
#include <wlr/render/interface.h>
|
|
|
|
|
#include <wlr/render/wlr_renderer.h>
|
|
|
|
|
#include <wlr/types/wlr_box.h>
|
|
|
|
|
#include <wlr/types/wlr_matrix.h>
|
|
|
|
@ -339,6 +340,20 @@ bool wlr_output_make_current(struct wlr_output *output, int *buffer_age) {
|
|
|
|
|
return output->impl->make_current(output, buffer_age);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool wlr_output_preferred_read_format(struct wlr_output *output,
|
|
|
|
|
enum wl_shm_format *fmt) {
|
|
|
|
|
if (!wlr_output_make_current(output, NULL)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct wlr_renderer *renderer = wlr_backend_get_renderer(output->backend);
|
|
|
|
|
if (!renderer->impl->preferred_read_format || !renderer->impl->read_pixels) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
*fmt = renderer->impl->preferred_read_format(renderer);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool wlr_output_swap_buffers(struct wlr_output *output, struct timespec *when,
|
|
|
|
|
pixman_region32_t *damage) {
|
|
|
|
|
if (output->frame_pending) {
|
|
|
|
|