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
7fd44a51
Commit
7fd44a51
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 to generate the clipped rects.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
49078e00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
dc.c
dlls/gdi32/dibdrv/dc.c
+1
-1
gdi_private.h
dlls/gdi32/gdi_private.h
+33
-0
No files found.
dlls/gdi32/dibdrv/dc.c
View file @
7fd44a51
...
...
@@ -280,7 +280,7 @@ int get_clipped_rects( const dib_info *dib, const RECT *rc, HRGN clip, struct cl
if
(
!
(
region
=
get_wine_region
(
clip
)))
return
0
;
for
(
i
=
0
;
i
<
region
->
numRects
;
i
++
)
for
(
i
=
region_find_pt
(
region
,
rect
.
left
,
rect
.
top
,
NULL
)
;
i
<
region
->
numRects
;
i
++
)
{
if
(
region
->
rects
[
i
].
top
>=
rect
.
bottom
)
break
;
if
(
!
intersect_rect
(
out
,
&
rect
,
&
region
->
rects
[
i
]
))
continue
;
...
...
dlls/gdi32/gdi_private.h
View file @
7fd44a51
...
...
@@ -370,6 +370,39 @@ static inline void release_wine_region(HRGN rgn)
GDI_ReleaseObj
(
rgn
);
}
/**********************************************************
* region_find_pt
*
* Return either the index of the rectangle that contains (x,y) or the first
* rectangle after it. Sets *hit to TRUE if the region contains (x,y).
* Note if (x,y) follows all rectangles, then the return value will be rgn->numRects.
*/
static
inline
int
region_find_pt
(
const
WINEREGION
*
rgn
,
int
x
,
int
y
,
BOOL
*
hit
)
{
int
i
,
start
=
0
,
end
=
rgn
->
numRects
-
1
;
BOOL
h
=
FALSE
;
while
(
start
<=
end
)
{
i
=
(
start
+
end
)
/
2
;
if
(
rgn
->
rects
[
i
].
bottom
<=
y
||
(
rgn
->
rects
[
i
].
top
<=
y
&&
rgn
->
rects
[
i
].
right
<=
x
))
start
=
i
+
1
;
else
if
(
rgn
->
rects
[
i
].
top
>
y
||
(
rgn
->
rects
[
i
].
bottom
>
y
&&
rgn
->
rects
[
i
].
left
>
x
))
end
=
i
-
1
;
else
{
h
=
TRUE
;
break
;
}
}
if
(
hit
)
*
hit
=
h
;
return
h
?
i
:
start
;
}
/* null driver entry points */
extern
BOOL
nulldrv_AbortPath
(
PHYSDEV
dev
)
DECLSPEC_HIDDEN
;
extern
BOOL
nulldrv_AlphaBlend
(
PHYSDEV
dst_dev
,
struct
bitblt_coords
*
dst
,
...
...
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