diff --git a/client/include/interface/renderer.h b/client/include/interface/renderer.h index 6b84a869..50274465 100644 --- a/client/include/interface/renderer.h +++ b/client/include/interface/renderer.h @@ -36,6 +36,7 @@ (x)->on_mouse_shape && \ (x)->on_mouse_event && \ (x)->render_startup && \ + (x)->needs_render && \ (x)->render) typedef struct LG_RendererParams @@ -112,6 +113,7 @@ typedef bool (* LG_RendererOnMouseEvent )(void * opaque, const bool visi typedef bool (* LG_RendererOnFrameFormat)(void * opaque, const LG_RendererFormat format, bool useDMA); typedef bool (* LG_RendererOnFrame )(void * opaque, const FrameBuffer * frame, int dmaFD, const FrameDamageRect * damage, int damageCount); typedef bool (* LG_RendererRenderStartup)(void * opaque); +typedef bool (* LG_RendererNeedsRender )(void * opaque); typedef bool (* LG_RendererRender )(void * opaque, LG_RendererRotate rotate, const bool newFrame, const bool invalidateWindow); typedef struct LG_Renderer @@ -130,6 +132,7 @@ typedef struct LG_Renderer LG_RendererOnFrameFormat on_frame_format; LG_RendererOnFrame on_frame; LG_RendererRenderStartup render_startup; + LG_RendererNeedsRender needs_render; LG_RendererRender render; } LG_Renderer; diff --git a/client/renderers/EGL/egl.c b/client/renderers/EGL/egl.c index f7db5b4a..dabbca26 100644 --- a/client/renderers/EGL/egl.c +++ b/client/renderers/EGL/egl.c @@ -805,6 +805,12 @@ static bool egl_render_startup(void * opaque) return true; } +static bool egl_needs_render(void * opaque) +{ + struct Inst * this = (struct Inst *)opaque; + return !this->waitDone; +} + static bool egl_render(void * opaque, LG_RendererRotate rotate, const bool newFrame, const bool invalidateWindow) { @@ -1007,5 +1013,6 @@ struct LG_Renderer LGR_EGL = .on_frame_format = egl_on_frame_format, .on_frame = egl_on_frame, .render_startup = egl_render_startup, + .needs_render = egl_needs_render, .render = egl_render }; diff --git a/client/renderers/OpenGL/opengl.c b/client/renderers/OpenGL/opengl.c index c5acbd61..08f70071 100644 --- a/client/renderers/OpenGL/opengl.c +++ b/client/renderers/OpenGL/opengl.c @@ -456,6 +456,12 @@ bool opengl_render_startup(void * opaque) return true; } +static bool opengl_needs_render(void * opaque) +{ + struct Inst * this = (struct Inst *)opaque; + return !this->waitDone; +} + bool opengl_render(void * opaque, LG_RendererRotate rotate, const bool newFrame, const bool invalidateWindow) { @@ -618,6 +624,7 @@ const LG_Renderer LGR_OpenGL = .on_frame_format = opengl_on_frame_format, .on_frame = opengl_on_frame, .render_startup = opengl_render_startup, + .needs_render = opengl_needs_render, .render = opengl_render };