From 2128f6884762261c0a706e36fd59b98d35d28ce0 Mon Sep 17 00:00:00 2001 From: Victor Brekenfeld Date: Sun, 10 May 2020 20:08:29 +0200 Subject: [PATCH] egl: log hidden egl errors --- src/backend/egl/surface.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/backend/egl/surface.rs b/src/backend/egl/surface.rs index 422845d..3ba5f32 100644 --- a/src/backend/egl/surface.rs +++ b/src/backend/egl/surface.rs @@ -18,6 +18,7 @@ pub struct EGLSurface { config_id: ffi::egl::types::EGLConfig, pixel_format: PixelFormat, surface_attributes: Vec, + logger: ::slog::Logger, } impl Deref for EGLSurface { @@ -83,6 +84,7 @@ impl EGLSurface { config_id: config, pixel_format, surface_attributes, + logger: log, }) } @@ -122,7 +124,10 @@ impl EGLSurface { .map_err(SwapBuffersError::EGLCreateWindowSurface)? }); - result.map_err(|_| SwapBuffersError::EGLSwapBuffers(EGLError::BadSurface)) + result.map_err(|err| { + debug!(self.logger, "Hiding page-flip error *before* recreation: {}", err); + SwapBuffersError::EGLSwapBuffers(EGLError::BadSurface) + }) } else { result }