mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
osd: slightly simplify update logic
Remove the per-part force_redraw flags, and instead make the difference between flagging dirty state and returning it to the player frontend more explicit. The big issue is that 1. the OSD needs to know the dirty state, and it should be cleared strictly when it is re-rendered (force_redraw flag), and 2. the player core needs to be notified once, and the notification must be reset (want_redraw flag). The call in loadfile.c is replaced by making osd_set_sub() set the change flag. Increasing the change flag on dirty state (the force_redraw check in render_object()) should not be needed, because OSD part renderers set it correctly (at least now). Doing this just because someone pointed this out.
This commit is contained in:
@@ -145,8 +145,7 @@ struct mpv_global;
|
||||
struct dec_sub;
|
||||
|
||||
struct osd_state *osd_create(struct mpv_global *global);
|
||||
void osd_changed(struct osd_state *osd, int new_value);
|
||||
void osd_changed_all(struct osd_state *osd);
|
||||
void osd_changed(struct osd_state *osd);
|
||||
void osd_free(struct osd_state *osd);
|
||||
|
||||
bool osd_query_and_reset_want_redraw(struct osd_state *osd);
|
||||
|
||||
Reference in New Issue
Block a user