Merge change 20502

* changes:
  we actually have to saturate when doing premultilied blending with opengl
This commit is contained in:
Android (Google) Code Review 2009-08-07 16:41:47 -07:00
commit 4e3fb86156

View file

@ -221,17 +221,7 @@ 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);
}
component_sat(temp);
}
} else {
// compute fs