pixman: Branch 'master'
Eric Anholt
anholt at kemper.freedesktop.org
Mon Aug 20 13:03:06 PDT 2007
pixman/pixman-image.c | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
New commits:
diff-tree 9c09561a91debfd7c77a39b337b51b2ab16d6da9 (from c7bec5898891f3077986c141b48e5ff77f1d5046)
Author: Eric Anholt <eric at anholt.net>
Date: Mon Aug 20 12:58:47 2007 -0700
Fix failure to set identity transform in pixman.
While here, optimize out a free/malloc in the case where a transform
existed previously and the new transform is non-identity.
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 2cbf88c..32ffaee 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -403,25 +403,17 @@ pixman_image_set_transform (pixman_image
if (memcmp (&id, transform, sizeof (pixman_transform_t)) == 0)
{
- transform = NULL;
+ free(common->transform);
+ common->transform = NULL;
return TRUE;
}
- if (common->transform)
- free (common->transform);
-
- if (transform)
- {
+ if (common->transform == NULL)
common->transform = malloc (sizeof (pixman_transform_t));
- if (!common->transform)
- return FALSE;
+ if (common->transform == NULL)
+ return FALSE;
- *common->transform = *transform;
- }
- else
- {
- common->transform = NULL;
- }
+ memcpy(common->transform, transform, sizeof(pixman_transform_t));
return TRUE;
}
More information about the xorg-commit
mailing list