Smplify the 1x1r optimization for the general compositing and fix the
authorSøren Sandmann Pedersen <sandmann@redhat.com>
Tue, 19 Jun 2007 14:46:36 +0000 (10:46 -0400)
committerSøren Sandmann Pedersen <sandmann@redhat.com>
Tue, 19 Jun 2007 14:46:36 +0000 (10:46 -0400)
1xn and nx1 cases.

pixman/pixman-pict.c

index ddd81f4..57bd7d6 100644 (file)
@@ -1857,30 +1857,25 @@ pixman_image_composite (pixman_op_t      op,
        func = pixman_image_composite_rect;
 
        /* CompositeGeneral optimizes 1x1 repeating images itself */
-       if (pSrc->type == BITS)
+       if (pSrc->type == BITS &&
+           pSrc->bits.width == 1 && pSrc->bits.height == 1)
        {
-           srcRepeat =
-               pSrc->common.repeat == PIXMAN_REPEAT_NORMAL     &&
-               !pSrc->common.transform                         &&
-               pSrc->bits.width != 1                           &&
-               pSrc->bits.height != 1;
+           srcRepeat = FALSE;
        }
-
-       if (pMask && pMask->type == BITS)
+       
+       if (pMask && pMask->type == BITS &&
+           pMask->bits.width == 1 && pMask->bits.height == 1)
        {
-           maskRepeat =
-               pMask->common.repeat == PIXMAN_REPEAT_NORMAL    &&
-               !pMask->common.transform                        &&
-               pMask->bits.width != 1                          &&
-               pMask->bits.height != 1;
+           maskRepeat = FALSE;
        }
-    }
 
-    /* if we are transforming, we handle repeats in fbFetchTransformed */
-    if (srcTransform)
-       srcRepeat = FALSE;
-    if (maskTransform)
-       maskRepeat = FALSE;
+       /* if we are transforming, repeats are handled in fbFetchTransformed */
+       if (srcTransform)
+           srcRepeat = FALSE;
+       
+       if (maskTransform)
+           maskTransform = FALSE;
+    }
 
     pixman_walk_composite_region (op, pSrc, pMask, pDst, xSrc, ySrc,
                                  xMask, yMask, xDst, yDst, width, height,