[client] egl: do not use damage when overlays are visible

This allows the overlays to show up correctly.
This commit is contained in:
Quantum
2021-07-11 03:52:41 -04:00
committed by Geoffrey McRae
parent e42747f4e3
commit 00eb26a34f
5 changed files with 31 additions and 19 deletions

View File

@@ -124,6 +124,7 @@ struct Inst
bool cursorLastValid;
struct CursorState cursorLast;
bool hadOverlay;
_Atomic(struct DesktopDamage *) desktopDamage;
};
@@ -832,6 +833,7 @@ bool egl_render(void * opaque, LG_RendererRotate rotate)
bool hasLastCursor = this->cursorLastValid;
bool cursorRendered = false;
bool hasOverlay = false;
struct CursorState cursorState;
struct DesktopDamage * desktopDamage = NULL;
@@ -878,12 +880,15 @@ bool egl_render(void * opaque, LG_RendererRotate rotate)
}
if (!this->waitDone)
{
egl_splash_render(this->splash, a, this->splashRatio);
hasOverlay = true;
}
}
else
else if (!this->start)
{
if (!this->start)
egl_splash_render(this->splash, 1.0f, this->splashRatio);
egl_splash_render(this->splash, 1.0f, this->splashRatio);
hasOverlay = true;
}
if (this->showAlert)
@@ -900,13 +905,26 @@ bool egl_render(void * opaque, LG_RendererRotate rotate)
this->cursorLastValid = false;
}
else
{
egl_alert_render(this->alert, this->screenScaleX, this->screenScaleY);
hasOverlay = true;
}
}
hasOverlay |= egl_fps_render(this->fps, this->screenScaleX, this->screenScaleY);
hasOverlay |= egl_help_render(this->help, this->screenScaleX, this->screenScaleY);
if (app_renderImGui())
{
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplOpenGL3_RenderDrawData(igGetDrawData());
hasOverlay = true;
}
struct Rect damage[KVMFR_MAX_DAMAGE_RECTS + 2];
int damageIdx = 0;
if (this->waitDone)
if (!hasOverlay && !this->hadOverlay)
{
if (cursorRendered && hasLastCursor)
{
@@ -953,15 +971,7 @@ bool egl_render(void * opaque, LG_RendererRotate rotate)
}
}
}
egl_fps_render(this->fps, this->screenScaleX, this->screenScaleY);
egl_help_render(this->help, this->screenScaleX, this->screenScaleY);
if (app_renderImGui())
{
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplOpenGL3_RenderDrawData(igGetDrawData());
}
this->hadOverlay = hasOverlay;
app_eglSwapBuffers(this->display, this->surface, damage, damageIdx);
return true;