aboutsummaryrefslogtreecommitdiff
path: root/render.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-01-04 18:49:26 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-01-04 18:49:26 +0000
commit99f471d738e0c2a0dcb61a559be3be512659d113 (patch)
tree4a36dadf274d9c438e5b42ed907ce0bf7ea3976b /render.h
parentfdm: add support for hooks (diff)
render: trigger terminal refreshes in an FDM hook
In some cases, we end up calling render_refresh() multiple times in the same FDM iteration. This means will render the first update immediately, and then set the 'pending' flag, causing the updated content to be rendered in the next frame. This can cause flicker, or flashes, since we're presenting one or more intermediate frames until the final content is shown. Not to mention that it is inefficient to render multiple frames like this. Fix by: * render_refresh() only sets a flag in the terminal * install an FDM hook; this hook loops all terminals and executes what render_refresh() _used_ to do (that is, render immediately if we're not waiting for a frame callback, otherwise set 'pending' flag). for all terminals that have the 'refresh_needed' flag set.
Diffstat (limited to 'render.h')
-rw-r--r--render.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/render.h b/render.h
index ad6b6578..74d9b456 100644
--- a/render.h
+++ b/render.h
@@ -1,9 +1,12 @@
#pragma once
#include "terminal.h"
+#include "fdm.h"
+#include "wayland.h"
-struct font *attrs_to_font(
- const struct terminal *term, const struct attributes *attrs);
+struct renderer;
+struct renderer *render_init(struct fdm *fdm, struct wayland *wayl);
+void render_destroy(struct renderer *renderer);
void grid_render(struct terminal *term);
void render_resize(struct terminal *term, int width, int height);