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
498b18f2
Commit
498b18f2
authored
Feb 14, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Feb 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add more EMF clipping tests.
parent
f1285514
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
1 deletion
+69
-1
metafile.c
dlls/gdi32/tests/metafile.c
+69
-1
No files found.
dlls/gdi32/tests/metafile.c
View file @
498b18f2
...
...
@@ -60,6 +60,20 @@ static void init_function_pointers(void)
GDI_GET_PROC
(
SetDCPenColor
);
}
static
DWORD
rgn_rect_count
(
HRGN
hrgn
)
{
DWORD
size
;
RGNDATA
*
data
;
if
(
!
hrgn
)
return
0
;
if
(
!
(
size
=
GetRegionData
(
hrgn
,
0
,
NULL
)))
return
0
;
if
(
!
(
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
return
0
;
GetRegionData
(
hrgn
,
size
,
data
);
size
=
data
->
rdh
.
nCount
;
HeapFree
(
GetProcessHeap
(),
0
,
data
);
return
size
;
}
static
int
CALLBACK
eto_emf_enum_proc
(
HDC
hdc
,
HANDLETABLE
*
handle_table
,
const
ENHMETARECORD
*
emr
,
int
n_objs
,
LPARAM
param
)
{
...
...
@@ -2481,10 +2495,64 @@ static void test_emf_clipping(void)
ret
=
GetClipBox
(
hdc
,
&
rc_res
);
ok
(
ret
==
SIMPLEREGION
,
"got %d
\n
"
,
ret
);
ok
(
EqualRect
(
&
rc_res
,
&
rc_sclip
),
"expected rc_res (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)
\n
"
,
"expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)
\n
"
,
rc_sclip
.
left
,
rc_sclip
.
top
,
rc_sclip
.
right
,
rc_sclip
.
bottom
,
rc_res
.
left
,
rc_res
.
top
,
rc_res
.
right
,
rc_res
.
bottom
);
OffsetRect
(
&
rc_sclip
,
-
100
,
-
100
);
ret
=
OffsetClipRgn
(
hdc
,
-
100
,
-
100
);
todo_wine
ok
(
ret
==
SIMPLEREGION
,
"got %d
\n
"
,
ret
);
SetRect
(
&
rc_res
,
-
1
,
-
1
,
-
1
,
-
1
);
ret
=
GetClipBox
(
hdc
,
&
rc_res
);
ok
(
ret
==
SIMPLEREGION
,
"got %d
\n
"
,
ret
);
todo_wine
ok
(
EqualRect
(
&
rc_res
,
&
rc_sclip
),
"expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)
\n
"
,
rc_sclip
.
left
,
rc_sclip
.
top
,
rc_sclip
.
right
,
rc_sclip
.
bottom
,
rc_res
.
left
,
rc_res
.
top
,
rc_res
.
right
,
rc_res
.
bottom
);
ret
=
IntersectClipRect
(
hdc
,
0
,
0
,
100
,
100
);
todo_wine
ok
(
ret
==
SIMPLEREGION
||
broken
(
ret
==
COMPLEXREGION
)
/* XP */
,
"got %d
\n
"
,
ret
);
if
(
ret
==
COMPLEXREGION
)
{
/* XP returns COMPLEXREGION although region contains only 1 rect */
ret
=
GetClipRgn
(
hdc
,
hrgn
);
ok
(
ret
==
1
,
"expected 1, got %d
\n
"
,
ret
);
ret
=
rgn_rect_count
(
hrgn
);
ok
(
ret
==
1
,
"expected 1, got %d
\n
"
,
ret
);
}
SetRect
(
&
rc_res
,
-
1
,
-
1
,
-
1
,
-
1
);
ret
=
GetClipBox
(
hdc
,
&
rc_res
);
ok
(
ret
==
SIMPLEREGION
,
"got %d
\n
"
,
ret
);
todo_wine
ok
(
EqualRect
(
&
rc_res
,
&
rc
),
"expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)
\n
"
,
rc
.
left
,
rc
.
top
,
rc
.
right
,
rc
.
bottom
,
rc_res
.
left
,
rc_res
.
top
,
rc_res
.
right
,
rc_res
.
bottom
);
SetRect
(
&
rc_sclip
,
0
,
0
,
100
,
50
);
ret
=
ExcludeClipRect
(
hdc
,
0
,
50
,
100
,
100
);
todo_wine
ok
(
ret
==
SIMPLEREGION
||
broken
(
ret
==
COMPLEXREGION
)
/* XP */
,
"got %d
\n
"
,
ret
);
if
(
ret
==
COMPLEXREGION
)
{
/* XP returns COMPLEXREGION although region contains only 1 rect */
ret
=
GetClipRgn
(
hdc
,
hrgn
);
ok
(
ret
==
1
,
"expected 1, got %d
\n
"
,
ret
);
ret
=
rgn_rect_count
(
hrgn
);
ok
(
ret
==
1
,
"expected 1, got %d
\n
"
,
ret
);
}
SetRect
(
&
rc_res
,
-
1
,
-
1
,
-
1
,
-
1
);
ret
=
GetClipBox
(
hdc
,
&
rc_res
);
ok
(
ret
==
SIMPLEREGION
,
"got %d
\n
"
,
ret
);
todo_wine
ok
(
EqualRect
(
&
rc_res
,
&
rc_sclip
),
"expected (%d,%d)-(%d,%d), got (%d,%d)-(%d,%d)
\n
"
,
rc
.
left
,
rc
.
top
,
rc
.
right
,
rc
.
bottom
,
rc_res
.
left
,
rc_res
.
top
,
rc_res
.
right
,
rc_res
.
bottom
);
hemf
=
CloseEnhMetaFile
(
hdc
);
DeleteEnhMetaFile
(
hemf
);
DeleteObject
(
hrgn
);
...
...
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