summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-05-11 19:51:32 +0200
committerwm4 <wm4@nowhere>2020-05-11 19:57:34 +0200
commit55e1f15cdb9d73af56715ffe030a626697c1b917 (patch)
treeb5c8a68ccbcc6fb0b4f7555f10d31ce1236196d0 /test
parent6db890ebab2839443ddbfc34a4a0246d464bd14f (diff)
downloadmpv-55e1f15cdb9d73af56715ffe030a626697c1b917.tar.bz2
mpv-55e1f15cdb9d73af56715ffe030a626697c1b917.tar.xz
draw_bmp: add a function to return a single-texture OSD overlay
Maybe this is useful for some of the lesser VOs. It's preferable over bad ad-hoc solutions based on the more complex sub_bitmap data structures (as observed e.g. in vo_vaapi.c), and does not use that much more code since draw_bmp already created such an overlay internally. But I still wanted something that avoids having to upload/render a full screen-sized overlay if for example there's only a tiny subtitle line on the bottom of the screen. So the new API can return a list of modified pixels (for upload) and non-transparent pixels (for display). The way these pixel rectangles are computed is a bit dumb and returns dumb results, but it should be usable, and the implementation can change.
Diffstat (limited to 'test')
-rw-r--r--test/repack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/repack.c b/test/repack.c
index aa9c804308..a2f4a97b83 100644
--- a/test/repack.c
+++ b/test/repack.c
@@ -365,8 +365,8 @@ static bool try_draw_bmp(FILE *f, int imgfmt)
.num_items = 1,
};
- struct mp_draw_sub_cache *c = NULL;
- if (mp_draw_sub_bitmaps(&c, dst, &sbs_list)) {
+ struct mp_draw_sub_cache *c = mp_draw_sub_alloc(NULL);
+ if (mp_draw_sub_bitmaps(c, dst, &sbs_list)) {
char *info = mp_draw_sub_get_dbg_info(c);
fprintf(f, "%s\n", info);
talloc_free(info);