compositor: paint opaque regions with RGBX shader
authorPekka Paalanen <ppaalanen@gmail.com>
Mon, 3 Sep 2012 13:48:42 +0000 (16:48 +0300)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 4 Sep 2012 20:14:35 +0000 (16:14 -0400)
commit2abe2e6d41c3460d6306dcd547fe58740c68f0ca
tree396e923224c99a2fd78a4dcd777a4c22bf5ea9cd
parent4f9c07bf11f90ddb81cae56bf92f88d1c25ed39b
compositor: paint opaque regions with RGBX shader

weston_surface_draw() is restructured so that it will always use the
RGBX shader for opaque regions, if the surface is assigned the RGBA
shader.

Previously for opaque regions, we simply assumed, that the texture alpha
would be 1.0. If it was not (which really is an application bug), the
region would be misrendered. The RGBX shader forces the texture alpha to
1.0.

Xwayland surfaces may have bad alpha data in the opaque client area. If
blending was enabled, the bad alpha would be used with the RGBA shader.
This patch fixes rendering opaque xwayland windows with full-surface
alpha applied.

Test case: xterm, with full-surface alpha one step below 1.0. Before,
black text was fully transparent, now it is correctly only slightly
transparent.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
src/compositor.c