diff options
author | Keith Packard <keithp@keithp.com> | 2008-04-29 08:29:42 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2008-11-24 13:24:41 -0800 |
commit | c4b9ab6bf56139fdd8c7c584a6f523c6766cddd6 (patch) | |
tree | db5240f90ba48ef609d0c650a4cf993732ebc370 /render | |
parent | 9c7679240ad90367693a462e288308b3fdc08f26 (diff) |
Handle transform failure when computing shadow damage area.
PictureTransformBounds can fail, when this happens, damage the entire screen
so that the shadow gets repainted correctly.
Diffstat (limited to 'render')
-rw-r--r-- | render/matrix.c | 7 | ||||
-rw-r--r-- | render/picturestr.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/render/matrix.c b/render/matrix.c index 603281ed6..560ee943e 100644 --- a/render/matrix.c +++ b/render/matrix.c @@ -84,7 +84,6 @@ _X_EXPORT Bool PictureTransformPoint (PictTransformPtr transform, PictVectorPtr vector) { - PictVector result; int i, j; xFixed_32_32 partial; xFixed_34_30 v[3]; @@ -227,7 +226,7 @@ PictureTransformTranslate (PictTransformPtr forward, return TRUE; } -_X_EXPORT void +_X_EXPORT Bool PictureTransformBounds (BoxPtr b, PictTransformPtr matrix) { PictVector v[4]; @@ -240,7 +239,8 @@ PictureTransformBounds (BoxPtr b, PictTransformPtr matrix) v[3].vector[0] = F (b->x1); v[3].vector[1] = F (b->y2); v[3].vector[2] = F(1); for (i = 0; i < 4; i++) { - PictureTransformPoint (matrix, &v[i]); + if (!PictureTransformPoint (matrix, &v[i])) + return FALSE; x1 = xFixedToInt (v[i].vector[0]); y1 = xFixedToInt (v[i].vector[1]); x2 = xFixedToInt (xFixedCeil (v[i].vector[0])); @@ -258,6 +258,7 @@ PictureTransformBounds (BoxPtr b, PictTransformPtr matrix) if (y2 > b->y2) b->y2 = y2; } } + return TRUE; } _X_EXPORT Bool diff --git a/render/picturestr.h b/render/picturestr.h index 4a7b6e754..ab5dc162a 100644 --- a/render/picturestr.h +++ b/render/picturestr.h @@ -724,7 +724,7 @@ PictureTransformTranslate (PictTransformPtr forward, PictTransformPtr reverse, xFixed tx, xFixed ty); -void +Bool PictureTransformBounds (BoxPtr b, PictTransformPtr matrix); Bool |