[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.
This commit is contained in:
Geoffrey McRae 2021-01-19 04:26:59 +11:00
parent 083deff489
commit b92e547d91

View File

@ -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)