From b92e547d9160782865a771f313fe3496f2a417c4 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Tue, 19 Jan 2021 04:26:59 +1100 Subject: [PATCH] [client] egl: force the use of nearest if needed As the screen output rotation can be changed on the fly, if it has been rotated to 90 or 270 the nearest flag will be incorrect, so we perform this check here and override the provided value. --- client/renderers/EGL/desktop.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/client/renderers/EGL/desktop.c b/client/renderers/EGL/desktop.c index 766306e1..83ecdd9d 100644 --- a/client/renderers/EGL/desktop.c +++ b/client/renderers/EGL/desktop.c @@ -252,11 +252,27 @@ bool egl_desktop_render(EGL_Desktop * desktop, const float x, const float y, if (!desktop->shader) return false; + bool useNearest = nearest; + if (!nearest) + { + switch(rotate) + { + case LG_ROTATE_90: + case LG_ROTATE_270: + if (scaleX < 1.0f || scaleY < 1.0f) + useNearest = true; + break; + + default: + break; + } + } + const struct DesktopShader * shader = desktop->shader; egl_shader_use(shader->shader); glUniform4f(shader->uDesktopPos , x, y, scaleX, scaleY); glUniform1i(shader->uRotate , rotate); - glUniform1i(shader->uNearest , nearest ? 1 : 0); + glUniform1i(shader->uNearest , useNearest ? 1 : 0); glUniform2f(shader->uDesktopSize, desktop->width, desktop->height); if (desktop->nvGain)