summaryrefslogtreecommitdiff
path: root/fb.c
diff options
context:
space:
mode:
Diffstat (limited to 'fb.c')
-rw-r--r--fb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fb.c b/fb.c
index 88883fd..6bd22e9 100644
--- a/fb.c
+++ b/fb.c
@@ -212,12 +212,23 @@ framebufctl_swap(Framebufctl *ctl)
}
static void
+resetAbuf(Abuf *buf)
+{
+ while(buf->nact--)
+ free(buf->act[buf->nact]->items);
+ free(buf->act);
+ free(buf->stk);
+ memset(buf, 0, sizeof *buf);
+}
+
+static void
framebufctl_reset(Framebufctl *ctl)
{
Framebuf *fb;
/* address the back buffer—resetting the front buffer is VERBOTEN */
fb = ctl->getbb(ctl);
+ resetAbuf(&fb->abuf);
memset(fb->nb, 0, Dx(fb->r)*Dy(fb->r)*4);
memsetf(fb->zb, Inf(-1), Dx(fb->r)*Dy(fb->r));
memset(fb->cb, 0, Dx(fb->r)*Dy(fb->r)*4);