Commit ff9d1cd8 authored by Keith Packard's avatar Keith Packard

Add funcs to convert between protocol and pixman matrices

parent c2f254da
......@@ -222,7 +222,7 @@ PictureTransformTranslate (PictTransformPtr forward,
PictureTransformInitTranslate (&t, tx, ty);
if (!PictureTransformMultiply (forward, &t, forward))
return FALSE;
PictureTransformInitTranslate (&t, -tx, -ty);
if (!PictureTransformMultiply (reverse, reverse, &t))
return FALSE;
......@@ -349,3 +349,37 @@ PictureTransformIsInverse (PictTransform *a, PictTransform *b)
return PictureTransformIsIdentity (&t);
}
_X_EXPORT void
PictTransform_from_xRenderTransform (PictTransformPtr pict,
xRenderTransform *render)
{
pict->matrix[0][0] = render->matrix11;
pict->matrix[0][1] = render->matrix12;
pict->matrix[0][2] = render->matrix13;
pict->matrix[1][0] = render->matrix21;
pict->matrix[1][1] = render->matrix22;
pict->matrix[1][2] = render->matrix23;
pict->matrix[2][0] = render->matrix31;
pict->matrix[2][1] = render->matrix32;
pict->matrix[2][2] = render->matrix33;
}
void
xRenderTransform_from_PictTransform (xRenderTransform *render,
PictTransformPtr pict)
{
render->matrix11 = pict->matrix[0][0];
render->matrix12 = pict->matrix[0][1];
render->matrix13 = pict->matrix[0][2];
render->matrix21 = pict->matrix[1][0];
render->matrix22 = pict->matrix[1][1];
render->matrix23 = pict->matrix[1][2];
render->matrix31 = pict->matrix[2][0];
render->matrix32 = pict->matrix[2][1];
render->matrix33 = pict->matrix[2][2];
}
......@@ -719,13 +719,18 @@ PictureTransformIsUnit(PictTransform *t);
Bool
PictureTransformIsScale(PictTransform *t);
Bool
PictureTransformIsScale(PictTransform *t);
Bool
PictureTransformIsTranslate (PictTransform *t);
Bool
PictureTransformIsInverse(PictTransform *t, PictTransform *i);
void
PictTransform_from_xRenderTransform (PictTransformPtr pict,
xRenderTransform *render);
void
xRenderTransform_from_PictTransform (xRenderTransform *render,
PictTransformPtr pict);
#endif /* _PICTURESTR_H_ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment