X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=padding_effect.cpp;h=00d475ac2fb23995780920569ee09203abb91177;hp=40876b89e9a6edca0cf2c89146894c1d72f15070;hb=5c97329dd35909847e2120b0b368b2723ffe5a44;hpb=58e7b9a8164bdaad7b0c698b2d0d80db53d79a5c diff --git a/padding_effect.cpp b/padding_effect.cpp index 40876b8..00d475a 100644 --- a/padding_effect.cpp +++ b/padding_effect.cpp @@ -64,12 +64,16 @@ void PaddingEffect::set_gl_state(GLuint glsl_program_num, const std::string &pre // differently in different modes. // 0.0 and 1.0 are interpreted the same, no matter the gamma ramp. -// Alpha is not affected by gamma. +// Alpha is not affected by gamma per se, but the combination of +// premultiplied alpha and non-linear gamma curve does not make sense, +// so if could possibly be converting blank alpha to non-blank +// (ie., premultiplied), we need our output to be in linear light. bool PaddingEffect::needs_linear_light() const { if ((border_color.r == 0.0 || border_color.r == 1.0) && (border_color.g == 0.0 || border_color.g == 1.0) && - (border_color.b == 0.0 || border_color.b == 1.0)) { + (border_color.b == 0.0 || border_color.b == 1.0) && + border_color.a == 1.0) { return false; } return true;