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
301b5d27
Commit
301b5d27
authored
Apr 06, 2009
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 06, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a couple of SetGraphicsMode/SetWorldTransform tests, make them pass under Wine.
parent
5fdf50f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
dc.c
dlls/gdi32/dc.c
+7
-2
mapping.c
dlls/gdi32/tests/mapping.c
+29
-0
No files found.
dlls/gdi32/dc.c
View file @
301b5d27
...
...
@@ -1200,10 +1200,12 @@ BOOL WINAPI GetTransform( HDC hdc, DWORD unknown, LPXFORM xform )
BOOL
WINAPI
SetWorldTransform
(
HDC
hdc
,
const
XFORM
*
xform
)
{
BOOL
ret
=
FALSE
;
DC
*
dc
=
get_dc_ptr
(
hdc
);
DC
*
dc
;
if
(
!
xform
)
return
FALSE
;
dc
=
get_dc_ptr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
if
(
!
xform
)
goto
done
;
/* Check that graphics mode is GM_ADVANCED */
if
(
dc
->
GraphicsMode
!=
GM_ADVANCED
)
goto
done
;
...
...
@@ -1211,6 +1213,9 @@ BOOL WINAPI SetWorldTransform( HDC hdc, const XFORM *xform )
TRACE
(
"eM11 %f eM12 %f eM21 %f eM22 %f eDx %f eDy %f
\n
"
,
xform
->
eM11
,
xform
->
eM12
,
xform
->
eM21
,
xform
->
eM22
,
xform
->
eDx
,
xform
->
eDy
);
/* The transform must conform to (eM11 * eM22 != eM12 * eM21) requirement */
if
(
xform
->
eM11
*
xform
->
eM22
==
xform
->
eM12
*
xform
->
eM21
)
goto
done
;
if
(
dc
->
funcs
->
pSetWorldTransform
)
{
ret
=
dc
->
funcs
->
pSetWorldTransform
(
dc
->
physDev
,
xform
);
...
...
dlls/gdi32/tests/mapping.c
View file @
301b5d27
...
...
@@ -85,6 +85,15 @@ static void test_world_transform(void)
hdc
=
CreateCompatibleDC
(
0
);
xform
.
eM11
=
1
.
0
f
;
xform
.
eM12
=
0
.
0
f
;
xform
.
eM21
=
0
.
0
f
;
xform
.
eM22
=
1
.
0
f
;
xform
.
eDx
=
0
.
0
f
;
xform
.
eDy
=
0
.
0
f
;
ret
=
SetWorldTransform
(
hdc
,
&
xform
);
ok
(
!
ret
,
"SetWorldTransform should fail in GM_COMPATIBLE mode
\n
"
);
size_cx
=
GetDeviceCaps
(
hdc
,
HORZSIZE
);
size_cy
=
GetDeviceCaps
(
hdc
,
VERTSIZE
);
res_x
=
GetDeviceCaps
(
hdc
,
HORZRES
);
...
...
@@ -144,6 +153,16 @@ static void test_world_transform(void)
expect_world_trasform
(
hdc
,
1
.
0
,
1
.
0
);
expect_LPtoDP
(
hdc
,
1000
,
1000
);
/* The transform must conform to (eM11 * eM22 != eM12 * eM21) requirement */
xform
.
eM11
=
1
.
0
f
;
xform
.
eM12
=
2
.
0
f
;
xform
.
eM21
=
1
.
0
f
;
xform
.
eM22
=
2
.
0
f
;
xform
.
eDx
=
0
.
0
f
;
xform
.
eDy
=
0
.
0
f
;
ret
=
SetWorldTransform
(
hdc
,
&
xform
);
ok
(
!
ret
,
"SetWorldTransform should fail with an invalid xform
\n
"
);
xform
.
eM11
=
20
.
0
f
;
xform
.
eM12
=
0
.
0
f
;
xform
.
eM21
=
0
.
0
f
;
...
...
@@ -183,6 +202,16 @@ static void test_world_transform(void)
expect_world_trasform
(
hdc
,
20
.
0
,
20
.
0
);
expect_LPtoDP
(
hdc
,
20000
,
20000
);
ret
=
SetGraphicsMode
(
hdc
,
GM_COMPATIBLE
);
ok
(
ret
,
"SetGraphicsMode(GM_COMPATIBLE) should not fail if DC has't an identity transform
\n
"
);
ret
=
GetGraphicsMode
(
hdc
);
ok
(
ret
==
GM_COMPATIBLE
,
"expected GM_COMPATIBLE, got %d
\n
"
,
ret
);
expect_viewport_ext
(
hdc
,
1
,
1
);
expect_window_ext
(
hdc
,
1
,
1
);
expect_world_trasform
(
hdc
,
20
.
0
,
20
.
0
);
expect_LPtoDP
(
hdc
,
20000
,
20000
);
DeleteDC
(
hdc
);
}
...
...
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