matrix.c revision 4642e01f
14642e01fSmrg/* 24642e01fSmrg * Copyright © 2007 Keith Packard 34642e01fSmrg * 44642e01fSmrg * Permission to use, copy, modify, distribute, and sell this software and its 54642e01fSmrg * documentation for any purpose is hereby granted without fee, provided that 64642e01fSmrg * the above copyright notice appear in all copies and that both that copyright 74642e01fSmrg * notice and this permission notice appear in supporting documentation, and 84642e01fSmrg * that the name of the copyright holders not be used in advertising or 94642e01fSmrg * publicity pertaining to distribution of the software without specific, 104642e01fSmrg * written prior permission. The copyright holders make no representations 114642e01fSmrg * about the suitability of this software for any purpose. It is provided "as 124642e01fSmrg * is" without express or implied warranty. 134642e01fSmrg * 144642e01fSmrg * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 154642e01fSmrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 164642e01fSmrg * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR 174642e01fSmrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 184642e01fSmrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 194642e01fSmrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 204642e01fSmrg * OF THIS SOFTWARE. 214642e01fSmrg */ 224642e01fSmrg 234642e01fSmrg#ifdef HAVE_DIX_CONFIG_H 244642e01fSmrg#include <dix-config.h> 254642e01fSmrg#endif 264642e01fSmrg 274642e01fSmrg#include "misc.h" 284642e01fSmrg#include "scrnintstr.h" 294642e01fSmrg#include "os.h" 304642e01fSmrg#include "regionstr.h" 314642e01fSmrg#include "validate.h" 324642e01fSmrg#include "windowstr.h" 334642e01fSmrg#include "input.h" 344642e01fSmrg#include "resource.h" 354642e01fSmrg#include "colormapst.h" 364642e01fSmrg#include "cursorstr.h" 374642e01fSmrg#include "dixstruct.h" 384642e01fSmrg#include "gcstruct.h" 394642e01fSmrg#include "servermd.h" 404642e01fSmrg#include "picturestr.h" 414642e01fSmrg 424642e01fSmrg_X_EXPORT void 434642e01fSmrgPictTransform_from_xRenderTransform (PictTransformPtr pict, 444642e01fSmrg xRenderTransform *render) 454642e01fSmrg{ 464642e01fSmrg pict->matrix[0][0] = render->matrix11; 474642e01fSmrg pict->matrix[0][1] = render->matrix12; 484642e01fSmrg pict->matrix[0][2] = render->matrix13; 494642e01fSmrg 504642e01fSmrg pict->matrix[1][0] = render->matrix21; 514642e01fSmrg pict->matrix[1][1] = render->matrix22; 524642e01fSmrg pict->matrix[1][2] = render->matrix23; 534642e01fSmrg 544642e01fSmrg pict->matrix[2][0] = render->matrix31; 554642e01fSmrg pict->matrix[2][1] = render->matrix32; 564642e01fSmrg pict->matrix[2][2] = render->matrix33; 574642e01fSmrg} 584642e01fSmrg 594642e01fSmrg_X_EXPORT void 604642e01fSmrgxRenderTransform_from_PictTransform (xRenderTransform *render, 614642e01fSmrg PictTransformPtr pict) 624642e01fSmrg{ 634642e01fSmrg render->matrix11 = pict->matrix[0][0]; 644642e01fSmrg render->matrix12 = pict->matrix[0][1]; 654642e01fSmrg render->matrix13 = pict->matrix[0][2]; 664642e01fSmrg 674642e01fSmrg render->matrix21 = pict->matrix[1][0]; 684642e01fSmrg render->matrix22 = pict->matrix[1][1]; 694642e01fSmrg render->matrix23 = pict->matrix[1][2]; 704642e01fSmrg 714642e01fSmrg render->matrix31 = pict->matrix[2][0]; 724642e01fSmrg render->matrix32 = pict->matrix[2][1]; 734642e01fSmrg render->matrix33 = pict->matrix[2][2]; 744642e01fSmrg} 754642e01fSmrg 764642e01fSmrg_X_EXPORT Bool 774642e01fSmrgPictureTransformPoint (PictTransformPtr transform, 784642e01fSmrg PictVectorPtr vector) 794642e01fSmrg{ 804642e01fSmrg return pixman_transform_point(transform, vector); 814642e01fSmrg} 824642e01fSmrg 834642e01fSmrg_X_EXPORT Bool 844642e01fSmrgPictureTransformPoint3d (PictTransformPtr transform, 854642e01fSmrg PictVectorPtr vector) 864642e01fSmrg{ 874642e01fSmrg return pixman_transform_point_3d(transform, vector); 884642e01fSmrg} 89