summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-10-23 20:23:56 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2013-10-23 20:23:56 +0200
commit1e22362792ca819c8cf86171b4da92b8e10a89a9 (patch)
tree869d7f515de15e932dc00284a139586baead4c0a
parent54668ff649fda9d1f182e76727a594d348d00627 (diff)
Allow resetting FB-age and do so on resize
Reset the FB age on resize and provide a helper to allow main wlterm to reset the FB-age for a whole redraw (can be used during font-change or similar). Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
-rw-r--r--src/wlt_render.c6
-rw-r--r--src/wlterm.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/wlt_render.c b/src/wlt_render.c
index b7d83d6..f89885d 100644
--- a/src/wlt_render.c
+++ b/src/wlt_render.c
@@ -79,6 +79,7 @@ static int wlt_renderer_realloc(struct wlt_renderer *rend, unsigned int width,
rend->stride = stride;
rend->data = data;
rend->surface = surface;
+ rend->age = 0;
return 0;
}
@@ -120,6 +121,11 @@ int wlt_renderer_resize(struct wlt_renderer *rend, unsigned int width,
return wlt_renderer_realloc(rend, width, height);
}
+void wlt_renderer_dirty(struct wlt_renderer *rend)
+{
+ rend->age = 0;
+}
+
static void wlt_renderer_fill(struct wlt_renderer *rend,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
diff --git a/src/wlterm.h b/src/wlterm.h
index d26090c..0c9efd0 100644
--- a/src/wlterm.h
+++ b/src/wlterm.h
@@ -101,6 +101,7 @@ int wlt_renderer_new(struct wlt_renderer **out, unsigned int width,
void wlt_renderer_free(struct wlt_renderer *rend);
int wlt_renderer_resize(struct wlt_renderer *rend, unsigned int width,
unsigned int height);
+void wlt_renderer_dirty(struct wlt_renderer *rend);
void wlt_renderer_draw(const struct wlt_draw_ctx *ctx);
#endif /* WLT_WLTERM_H */