diff options
author | Keith Packard <keithp@keithp.com> | 2008-03-13 14:50:13 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2008-11-24 13:24:36 -0800 |
commit | f547650328287545a7a4d96df8d6a6c606dd95a9 (patch) | |
tree | f0368c68c4c53ead3342c61d5cc9e34c2215eccc /render/picture.c | |
parent | e063162e80e51ed4368874b3af7ba690ea280d9e (diff) |
Export a bunch of matrix operations from render.
The render extension uses many matrix operations internally, this change
exposes those functions to other parts of the server, drivers and
extensions. The change is motivated by the 'transform' additions to the
RandR extension but will likely be useful elsewhere.
Diffstat (limited to 'render/picture.c')
-rw-r--r-- | render/picture.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/render/picture.c b/render/picture.c index fc2bf43d5..d672ebc8c 100644 --- a/render/picture.c +++ b/render/picture.c @@ -1780,67 +1780,3 @@ AddTraps (PicturePtr pPicture, (*ps->AddTraps) (pPicture, xOff, yOff, ntrap, traps); } -_X_EXPORT Bool -PictureTransformPoint3d (PictTransformPtr transform, - PictVectorPtr vector) -{ - PictVector result; - int i, j; - xFixed_32_32 partial; - xFixed_48_16 v; - - for (j = 0; j < 3; j++) - { - v = 0; - for (i = 0; i < 3; i++) - { - partial = ((xFixed_48_16) transform->matrix[j][i] * - (xFixed_48_16) vector->vector[i]); - v += partial >> 16; - } - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - result.vector[j] = (xFixed) v; - } - if (!result.vector[2]) - return FALSE; - *vector = result; - return TRUE; -} - - -_X_EXPORT Bool -PictureTransformPoint (PictTransformPtr transform, - PictVectorPtr vector) -{ - PictVector result; - int i, j; - xFixed_32_32 partial; - xFixed_48_16 v; - - for (j = 0; j < 3; j++) - { - v = 0; - for (i = 0; i < 3; i++) - { - partial = ((xFixed_48_16) transform->matrix[j][i] * - (xFixed_48_16) vector->vector[i]); - v += partial >> 16; - } - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - result.vector[j] = (xFixed) v; - } - if (!result.vector[2]) - return FALSE; - for (j = 0; j < 2; j++) - { - partial = (xFixed_48_16) result.vector[j] << 16; - v = partial / result.vector[2]; - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - vector->vector[j] = (xFixed) v; - } - vector->vector[2] = xFixed1; - return TRUE; -} |