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
4f8751a5
Commit
4f8751a5
authored
Nov 24, 2008
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipGetRegionHRgn for empty regions.
parent
74d62bcc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
region.c
dlls/gdiplus/region.c
+3
-0
region.c
dlls/gdiplus/tests/region.c
+59
-0
No files found.
dlls/gdiplus/region.c
View file @
4f8751a5
...
...
@@ -775,6 +775,9 @@ static GpStatus get_region_hrgn(struct region_element *element, GpGraphics *grap
case
RegionDataInfiniteRect
:
*
hrgn
=
NULL
;
return
Ok
;
case
RegionDataEmptyRect
:
*
hrgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
return
*
hrgn
?
Ok
:
OutOfMemory
;
default:
FIXME
(
"GdipGetRegionHRgn unimplemented for region type=%x
\n
"
,
element
->
type
);
*
hrgn
=
NULL
;
...
...
dlls/gdiplus/tests/region.c
View file @
4f8751a5
...
...
@@ -49,6 +49,57 @@ typedef struct RegionDataPoint
short
X
,
Y
;
}
RegionDataPoint
;
static
void
verify_region
(
HRGN
hrgn
,
const
RECT
*
rc
)
{
union
{
RGNDATA
data
;
char
buf
[
sizeof
(
RGNDATAHEADER
)
+
sizeof
(
RECT
)];
}
rgn
;
const
RECT
*
rect
;
DWORD
ret
;
ret
=
GetRegionData
(
hrgn
,
0
,
NULL
);
if
(
IsRectEmpty
(
rc
))
ok
(
ret
==
sizeof
(
rgn
.
data
.
rdh
),
"expected sizeof(rdh), got %u
\n
"
,
ret
);
else
ok
(
ret
==
sizeof
(
rgn
.
data
.
rdh
)
+
sizeof
(
RECT
),
"expected sizeof(rgn), got %u
\n
"
,
ret
);
if
(
!
ret
)
return
;
ret
=
GetRegionData
(
hrgn
,
sizeof
(
rgn
),
&
rgn
.
data
);
if
(
IsRectEmpty
(
rc
))
ok
(
ret
==
sizeof
(
rgn
.
data
.
rdh
),
"expected sizeof(rdh), got %u
\n
"
,
ret
);
else
ok
(
ret
==
sizeof
(
rgn
.
data
.
rdh
)
+
sizeof
(
RECT
),
"expected sizeof(rgn), got %u
\n
"
,
ret
);
trace
(
"size %u, type %u, count %u, rgn size %u, bound (%d,%d-%d,%d)
\n
"
,
rgn
.
data
.
rdh
.
dwSize
,
rgn
.
data
.
rdh
.
iType
,
rgn
.
data
.
rdh
.
nCount
,
rgn
.
data
.
rdh
.
nRgnSize
,
rgn
.
data
.
rdh
.
rcBound
.
left
,
rgn
.
data
.
rdh
.
rcBound
.
top
,
rgn
.
data
.
rdh
.
rcBound
.
right
,
rgn
.
data
.
rdh
.
rcBound
.
bottom
);
if
(
rgn
.
data
.
rdh
.
nCount
!=
0
)
{
rect
=
(
const
RECT
*
)
rgn
.
data
.
Buffer
;
trace
(
"rect (%d,%d-%d,%d)
\n
"
,
rect
->
left
,
rect
->
top
,
rect
->
right
,
rect
->
bottom
);
ok
(
EqualRect
(
rect
,
rc
),
"rects don't match
\n
"
);
}
ok
(
rgn
.
data
.
rdh
.
dwSize
==
sizeof
(
rgn
.
data
.
rdh
),
"expected sizeof(rdh), got %u
\n
"
,
rgn
.
data
.
rdh
.
dwSize
);
ok
(
rgn
.
data
.
rdh
.
iType
==
RDH_RECTANGLES
,
"expected RDH_RECTANGLES, got %u
\n
"
,
rgn
.
data
.
rdh
.
iType
);
if
(
IsRectEmpty
(
rc
))
{
ok
(
rgn
.
data
.
rdh
.
nCount
==
0
,
"expected 0, got %u
\n
"
,
rgn
.
data
.
rdh
.
nCount
);
ok
(
rgn
.
data
.
rdh
.
nRgnSize
==
0
,
"expected 0, got %u
\n
"
,
rgn
.
data
.
rdh
.
nRgnSize
);
}
else
{
ok
(
rgn
.
data
.
rdh
.
nCount
==
1
,
"expected 1, got %u
\n
"
,
rgn
.
data
.
rdh
.
nCount
);
ok
(
rgn
.
data
.
rdh
.
nRgnSize
==
sizeof
(
RECT
),
"expected sizeof(RECT), got %u
\n
"
,
rgn
.
data
.
rdh
.
nRgnSize
);
}
ok
(
EqualRect
(
&
rgn
.
data
.
rdh
.
rcBound
,
rc
),
"rects don't match
\n
"
);
}
static
void
test_getregiondata
(
void
)
{
GpStatus
status
;
...
...
@@ -750,6 +801,7 @@ static void test_gethrgn(void)
GpGraphics
*
graphics
;
HRGN
hrgn
;
HDC
hdc
=
GetDC
(
0
);
static
const
RECT
empty_rect
=
{
0
,
0
,
0
,
0
};
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
...
...
@@ -772,6 +824,13 @@ static void test_gethrgn(void)
ok
(
hrgn
==
NULL
,
"hrgn=%p
\n
"
,
hrgn
);
DeleteObject
(
hrgn
);
status
=
GdipSetEmpty
(
region
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipGetRegionHRgn
(
region
,
NULL
,
&
hrgn
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
verify_region
(
hrgn
,
&
empty_rect
);
DeleteObject
(
hrgn
);
status
=
GdipDeleteRegion
(
region
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipDeleteGraphics
(
graphics
);
...
...
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