mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-25 14:17:03 +00:00
[client] egl: do not use damage when overlays are visible
This allows the overlays to show up correctly.
This commit is contained in:
parent
e42747f4e3
commit
00eb26a34f
@ -124,6 +124,7 @@ struct Inst
|
|||||||
bool cursorLastValid;
|
bool cursorLastValid;
|
||||||
struct CursorState cursorLast;
|
struct CursorState cursorLast;
|
||||||
|
|
||||||
|
bool hadOverlay;
|
||||||
_Atomic(struct DesktopDamage *) desktopDamage;
|
_Atomic(struct DesktopDamage *) desktopDamage;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -832,6 +833,7 @@ bool egl_render(void * opaque, LG_RendererRotate rotate)
|
|||||||
|
|
||||||
bool hasLastCursor = this->cursorLastValid;
|
bool hasLastCursor = this->cursorLastValid;
|
||||||
bool cursorRendered = false;
|
bool cursorRendered = false;
|
||||||
|
bool hasOverlay = false;
|
||||||
struct CursorState cursorState;
|
struct CursorState cursorState;
|
||||||
struct DesktopDamage * desktopDamage = NULL;
|
struct DesktopDamage * desktopDamage = NULL;
|
||||||
|
|
||||||
@ -878,12 +880,15 @@ bool egl_render(void * opaque, LG_RendererRotate rotate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this->waitDone)
|
if (!this->waitDone)
|
||||||
egl_splash_render(this->splash, a, this->splashRatio);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
if (!this->start)
|
egl_splash_render(this->splash, a, this->splashRatio);
|
||||||
|
hasOverlay = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else 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)
|
if (this->showAlert)
|
||||||
@ -900,13 +905,26 @@ bool egl_render(void * opaque, LG_RendererRotate rotate)
|
|||||||
this->cursorLastValid = false;
|
this->cursorLastValid = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
egl_alert_render(this->alert, this->screenScaleX, this->screenScaleY);
|
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];
|
struct Rect damage[KVMFR_MAX_DAMAGE_RECTS + 2];
|
||||||
int damageIdx = 0;
|
int damageIdx = 0;
|
||||||
|
|
||||||
if (this->waitDone)
|
if (!hasOverlay && !this->hadOverlay)
|
||||||
{
|
{
|
||||||
if (cursorRendered && hasLastCursor)
|
if (cursorRendered && hasLastCursor)
|
||||||
{
|
{
|
||||||
@ -953,15 +971,7 @@ bool egl_render(void * opaque, LG_RendererRotate rotate)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this->hadOverlay = hasOverlay;
|
||||||
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());
|
|
||||||
}
|
|
||||||
|
|
||||||
app_eglSwapBuffers(this->display, this->surface, damage, damageIdx);
|
app_eglSwapBuffers(this->display, this->surface, damage, damageIdx);
|
||||||
return true;
|
return true;
|
||||||
|
@ -187,10 +187,10 @@ void egl_fps_update(EGL_FPS * fps, const float avgFPS, const float renderFPS)
|
|||||||
fps->font->release(fps->fontObj, bmp);
|
fps->font->release(fps->fontObj, bmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void egl_fps_render(EGL_FPS * fps, const float scaleX, const float scaleY)
|
bool egl_fps_render(EGL_FPS * fps, const float scaleX, const float scaleY)
|
||||||
{
|
{
|
||||||
if (!fps->display || !fps->ready)
|
if (!fps->display || !fps->ready)
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
@ -208,4 +208,5 @@ void egl_fps_render(EGL_FPS * fps, const float scaleX, const float scaleY)
|
|||||||
egl_model_render(fps->model);
|
egl_model_render(fps->model);
|
||||||
|
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -32,4 +32,4 @@ void egl_fps_free(EGL_FPS ** fps);
|
|||||||
void egl_fps_set_display(EGL_FPS * fps, bool display);
|
void egl_fps_set_display(EGL_FPS * fps, bool display);
|
||||||
void egl_fps_set_font (EGL_FPS * fps, LG_Font * fontObj);
|
void egl_fps_set_font (EGL_FPS * fps, LG_Font * fontObj);
|
||||||
void egl_fps_update(EGL_FPS * fps, const float avgUPS, const float avgFPS);
|
void egl_fps_update(EGL_FPS * fps, const float avgUPS, const float avgFPS);
|
||||||
void egl_fps_render(EGL_FPS * fps, const float scaleX, const float scaleY);
|
bool egl_fps_render(EGL_FPS * fps, const float scaleX, const float scaleY);
|
||||||
|
@ -160,7 +160,7 @@ void egl_help_set_font(EGL_Help * help, LG_FontObj fontObj)
|
|||||||
help->fontObj = fontObj;
|
help->fontObj = fontObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
void egl_help_render(EGL_Help * help, const float scaleX, const float scaleY)
|
bool egl_help_render(EGL_Help * help, const float scaleX, const float scaleY)
|
||||||
{
|
{
|
||||||
LG_FontBitmap * bmp = atomic_exchange(&help->bmp, NULL);
|
LG_FontBitmap * bmp = atomic_exchange(&help->bmp, NULL);
|
||||||
if (bmp)
|
if (bmp)
|
||||||
@ -194,7 +194,7 @@ void egl_help_render(EGL_Help * help, const float scaleX, const float scaleY)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!help->shouldRender)
|
if (!help->shouldRender)
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
@ -212,4 +212,5 @@ void egl_help_render(EGL_Help * help, const float scaleX, const float scaleY)
|
|||||||
egl_model_render(help->model);
|
egl_model_render(help->model);
|
||||||
|
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -31,4 +31,4 @@ void egl_help_free(EGL_Help ** help);
|
|||||||
|
|
||||||
void egl_help_set_text(EGL_Help * help, const char * help_text);
|
void egl_help_set_text(EGL_Help * help, const char * help_text);
|
||||||
void egl_help_set_font(EGL_Help * help, LG_FontObj fontObj);
|
void egl_help_set_font(EGL_Help * help, LG_FontObj fontObj);
|
||||||
void egl_help_render(EGL_Help * help, const float scaleX, const float scaleY);
|
bool egl_help_render(EGL_Help * help, const float scaleX, const float scaleY);
|
||||||
|
Loading…
Reference in New Issue
Block a user