d2d1: Implement D2D1MakeRotateMatrix().
This commit is contained in:
parent
c903192243
commit
6944803ccc
|
@ -1,5 +1,5 @@
|
|||
@ stdcall D2D1CreateFactory(long ptr ptr ptr)
|
||||
@ stub D2D1MakeRotateMatrix
|
||||
@ stdcall D2D1MakeRotateMatrix(float float float ptr)
|
||||
@ stub D2D1MakeSkewMatrix
|
||||
@ stub D2D1IsMatrixInvertible
|
||||
@ stub D2D1InvertMatrix
|
||||
|
|
|
@ -264,3 +264,22 @@ HRESULT WINAPI D2D1CreateFactory(D2D1_FACTORY_TYPE factory_type, REFIID iid,
|
|||
|
||||
return hr;
|
||||
}
|
||||
|
||||
void WINAPI D2D1MakeRotateMatrix(float angle, D2D1_POINT_2F center, D2D1_MATRIX_3X2_F *matrix)
|
||||
{
|
||||
float theta, sin_theta, cos_theta;
|
||||
|
||||
TRACE("angle %.8e, center {%.8e, %.8e}, matrix %p.\n", angle, center.x, center.y, matrix);
|
||||
|
||||
theta = angle * (M_PI / 180.0f);
|
||||
sin_theta = sinf(theta);
|
||||
cos_theta = cosf(theta);
|
||||
|
||||
/* translate(center) * rotate(theta) * translate(-center) */
|
||||
matrix->_11 = cos_theta;
|
||||
matrix->_12 = sin_theta;
|
||||
matrix->_21 = -sin_theta;
|
||||
matrix->_22 = cos_theta;
|
||||
matrix->_31 = center.x - center.x * cos_theta + center.y * sin_theta;
|
||||
matrix->_32 = center.y - center.x * sin_theta - center.y * cos_theta;
|
||||
}
|
||||
|
|
|
@ -1248,3 +1248,4 @@ interface ID2D1Factory : IUnknown
|
|||
|
||||
[local] HRESULT __stdcall D2D1CreateFactory(D2D1_FACTORY_TYPE factory_type, REFIID iid,
|
||||
const D2D1_FACTORY_OPTIONS *factory_options, void **factory);
|
||||
[local] void __stdcall D2D1MakeRotateMatrix(float angle, D2D1_POINT_2F center, D2D1_MATRIX_3X2_F *matrix);
|
||||
|
|
Loading…
Reference in New Issue