mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
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.
22 lines
589 B
C
22 lines
589 B
C
#pragma once
|
|
|
|
#include "terminal.h"
|
|
#include "fdm.h"
|
|
#include "wayland.h"
|
|
|
|
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);
|
|
void render_set_title(struct terminal *term, const char *title);
|
|
void render_refresh(struct terminal *term);
|
|
|
|
void render_search_box(struct terminal *term);
|
|
|
|
struct render_worker_context {
|
|
int my_id;
|
|
struct terminal *term;
|
|
};
|
|
int render_worker_thread(void *_ctx);
|