player: rename --background to --background-color

This better represents what it actually does. --background will be used
for another, related option in the next commit.
This commit is contained in:
Dudemanguy 2024-02-21 09:48:51 -06:00
parent b7fd232524
commit c774b5f517
5 changed files with 12 additions and 11 deletions

View File

@ -57,6 +57,7 @@ Interface changes
- move the `options` argument of the `loadfile` command from the third
parameter to the fourth (after `index`)
- add `--drag-and-drop=insert-next` option
- rename `--background` to `--background-color`
--- mpv 0.37.0 ---
- `--save-position-on-quit` and its associated commands now store state files
in %LOCALAPPDATA% instead of %APPDATA% directory by default on Windows.

View File

@ -6946,7 +6946,7 @@ them.
any advantages over normal textures. Note that hardware decoding overrides
this flag. Could be removed any time.
``--background=<color>``
``--background-color=<color>``
Color used to draw parts of the mpv window not covered by video. See the
``--sub-color`` option for how colors are defined.

View File

@ -313,7 +313,7 @@ static const struct gl_video_opts gl_video_opts_def = {
.sigmoid_upscaling = true,
.interpolation_threshold = 0.01,
.alpha_mode = ALPHA_BLEND_TILES,
.background = {0, 0, 0, 255},
.background_color = {0, 0, 0, 255},
.gamma = 1.0f,
.tone_map = {
.curve = TONE_MAPPING_AUTO,
@ -453,7 +453,7 @@ const struct m_sub_options gl_video_conf = {
{"blend", ALPHA_BLEND},
{"blend-tiles", ALPHA_BLEND_TILES})},
{"opengl-rectangle-textures", OPT_BOOL(use_rectangle)},
{"background", OPT_COLOR(background)},
{"background-color", OPT_COLOR(background_color)},
{"interpolation", OPT_BOOL(interpolation)},
{"interpolation-threshold", OPT_FLOAT(interpolation_threshold)},
{"blend-subtitles", OPT_CHOICE(blend_subs,
@ -3088,7 +3088,7 @@ static void pass_draw_to_screen(struct gl_video *p, const struct ra_fbo *fbo, in
GLSL(color.a = 1.0;)
} else if (p->opts.alpha_mode == ALPHA_BLEND) {
// Blend into background color (usually black)
struct m_color c = p->opts.background;
struct m_color c = p->opts.background_color;
GLSLF("vec4 background = vec4(%f, %f, %f, %f);\n",
c.r / 255.0, c.g / 255.0, c.b / 255.0, c.a / 255.0);
GLSL(color.rgb += background.rgb * (1.0 - color.a);)
@ -3864,7 +3864,7 @@ static void check_gl_features(struct gl_video *p)
.fbo_format = p->opts.fbo_format,
.alpha_mode = p->opts.alpha_mode,
.use_rectangle = p->opts.use_rectangle,
.background = p->opts.background,
.background_color = p->opts.background_color,
.dither_algo = p->opts.dither_algo,
.dither_depth = p->opts.dither_depth,
.dither_size = p->opts.dither_size,
@ -4115,7 +4115,7 @@ static void reinit_from_options(struct gl_video *p)
p->opts = *(struct gl_video_opts *)p->opts_cache->opts;
if (!p->force_clear_color)
p->clear_color = p->opts.background;
p->clear_color = p->opts.background_color;
check_gl_features(p);
uninit_rendering(p);

View File

@ -157,7 +157,7 @@ struct gl_video_opts {
char *fbo_format;
int alpha_mode;
bool use_rectangle;
struct m_color background;
struct m_color background_color;
bool interpolation;
float interpolation_threshold;
int blend_subs;

View File

@ -2083,10 +2083,10 @@ static void update_render_options(struct vo *vo)
pl_options pars = p->pars;
const struct gl_video_opts *opts = p->opts_cache->opts;
pars->params.antiringing_strength = opts->scaler[0].antiring;
pars->params.background_color[0] = opts->background.r / 255.0;
pars->params.background_color[1] = opts->background.g / 255.0;
pars->params.background_color[2] = opts->background.b / 255.0;
pars->params.background_transparency = 1.0 - opts->background.a / 255.0;
pars->params.background_color[0] = opts->background_color.r / 255.0;
pars->params.background_color[1] = opts->background_color.g / 255.0;
pars->params.background_color[2] = opts->background_color.b / 255.0;
pars->params.background_transparency = 1 - opts->background_color.a / 255.0;
pars->params.skip_anti_aliasing = !opts->correct_downscaling;
pars->params.disable_linear_scaling = !opts->linear_downscaling && !opts->linear_upscaling;
pars->params.disable_fbos = opts->dumb_mode == 1;