xf86-video-intel: Branch 'modesetting' - src/i915_exa_render.c

Eric Anholt anholt at kemper.freedesktop.org
Mon Dec 18 20:40:48 EET 2006


 src/i915_exa_render.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

New commits:
diff-tree 2d0ca2202cb0d780bb4387bbe04e5caa6512e3b1 (from 6823ca87f3b1ef3b28ed167254dcfce2a80467df)
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Dec 18 10:37:33 2006 -0800

    Bug #8786: Treat pictures with no color data as non-component alpha.
    
    This is an un(der?)-documented part of the render protocol: If the mask is
    alpha only, then the component alpha flag is ignored on it.

diff --git a/src/i915_exa_render.c b/src/i915_exa_render.c
index daffa0c..cefa15c 100644
--- a/src/i915_exa_render.c
+++ b/src/i915_exa_render.c
@@ -142,7 +142,9 @@ static CARD32 I915GetBlendCntl(int op, P
      * the source blend factor is 0, and the source blend value is the mask
      * channels multiplied by the source picture's alpha.
      */
-    if (pMask && pMask->componentAlpha && I915BlendOp[op].src_alpha) {
+    if (pMask && pMask->componentAlpha && PICT_FORMAT_RGB(pMask->format) &&
+	I915BlendOp[op].src_alpha)
+    {
         if (dblend == BLENDFACT_SRC_ALPHA) {
 	    dblend = BLENDFACT_SRC_COLR;
         } else if (dblend == BLENDFACT_INV_SRC_ALPHA) {
@@ -228,7 +230,9 @@ I915EXACheckComposite(int op, PicturePtr
     /* Check for unsupported compositing operations. */
     if (op >= sizeof(I915BlendOp) / sizeof(I915BlendOp[0]))
         I830FALLBACK("Unsupported Composite op 0x%x\n", op);
-    if (pMaskPicture != NULL && pMaskPicture->componentAlpha) {
+    if (pMaskPicture != NULL && pMaskPicture->componentAlpha &&
+	PICT_FORMAT_RGB(pMaskPicture->format))
+    {
         /* Check if it's component alpha that relies on a source alpha and on
          * the source value.  We can only get one of those into the single
          * source value that we get to blend with.
@@ -463,7 +467,7 @@ I915EXAPrepareComposite(int op, PictureP
 	if (PICT_FORMAT_A(pMaskPicture->format) == 0)
 	    i915_fs_mov_masked(FS_R1, MASK_W, i915_fs_operand_one());
 
-	/* If component alpha is set in the mask and the blend operation
+	/* If component alpha is active in the mask and the blend operation
 	 * uses the source alpha, then we know we don't need the source
 	 * value (otherwise we would have hit a fallback earlier), so we
 	 * provide the source alpha (src.A * mask.X) as output color.
@@ -472,7 +476,9 @@ I915EXAPrepareComposite(int op, PictureP
 	 * is unused..  Otherwise, we provide the non-CA source value
 	 * (src.X * mask.A).
 	 */
-	if (pMaskPicture->componentAlpha) {
+	if (pMaskPicture->componentAlpha &&
+	    PICT_FORMAT_RGB(pMaskPicture->format))
+	{
 	    if (I915BlendOp[op].src_alpha) {
 		i915_fs_mul(FS_OC, i915_fs_operand(FS_R0, W, W, W, W),
 			    i915_fs_operand_reg(FS_R1));



More information about the xorg-commit mailing list