Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
4ea173ef
Commit
4ea173ef
authored
Jul 08, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 08, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implemented GdipShearMatrix with tests.
parent
ca12410f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
1 deletion
+99
-1
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
matrix.c
dlls/gdiplus/matrix.c
+24
-0
matrix.c
dlls/gdiplus/tests/matrix.c
+73
-0
gdiplusflat.h
include/gdiplusflat.h
+1
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
4ea173ef
...
@@ -598,7 +598,7 @@
...
@@ -598,7 +598,7 @@
@ stdcall GdipSetTextureTransform(ptr ptr)
@ stdcall GdipSetTextureTransform(ptr ptr)
@ stub GdipSetTextureWrapMode
@ stub GdipSetTextureWrapMode
@ stdcall GdipSetWorldTransform(ptr ptr)
@ stdcall GdipSetWorldTransform(ptr ptr)
@ st
ub GdipShearMatrix
@ st
dcall GdipShearMatrix(ptr long long long)
@ stdcall GdipStartPathFigure(ptr)
@ stdcall GdipStartPathFigure(ptr)
@ stub GdipStringFormatGetGenericDefault
@ stub GdipStringFormatGetGenericDefault
@ stub GdipStringFormatGetGenericTypographic
@ stub GdipStringFormatGetGenericTypographic
...
...
dlls/gdiplus/matrix.c
View file @
4ea173ef
...
@@ -280,6 +280,30 @@ GpStatus WINGDIPAPI GdipSetMatrixElements(GpMatrix *matrix, REAL m11, REAL m12,
...
@@ -280,6 +280,30 @@ GpStatus WINGDIPAPI GdipSetMatrixElements(GpMatrix *matrix, REAL m11, REAL m12,
return
Ok
;
return
Ok
;
}
}
GpStatus
WINGDIPAPI
GdipShearMatrix
(
GpMatrix
*
matrix
,
REAL
shearX
,
REAL
shearY
,
GpMatrixOrder
order
)
{
REAL
shear
[
6
];
if
(
!
matrix
)
return
InvalidParameter
;
/* prepare transformation matrix */
shear
[
0
]
=
1
.
0
;
shear
[
1
]
=
shearY
;
shear
[
2
]
=
shearX
;
shear
[
3
]
=
1
.
0
;
shear
[
4
]
=
0
.
0
;
shear
[
5
]
=
0
.
0
;
if
(
order
==
MatrixOrderAppend
)
matrix_multiply
(
matrix
->
matrix
,
shear
,
matrix
->
matrix
);
else
matrix_multiply
(
shear
,
matrix
->
matrix
,
matrix
->
matrix
);
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipTransformMatrixPoints
(
GpMatrix
*
matrix
,
GpPointF
*
pts
,
GpStatus
WINGDIPAPI
GdipTransformMatrixPoints
(
GpMatrix
*
matrix
,
GpPointF
*
pts
,
INT
count
)
INT
count
)
{
{
...
...
dlls/gdiplus/tests/matrix.c
View file @
4ea173ef
...
@@ -149,6 +149,78 @@ static void test_invert(void)
...
@@ -149,6 +149,78 @@ static void test_invert(void)
GdipDeleteMatrix
(
matrix
);
GdipDeleteMatrix
(
matrix
);
}
}
static
void
test_shear
(
void
)
{
GpStatus
status
;
GpMatrix
*
matrix
=
NULL
;
GpMatrix
*
sheared
=
NULL
;
BOOL
equal
;
/* NULL */
status
=
GdipShearMatrix
(
NULL
,
0
.
0
,
0
.
0
,
MatrixOrderPrepend
);
expect
(
InvalidParameter
,
status
);
/* X only shearing, MatrixOrderPrepend */
GdipCreateMatrix2
(
1
.
0
,
2
.
0
,
4
.
0
,
-
1
.
0
,
6
.
0
,
3
.
0
,
&
matrix
);
status
=
GdipShearMatrix
(
matrix
,
1
.
5
,
0
.
0
,
MatrixOrderPrepend
);
expect
(
Ok
,
status
);
GdipCreateMatrix2
(
1
.
0
,
2
.
0
,
5
.
5
,
2
.
0
,
6
.
0
,
3
.
0
,
&
sheared
);
GdipIsMatrixEqual
(
matrix
,
sheared
,
&
equal
);
expect
(
TRUE
,
equal
);
GdipDeleteMatrix
(
sheared
);
GdipDeleteMatrix
(
matrix
);
/* X only shearing, MatrixOrderAppend */
GdipCreateMatrix2
(
1
.
0
,
2
.
0
,
4
.
0
,
-
1
.
0
,
6
.
0
,
3
.
0
,
&
matrix
);
status
=
GdipShearMatrix
(
matrix
,
1
.
5
,
0
.
0
,
MatrixOrderAppend
);
expect
(
Ok
,
status
);
GdipCreateMatrix2
(
4
.
0
,
2
.
0
,
2
.
5
,
-
1
.
0
,
10
.
5
,
3
.
0
,
&
sheared
);
GdipIsMatrixEqual
(
matrix
,
sheared
,
&
equal
);
expect
(
TRUE
,
equal
);
GdipDeleteMatrix
(
sheared
);
GdipDeleteMatrix
(
matrix
);
/* Y only shearing, MatrixOrderPrepend */
GdipCreateMatrix2
(
1
.
0
,
2
.
0
,
4
.
0
,
-
1
.
0
,
6
.
0
,
3
.
0
,
&
matrix
);
status
=
GdipShearMatrix
(
matrix
,
0
.
0
,
1
.
5
,
MatrixOrderPrepend
);
expect
(
Ok
,
status
);
GdipCreateMatrix2
(
7
.
0
,
0
.
5
,
4
.
0
,
-
1
.
0
,
6
.
0
,
3
.
0
,
&
sheared
);
GdipIsMatrixEqual
(
matrix
,
sheared
,
&
equal
);
expect
(
TRUE
,
equal
);
GdipDeleteMatrix
(
sheared
);
GdipDeleteMatrix
(
matrix
);
/* Y only shearing, MatrixOrderAppend */
GdipCreateMatrix2
(
1
.
0
,
2
.
0
,
4
.
0
,
-
1
.
0
,
6
.
0
,
3
.
0
,
&
matrix
);
status
=
GdipShearMatrix
(
matrix
,
0
.
0
,
1
.
5
,
MatrixOrderAppend
);
expect
(
Ok
,
status
);
GdipCreateMatrix2
(
1
.
0
,
3
.
5
,
4
.
0
,
5
.
0
,
6
.
0
,
12
.
0
,
&
sheared
);
GdipIsMatrixEqual
(
matrix
,
sheared
,
&
equal
);
expect
(
TRUE
,
equal
);
GdipDeleteMatrix
(
sheared
);
GdipDeleteMatrix
(
matrix
);
/* X,Y shearing, MatrixOrderPrepend */
GdipCreateMatrix2
(
1
.
0
,
2
.
0
,
4
.
0
,
-
1
.
0
,
6
.
0
,
3
.
0
,
&
matrix
);
status
=
GdipShearMatrix
(
matrix
,
4
.
0
,
1
.
5
,
MatrixOrderPrepend
);
expect
(
Ok
,
status
);
GdipCreateMatrix2
(
7
.
0
,
0
.
5
,
8
.
0
,
7
.
0
,
6
.
0
,
3
.
0
,
&
sheared
);
GdipIsMatrixEqual
(
matrix
,
sheared
,
&
equal
);
expect
(
TRUE
,
equal
);
GdipDeleteMatrix
(
sheared
);
GdipDeleteMatrix
(
matrix
);
/* X,Y shearing, MatrixOrderAppend */
GdipCreateMatrix2
(
1
.
0
,
2
.
0
,
4
.
0
,
-
1
.
0
,
6
.
0
,
3
.
0
,
&
matrix
);
status
=
GdipShearMatrix
(
matrix
,
4
.
0
,
1
.
5
,
MatrixOrderAppend
);
expect
(
Ok
,
status
);
GdipCreateMatrix2
(
9
.
0
,
3
.
5
,
0
.
0
,
5
.
0
,
18
.
0
,
12
.
0
,
&
sheared
);
GdipIsMatrixEqual
(
matrix
,
sheared
,
&
equal
);
expect
(
TRUE
,
equal
);
GdipDeleteMatrix
(
sheared
);
GdipDeleteMatrix
(
matrix
);
}
START_TEST
(
matrix
)
START_TEST
(
matrix
)
{
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
@@ -165,6 +237,7 @@ START_TEST(matrix)
...
@@ -165,6 +237,7 @@ START_TEST(matrix)
test_transform
();
test_transform
();
test_isinvertible
();
test_isinvertible
();
test_invert
();
test_invert
();
test_shear
();
GdiplusShutdown
(
gdiplusToken
);
GdiplusShutdown
(
gdiplusToken
);
}
}
include/gdiplusflat.h
View file @
4ea173ef
...
@@ -263,6 +263,7 @@ GpStatus WINGDIPAPI GdipCreateMatrix2(REAL,REAL,REAL,REAL,REAL,REAL,GpMatrix**);
...
@@ -263,6 +263,7 @@ GpStatus WINGDIPAPI GdipCreateMatrix2(REAL,REAL,REAL,REAL,REAL,REAL,GpMatrix**);
GpStatus
WINGDIPAPI
GdipCreateMatrix3
(
GDIPCONST
GpRectF
*
,
GDIPCONST
GpPointF
*
,
GpMatrix
**
);
GpStatus
WINGDIPAPI
GdipCreateMatrix3
(
GDIPCONST
GpRectF
*
,
GDIPCONST
GpPointF
*
,
GpMatrix
**
);
GpStatus
WINGDIPAPI
GdipCreateMatrix3I
(
GDIPCONST
GpRect
*
,
GDIPCONST
GpPoint
*
,
GpMatrix
**
);
GpStatus
WINGDIPAPI
GdipCreateMatrix3I
(
GDIPCONST
GpRect
*
,
GDIPCONST
GpPoint
*
,
GpMatrix
**
);
GpStatus
WINGDIPAPI
GdipInvertMatrix
(
GpMatrix
*
);
GpStatus
WINGDIPAPI
GdipInvertMatrix
(
GpMatrix
*
);
GpStatus
WINGDIPAPI
GdipShearMatrix
(
GpMatrix
*
,
REAL
,
REAL
,
GpMatrixOrder
);
GpStatus
WINGDIPAPI
GdipIsMatrixEqual
(
GDIPCONST
GpMatrix
*
,
GDIPCONST
GpMatrix
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsMatrixEqual
(
GDIPCONST
GpMatrix
*
,
GDIPCONST
GpMatrix
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsMatrixIdentity
(
GDIPCONST
GpMatrix
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsMatrixIdentity
(
GDIPCONST
GpMatrix
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsMatrixInvertible
(
GDIPCONST
GpMatrix
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsMatrixInvertible
(
GDIPCONST
GpMatrix
*
,
BOOL
*
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment