Skip to content
Snippets Groups Projects
Commit 665a2227 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

we actually have to saturate when doing premultilied blending with opengl

parent 6bc6794f
No related branches found
No related tags found
No related merge requests found
......@@ -221,18 +221,8 @@ void GGLAssembler::build_blending(
build_blend_factor(dst_factor, fd,
component, pixel, fragment, fb, scratches);
mul_factor_add(temp, fb, dst_factor, component_t(fragment));
if (fd==GGL_ONE_MINUS_SRC_ALPHA) {
// XXX: in theory this is not correct, we should
// saturate here. However, this mode is often
// used for displaying alpha-premultiplied graphics,
// in which case, saturation is not necessary.
// unfortunatelly, we have no way to know.
// This is a case, where we sacrifice correctness for
// performance. we should probably have some heuristics.
} else {
component_sat(temp);
}
}
} else {
// compute fs
build_blend_factor(src_factor, fs,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment