summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorTilman Sauerbeck <tilman@code-monkey.de>2006-09-11 19:43:09 +0200
committerTilman Sauerbeck <tilman@code-monkey.de>2006-09-11 19:43:09 +0200
commitfc30370d14125f86ee1192890a184881fa139546 (patch)
treec7265b3827d71377922b294276c79e78ed3fe219 /render
parent2b357e9a2f9038cf9cd07da908e3103a3d0965c9 (diff)
Bug #8226: Fixed SetPictureTransform()'s handling of the argument matrix.
It now recognizes scaled variants of the identity matrix, too.
Diffstat (limited to 'render')
-rw-r--r--render/picture.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/render/picture.c b/render/picture.c
index 566d91e09..a9910ab27 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -1459,18 +1459,24 @@ SetPictureClipRegion (PicturePtr pPicture,
return result;
}
+static Bool
+transformIsIdentity(PictTransform *t)
+{
+ return ((t->matrix[0][0] == t->matrix[1][1]) &&
+ (t->matrix[0][0] == t->matrix[2][2]) &&
+ (t->matrix[0][1] == 0) &&
+ (t->matrix[0][2] == 0) &&
+ (t->matrix[1][0] == 0) &&
+ (t->matrix[1][2] == 0) &&
+ (t->matrix[2][0] == 0) &&
+ (t->matrix[2][1] == 0));
+}
int
SetPictureTransform (PicturePtr pPicture,
PictTransform *transform)
{
- static const PictTransform identity = { {
- { xFixed1, 0x00000, 0x00000 },
- { 0x00000, xFixed1, 0x00000 },
- { 0x00000, 0x00000, xFixed1 },
- } };
-
- if (transform && memcmp (transform, &identity, sizeof (PictTransform)) == 0)
+ if (transform && transformIsIdentity (transform))
transform = 0;
if (transform)