When setting identity transformations store them as NULL to prevent
authorSøren Sandmann Pedersen <sandmann@redhat.com>
Fri, 15 Jun 2007 18:33:57 +0000 (14:33 -0400)
committerSøren Sandmann Pedersen <sandmann@redhat.com>
Fri, 15 Jun 2007 18:34:37 +0000 (14:34 -0400)
hitting the general compositing code.

pixman/pixman-image.c

index 8657c31..c08e8fc 100644 (file)
@@ -371,11 +371,25 @@ pixman_bool_t
 pixman_image_set_transform (pixman_image_t           *image,
                            const pixman_transform_t *transform)
 {
+    static const pixman_transform_t id =
+    {
+       { { pixman_fixed_1, 0, 0 },
+         { 0, pixman_fixed_1, 0 },
+         { 0, 0, pixman_fixed_1 }
+       }
+    };
+    
     image_common_t *common = (image_common_t *)image;
 
     if (common->transform == transform)
        return TRUE;
 
+    if (memcmp (&id, transform, sizeof (pixman_transform_t)) == 0)
+    {
+       transform = NULL;
+       return TRUE;
+    }
+    
     if (common->transform)
        free (common->transform);