Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
28a71b3d
Commit
28a71b3d
authored
Nov 24, 2008
by
Vincent Povirk
Committed by
Alexandre Julliard
Dec 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipGetRegionHRgn for combined regions.
parent
95366238
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
141 additions
and
0 deletions
+141
-0
region.c
dlls/gdiplus/region.c
+92
-0
region.c
dlls/gdiplus/tests/region.c
+49
-0
No files found.
dlls/gdiplus/region.c
View file @
28a71b3d
...
...
@@ -841,6 +841,98 @@ static GpStatus get_region_hrgn(struct region_element *element, GpGraphics *grap
return
stat
;
}
case
CombineModeIntersect
:
case
CombineModeUnion
:
case
CombineModeXor
:
case
CombineModeExclude
:
case
CombineModeComplement
:
{
HRGN
left
,
right
;
GpStatus
stat
;
int
ret
;
stat
=
get_region_hrgn
(
element
->
elementdata
.
combine
.
left
,
graphics
,
&
left
);
if
(
stat
!=
Ok
)
{
*
hrgn
=
NULL
;
return
stat
;
}
if
(
left
==
NULL
)
{
/* existing region is infinite */
switch
(
element
->
type
)
{
case
CombineModeIntersect
:
return
get_region_hrgn
(
element
->
elementdata
.
combine
.
right
,
graphics
,
hrgn
);
case
CombineModeXor
:
case
CombineModeExclude
:
FIXME
(
"cannot exclude from an infinite region
\n
"
);
/* fall-through */
case
CombineModeUnion
:
case
CombineModeComplement
:
*
hrgn
=
NULL
;
return
Ok
;
}
}
stat
=
get_region_hrgn
(
element
->
elementdata
.
combine
.
right
,
graphics
,
&
right
);
if
(
stat
!=
Ok
)
{
DeleteObject
(
left
);
*
hrgn
=
NULL
;
return
stat
;
}
if
(
right
==
NULL
)
{
/* new region is infinite */
switch
(
element
->
type
)
{
case
CombineModeIntersect
:
*
hrgn
=
left
;
return
Ok
;
case
CombineModeXor
:
case
CombineModeComplement
:
FIXME
(
"cannot exclude from an infinite region
\n
"
);
/* fall-through */
case
CombineModeUnion
:
case
CombineModeExclude
:
DeleteObject
(
left
);
*
hrgn
=
NULL
;
return
Ok
;
}
}
switch
(
element
->
type
)
{
case
CombineModeIntersect
:
ret
=
CombineRgn
(
left
,
left
,
right
,
RGN_AND
);
break
;
case
CombineModeUnion
:
ret
=
CombineRgn
(
left
,
left
,
right
,
RGN_OR
);
break
;
case
CombineModeXor
:
ret
=
CombineRgn
(
left
,
left
,
right
,
RGN_XOR
);
break
;
case
CombineModeExclude
:
ret
=
CombineRgn
(
left
,
left
,
right
,
RGN_DIFF
);
break
;
case
CombineModeComplement
:
ret
=
CombineRgn
(
left
,
right
,
left
,
RGN_DIFF
);
break
;
default:
ret
=
ERROR
;
}
DeleteObject
(
right
);
if
(
ret
==
ERROR
)
{
DeleteObject
(
left
);
*
hrgn
=
NULL
;
return
GenericError
;
}
*
hrgn
=
left
;
return
Ok
;
}
default:
FIXME
(
"GdipGetRegionHRgn unimplemented for region type=%x
\n
"
,
element
->
type
);
*
hrgn
=
NULL
;
...
...
dlls/gdiplus/tests/region.c
View file @
28a71b3d
...
...
@@ -806,6 +806,10 @@ static void test_gethrgn(void)
static
const
RECT
test_rect
=
{
10
,
11
,
20
,
21
};
static
const
GpRectF
test_rectF
=
{
10
.
0
,
11
.
0
,
10
.
0
,
10
.
0
};
static
const
RECT
scaled_rect
=
{
20
,
22
,
40
,
42
};
static
const
RECT
test_rect2
=
{
10
,
21
,
20
,
31
};
static
const
GpRectF
test_rect2F
=
{
10
.
0
,
21
.
0
,
10
.
0
,
10
.
0
};
static
const
RECT
test_rect3
=
{
10
,
11
,
20
,
31
};
static
const
GpRectF
test_rect3F
=
{
10
.
0
,
11
.
0
,
10
.
0
,
20
.
0
};
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
...
...
@@ -867,6 +871,51 @@ static void test_gethrgn(void)
verify_region
(
hrgn
,
&
scaled_rect
);
DeleteObject
(
hrgn
);
status
=
GdipSetInfinite
(
region
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipCombineRegionRect
(
region
,
&
test_rectF
,
CombineModeIntersect
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipGetRegionHRgn
(
region
,
NULL
,
&
hrgn
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
verify_region
(
hrgn
,
&
test_rect
);
DeleteObject
(
hrgn
);
status
=
GdipCombineRegionRect
(
region
,
&
test_rectF
,
CombineModeReplace
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipCombineRegionRect
(
region
,
&
test_rect2F
,
CombineModeUnion
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipGetRegionHRgn
(
region
,
NULL
,
&
hrgn
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
verify_region
(
hrgn
,
&
test_rect3
);
DeleteObject
(
hrgn
);
status
=
GdipCombineRegionRect
(
region
,
&
test_rect3F
,
CombineModeReplace
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipCombineRegionRect
(
region
,
&
test_rect2F
,
CombineModeXor
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipGetRegionHRgn
(
region
,
NULL
,
&
hrgn
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
verify_region
(
hrgn
,
&
test_rect
);
DeleteObject
(
hrgn
);
status
=
GdipCombineRegionRect
(
region
,
&
test_rect3F
,
CombineModeReplace
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipCombineRegionRect
(
region
,
&
test_rectF
,
CombineModeExclude
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipGetRegionHRgn
(
region
,
NULL
,
&
hrgn
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
verify_region
(
hrgn
,
&
test_rect2
);
DeleteObject
(
hrgn
);
status
=
GdipCombineRegionRect
(
region
,
&
test_rectF
,
CombineModeReplace
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipCombineRegionRect
(
region
,
&
test_rect3F
,
CombineModeComplement
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipGetRegionHRgn
(
region
,
NULL
,
&
hrgn
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
verify_region
(
hrgn
,
&
test_rect2
);
DeleteObject
(
hrgn
);
status
=
GdipDeletePath
(
path
);
ok
(
status
==
Ok
,
"status %08x
\n
"
,
status
);
status
=
GdipDeleteRegion
(
region
);
...
...
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