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
f59d3f60
Commit
f59d3f60
authored
Jul 06, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Jul 07, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Use a binary search for PtInRegion() and RectInRegion().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7fd44a51
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
20 deletions
+7
-20
region.c
dlls/gdi32/region.c
+7
-20
No files found.
dlls/gdi32/region.c
View file @
f59d3f60
...
...
@@ -1038,15 +1038,7 @@ BOOL WINAPI PtInRegion( HRGN hrgn, INT x, INT y )
if
((
obj
=
GDI_GetObjPtr
(
hrgn
,
OBJ_REGION
)))
{
int
i
;
if
(
obj
->
numRects
>
0
&&
is_in_rect
(
&
obj
->
extents
,
x
,
y
))
for
(
i
=
0
;
i
<
obj
->
numRects
;
i
++
)
if
(
is_in_rect
(
&
obj
->
rects
[
i
],
x
,
y
))
{
ret
=
TRUE
;
break
;
}
region_find_pt
(
obj
,
x
,
y
,
&
ret
);
GDI_ReleaseObj
(
hrgn
);
}
return
ret
;
...
...
@@ -1071,6 +1063,7 @@ BOOL WINAPI RectInRegion( HRGN hrgn, const RECT *rect )
WINEREGION
*
obj
;
BOOL
ret
=
FALSE
;
RECT
rc
;
int
i
;
/* swap the coordinates to make right >= left and bottom >= top */
/* (region building rectangles are normalized the same way) */
...
...
@@ -1079,29 +1072,23 @@ BOOL WINAPI RectInRegion( HRGN hrgn, const RECT *rect )
if
((
obj
=
GDI_GetObjPtr
(
hrgn
,
OBJ_REGION
)))
{
RECT
*
pCurRect
,
*
pRectEnd
;
/* this is (just) a useful optimization */
if
((
obj
->
numRects
>
0
)
&&
overlapping
(
&
obj
->
extents
,
&
rc
))
{
for
(
pCurRect
=
obj
->
rects
,
pRectEnd
=
pCurRect
+
obj
->
numRects
;
pCurRect
<
pRectEnd
;
pCurRect
++
)
for
(
i
=
region_find_pt
(
obj
,
rc
.
left
,
rc
.
top
,
&
ret
);
!
ret
&&
i
<
obj
->
numRects
;
i
++
)
{
if
(
pCurRect
->
bottom
<=
rc
.
top
)
if
(
obj
->
rects
[
i
].
bottom
<=
rc
.
top
)
continue
;
/* not far enough down yet */
if
(
pCurRect
->
top
>=
rc
.
bottom
)
if
(
obj
->
rects
[
i
].
top
>=
rc
.
bottom
)
break
;
/* too far down */
if
(
pCurRect
->
right
<=
rc
.
left
)
if
(
obj
->
rects
[
i
].
right
<=
rc
.
left
)
continue
;
/* not far enough over yet */
if
(
pCurRect
->
left
>=
rc
.
right
)
{
if
(
obj
->
rects
[
i
].
left
>=
rc
.
right
)
continue
;
}
ret
=
TRUE
;
break
;
}
}
GDI_ReleaseObj
(
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