summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2010-03-17 10:35:34 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2010-03-17 11:03:05 -0400
commit9cd1051523493e0926b146f05cdde34158391602 (patch)
tree8e5a820938e844542b664e861db7fca6c996e67a
parenta5b51bb03c5c1258d7558efa13eca6c570e34ce6 (diff)
Add a FAST_PATH_X_UNIT_POSITIVE flag
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.
-rw-r--r--pixman/pixman-image.c20
-rw-r--r--pixman/pixman-private.h1
2 files changed, 14 insertions, 7 deletions
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index df5b4574..9b44aa9d 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -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 */
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 0cf91134..d5767af4 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -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 | \