From 665a2227e5212c6a7452f080d87f377b8471a8b0 Mon Sep 17 00:00:00 2001 From: Mathias Agopian <mathias@google.com> Date: Fri, 7 Aug 2009 13:01:46 -0700 Subject: [PATCH] we actually have to saturate when doing premultilied blending with opengl --- libpixelflinger/codeflinger/blending.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/libpixelflinger/codeflinger/blending.cpp b/libpixelflinger/codeflinger/blending.cpp index f10217b74a..083042ce9d 100644 --- a/libpixelflinger/codeflinger/blending.cpp +++ b/libpixelflinger/codeflinger/blending.cpp @@ -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 -- GitLab