@ -10,8 +10,6 @@
# include <wayland-client.h>
# include <wayland-client.h>
# include <wlr/interfaces/wlr_output.h>
# include <wlr/interfaces/wlr_output.h>
# include <wlr/render/egl.h>
# include <wlr/render/gles2.h>
# include <wlr/render/wlr_renderer.h>
# include <wlr/render/wlr_renderer.h>
# include <wlr/types/wlr_matrix.h>
# include <wlr/types/wlr_matrix.h>
# include <wlr/util/log.h>
# include <wlr/util/log.h>
@ -117,8 +115,6 @@ static bool output_set_custom_mode(struct wlr_output *wlr_output,
static bool output_attach_render ( struct wlr_output * wlr_output ,
static bool output_attach_render ( struct wlr_output * wlr_output ,
int * buffer_age ) {
int * buffer_age ) {
struct wlr_wl_output * output = get_wl_output_from_output ( wlr_output ) ;
struct wlr_wl_output * output = get_wl_output_from_output ( wlr_output ) ;
struct wlr_egl * egl = wlr_gles2_renderer_get_egl (
output - > backend - > renderer ) ;
wlr_buffer_unlock ( output - > back_buffer ) ;
wlr_buffer_unlock ( output - > back_buffer ) ;
output - > back_buffer = wlr_swapchain_acquire ( output - > swapchain , buffer_age ) ;
output - > back_buffer = wlr_swapchain_acquire ( output - > swapchain , buffer_age ) ;
@ -126,9 +122,6 @@ static bool output_attach_render(struct wlr_output *wlr_output,
return false ;
return false ;
}
}
if ( ! wlr_egl_make_current ( egl ) ) {
return false ;
}
if ( ! wlr_renderer_bind_buffer ( output - > backend - > renderer ,
if ( ! wlr_renderer_bind_buffer ( output - > backend - > renderer ,
output - > back_buffer ) ) {
output - > back_buffer ) ) {
return false ;
return false ;
@ -313,10 +306,6 @@ static bool output_commit(struct wlr_output *wlr_output) {
wlr_buffer = output - > back_buffer ;
wlr_buffer = output - > back_buffer ;
wlr_renderer_bind_buffer ( output - > backend - > renderer , NULL ) ;
wlr_renderer_bind_buffer ( output - > backend - > renderer , NULL ) ;
struct wlr_egl * egl = wlr_gles2_renderer_get_egl (
output - > backend - > renderer ) ;
wlr_egl_unset_current ( egl ) ;
break ;
break ;
case WLR_OUTPUT_STATE_BUFFER_SCANOUT : ;
case WLR_OUTPUT_STATE_BUFFER_SCANOUT : ;
wlr_buffer = wlr_output - > pending . buffer ;
wlr_buffer = wlr_output - > pending . buffer ;
@ -376,10 +365,7 @@ static bool output_commit(struct wlr_output *wlr_output) {
static void output_rollback_render ( struct wlr_output * wlr_output ) {
static void output_rollback_render ( struct wlr_output * wlr_output ) {
struct wlr_wl_output * output = get_wl_output_from_output ( wlr_output ) ;
struct wlr_wl_output * output = get_wl_output_from_output ( wlr_output ) ;
struct wlr_egl * egl = wlr_gles2_renderer_get_egl (
output - > backend - > renderer ) ;
wlr_renderer_bind_buffer ( output - > backend - > renderer , NULL ) ;
wlr_renderer_bind_buffer ( output - > backend - > renderer , NULL ) ;
wlr_egl_unset_current ( egl ) ;
}
}
static bool output_set_cursor ( struct wlr_output * wlr_output ,
static bool output_set_cursor ( struct wlr_output * wlr_output ,
@ -411,8 +397,6 @@ static bool output_set_cursor(struct wlr_output *wlr_output,
struct wl_surface * surface = output - > cursor . surface ;
struct wl_surface * surface = output - > cursor . surface ;
if ( texture ! = NULL ) {
if ( texture ! = NULL ) {
struct wlr_egl * egl = wlr_gles2_renderer_get_egl (
output - > backend - > renderer ) ;
int width = texture - > width * wlr_output - > scale / scale ;
int width = texture - > width * wlr_output - > scale / scale ;
int height = texture - > height * wlr_output - > scale / scale ;
int height = texture - > height * wlr_output - > scale / scale ;
@ -434,9 +418,6 @@ static bool output_set_cursor(struct wlr_output *wlr_output,
return false ;
return false ;
}
}
if ( ! wlr_egl_make_current ( egl ) ) {
return false ;
}
if ( ! wlr_renderer_bind_buffer ( output - > backend - > renderer , wlr_buffer ) ) {
if ( ! wlr_renderer_bind_buffer ( output - > backend - > renderer , wlr_buffer ) ) {
return false ;
return false ;
}
}
@ -458,7 +439,6 @@ static bool output_set_cursor(struct wlr_output *wlr_output,
wlr_renderer_end ( backend - > renderer ) ;
wlr_renderer_end ( backend - > renderer ) ;
wlr_renderer_bind_buffer ( output - > backend - > renderer , NULL ) ;
wlr_renderer_bind_buffer ( output - > backend - > renderer , NULL ) ;
wlr_egl_unset_current ( egl ) ;
struct wlr_wl_buffer * buffer =
struct wlr_wl_buffer * buffer =
get_or_create_wl_buffer ( output - > backend , wlr_buffer ) ;
get_or_create_wl_buffer ( output - > backend , wlr_buffer ) ;