Add a FAST_PATH_X_UNIT_POSITIVE flag
authorSøren Sandmann Pedersen <ssp@redhat.com>
Wed, 17 Mar 2010 14:35:34 +0000 (10:35 -0400)
committerSøren Sandmann Pedersen <ssp@redhat.com>
Wed, 17 Mar 2010 15:03:05 +0000 (11:03 -0400)
This is the common case for a lot of transformed images. If the unit
were negative, the transformation would be a reflection which is
fairly rare.

pixman/pixman-image.c
pixman/pixman-private.h

index df5b457..9b44aa9 100644 (file)
@@ -301,15 +301,21 @@ compute_image_info (pixman_image_t *image)
     /* Transform */
     if (!image->common.transform)
     {
-       flags |= FAST_PATH_ID_TRANSFORM;
+       flags |= (FAST_PATH_ID_TRANSFORM | FAST_PATH_X_UNIT_POSITIVE);
     }
-    else if (image->common.transform->matrix[0][1] == 0 &&
-            image->common.transform->matrix[1][0] == 0 &&
-            image->common.transform->matrix[2][0] == 0 &&
-            image->common.transform->matrix[2][1] == 0 &&
-            image->common.transform->matrix[2][2] == pixman_fixed_1)
+    else
     {
-       flags |= FAST_PATH_SCALE_TRANSFORM;
+       if (image->common.transform->matrix[0][1] == 0 &&
+           image->common.transform->matrix[1][0] == 0 &&
+           image->common.transform->matrix[2][0] == 0 &&
+           image->common.transform->matrix[2][1] == 0 &&
+           image->common.transform->matrix[2][2] == pixman_fixed_1)
+       {
+           flags |= FAST_PATH_SCALE_TRANSFORM;
+       }
+
+       if (image->common.transform->matrix[0][0] > 0)
+           flags |= FAST_PATH_X_UNIT_POSITIVE;
     }
 
     /* Alpha map */
index 0cf9113..d5767af 100644 (file)
@@ -582,6 +582,7 @@ _pixman_choose_implementation (void);
 #define FAST_PATH_NO_NONE_REPEAT               (1 << 15)
 #define FAST_PATH_SAMPLES_COVER_CLIP           (1 << 16)
 #define FAST_PATH_16BIT_SAFE                   (1 << 17)
+#define FAST_PATH_X_UNIT_POSITIVE              (1 << 18)
 
 #define _FAST_PATH_STANDARD_FLAGS                                      \
     (FAST_PATH_ID_TRANSFORM            |                               \