Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Helix Graziani
wine
Commits
a97911fd
Commit
a97911fd
authored
2 years ago
by
Bartosz Kosiorek
Committed by
Alexandre Julliard
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
gdiplus: Improve performance of GdipScaleMatrix.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53947
parent
96692a2c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/gdiplus/matrix.c
+14
-11
14 additions, 11 deletions
dlls/gdiplus/matrix.c
dlls/gdiplus/tests/matrix.c
+41
-0
41 additions, 0 deletions
dlls/gdiplus/tests/matrix.c
with
55 additions
and
11 deletions
dlls/gdiplus/matrix.c
+
14
−
11
View file @
a97911fd
...
...
@@ -287,24 +287,27 @@ GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix *matrix, REAL angle,
GpStatus
WINGDIPAPI
GdipScaleMatrix
(
GpMatrix
*
matrix
,
REAL
scaleX
,
REAL
scaleY
,
GpMatrixOrder
order
)
{
REAL
scale
[
6
];
TRACE
(
"(%p, %.2f, %.2f, %d)
\n
"
,
matrix
,
scaleX
,
scaleY
,
order
);
if
(
!
matrix
)
return
InvalidParameter
;
scale
[
0
]
=
scaleX
;
scale
[
1
]
=
0
.
0
;
scale
[
2
]
=
0
.
0
;
scale
[
3
]
=
scaleY
;
scale
[
4
]
=
0
.
0
;
scale
[
5
]
=
0
.
0
;
if
(
order
==
MatrixOrderAppend
)
matrix_multiply
(
matrix
->
matrix
,
scale
,
matrix
->
matrix
);
{
matrix
->
matrix
[
0
]
*=
scaleX
;
matrix
->
matrix
[
1
]
*=
scaleY
;
matrix
->
matrix
[
2
]
*=
scaleX
;
matrix
->
matrix
[
3
]
*=
scaleY
;
matrix
->
matrix
[
4
]
*=
scaleX
;
matrix
->
matrix
[
5
]
*=
scaleY
;
}
else
if
(
order
==
MatrixOrderPrepend
)
matrix_multiply
(
scale
,
matrix
->
matrix
,
matrix
->
matrix
);
{
matrix
->
matrix
[
0
]
*=
scaleX
;
matrix
->
matrix
[
1
]
*=
scaleX
;
matrix
->
matrix
[
2
]
*=
scaleY
;
matrix
->
matrix
[
3
]
*=
scaleY
;
}
else
return
InvalidParameter
;
...
...
This diff is collapsed.
Click to expand it.
dlls/gdiplus/tests/matrix.c
+
41
−
0
View file @
a97911fd
...
...
@@ -110,6 +110,46 @@ static void test_transform(void)
GdipDeleteMatrix
(
matrix
);
}
static
void
test_scale
(
void
)
{
GpStatus
status
;
GpMatrix
*
matrix
=
NULL
;
REAL
elems
[
6
];
int
i
;
static
const
REAL
expected_elem
[]
=
{
3
.
0
,
-
4
.
0
,
90
.
0
,
80
.
0
,
-
1500
.
0
,
1200
.
0
};
static
const
REAL
expected_elem2
[]
=
{
3
.
0
,
-
6
.
0
,
60
.
0
,
80
.
0
,
-
500
.
0
,
600
.
0
};
GdipCreateMatrix2
(
1
.
0
,
-
2
.
0
,
30
.
0
,
40
.
0
,
-
500
.
0
,
600
.
0
,
&
matrix
);
status
=
GdipScaleMatrix
(
NULL
,
3
,
2
,
MatrixOrderAppend
);
expect
(
InvalidParameter
,
status
);
status
=
GdipScaleMatrix
(
matrix
,
3
,
2
,
MatrixOrderAppend
);
expect
(
Ok
,
status
);
status
=
GdipGetMatrixElements
(
matrix
,
elems
);
expect
(
Ok
,
status
);
GdipDeleteMatrix
(
matrix
);
for
(
i
=
0
;
i
<
6
;
i
++
)
ok
(
expected_elem
[
i
]
==
elems
[
i
],
"Expected #%d to be (%.1f) but got (%.1f)
\n
"
,
i
,
expected_elem
[
i
],
elems
[
i
]);
GdipCreateMatrix2
(
1
.
0
,
-
2
.
0
,
30
.
0
,
40
.
0
,
-
500
.
0
,
600
.
0
,
&
matrix
);
status
=
GdipScaleMatrix
(
matrix
,
3
,
2
,
MatrixOrderPrepend
);
expect
(
Ok
,
status
);
status
=
GdipGetMatrixElements
(
matrix
,
elems
);
expect
(
Ok
,
status
);
GdipDeleteMatrix
(
matrix
);
for
(
i
=
0
;
i
<
6
;
i
++
)
ok
(
expected_elem2
[
i
]
==
elems
[
i
],
"Expected #%d to be (%.1f) but got (%.1f)
\n
"
,
i
,
expected_elem2
[
i
],
elems
[
i
]);
}
static
void
test_isinvertible
(
void
)
{
GpStatus
status
;
...
...
@@ -390,6 +430,7 @@ START_TEST(matrix)
GdiplusStartup
(
&
gdiplusToken
,
&
gdiplusStartupInput
,
NULL
);
test_constructor_destructor
();
test_scale
();
test_transform
();
test_isinvertible
();
test_invert
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment