[client] imgui: track last rectangles for overlays

This is necessary in case overlays change size. When this happens, we must
damage the larger of the overlays' rectangles this frame and last frame.
This erases the overlay from where it is no longer appears.

In order to do this, we must keep track of the rectangles for every overlay
with no exception. We cannot short-circuit the generation of rectangles if
we run out of buffer space, and we must allocate space for MAX_OVERLAY_RECTS
rectangles for every frame. Otherwise, we will not know where to erase the
overlay if it disappears.
This commit is contained in:
Quantum
2021-07-22 05:43:16 -04:00
committed by Geoffrey McRae
parent 334bfeecea
commit df0397b10b
3 changed files with 42 additions and 19 deletions

View File

@@ -1007,8 +1007,8 @@ bool egl_render(void * opaque, LG_RendererRotate rotate, const bool newFrame)
hasOverlay |= egl_help_render(this->help, this->screenScaleX, this->screenScaleY);
hasOverlay |= egl_damage_render(this->damage, newFrame ? desktopDamage : NULL);
struct Rect damage[KVMFR_MAX_DAMAGE_RECTS + 12];
int damageIdx = app_renderOverlay(damage, 10);
struct Rect damage[KVMFR_MAX_DAMAGE_RECTS + MAX_OVERLAY_RECTS + 2];
int damageIdx = app_renderOverlay(damage, MAX_OVERLAY_RECTS);
switch (damageIdx)
{