1
0
mirror of https://github.com/jojo61/vdr-plugin-softhdcuvid.git synced 2023-10-10 13:37:41 +02:00

OSD optimizations

This commit is contained in:
jojo61 2019-11-01 08:22:26 +01:00
parent 3dfaeaf7e2
commit 146b826b4d

11
video.c
View File

@ -3628,13 +3628,14 @@ void make_osd_overlay(int x, int y, int width, int height)
pl = &osdoverlay; pl = &osdoverlay;
if (pl->plane.texture) { if (pl->plane.texture && (pl->plane.texture->params.w != width || pl->plane.texture->params.h != height)) {
pl_tex_clear(p->gpu, pl->plane.texture, (float[4]) { 0 }); // pl_tex_clear(p->gpu, pl->plane.texture, (float[4]) { 0 });
pl_tex_destroy(p->gpu, &pl->plane.texture); pl_tex_destroy(p->gpu, &pl->plane.texture);
} }
// make texture for OSD // make texture for OSD
pl->plane.texture = pl_tex_create(p->gpu, &(struct pl_tex_params) { if (pl->plane.texture == NULL ) {
pl->plane.texture = pl_tex_create(p->gpu, &(struct pl_tex_params) {
.w = width, .w = width,
.h = height, .h = height,
.d = 0, .d = 0,
@ -3645,7 +3646,7 @@ void make_osd_overlay(int x, int y, int width, int height)
.sample_mode = PL_TEX_SAMPLE_LINEAR, .sample_mode = PL_TEX_SAMPLE_LINEAR,
.address_mode = PL_TEX_ADDRESS_CLAMP, .address_mode = PL_TEX_ADDRESS_CLAMP,
}); });
}
// make overlay // make overlay
pl_tex_clear(p->gpu, pl->plane.texture, (float[4]) { 0 }); pl_tex_clear(p->gpu, pl->plane.texture, (float[4]) { 0 });
pl->plane.components = 4; pl->plane.components = 4;