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
2f66b367
Commit
2f66b367
authored
May 20, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Directly use win32u for GDI functions in surface.c.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
948bd8e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
surface.c
dlls/winemac.drv/surface.c
+20
-18
No files found.
dlls/winemac.drv/surface.c
View file @
2f66b367
...
...
@@ -82,14 +82,14 @@ static void update_blit_data(struct macdrv_window_surface *surface)
if
(
surface
->
drawn
)
{
HRGN
blit
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
HRGN
blit
=
NtGdi
CreateRectRgn
(
0
,
0
,
0
,
0
);
if
(
CombineRgn
(
blit
,
surface
->
drawn
,
0
,
RGN_COPY
)
>
NULLREGION
&&
(
!
surface
->
region
||
CombineRgn
(
blit
,
blit
,
surface
->
region
,
RGN_AND
)
>
NULLREGION
)
&&
if
(
NtGdi
CombineRgn
(
blit
,
surface
->
drawn
,
0
,
RGN_COPY
)
>
NULLREGION
&&
(
!
surface
->
region
||
NtGdi
CombineRgn
(
blit
,
blit
,
surface
->
region
,
RGN_AND
)
>
NULLREGION
)
&&
OffsetRgn
(
blit
,
surface
->
header
.
rect
.
left
,
surface
->
header
.
rect
.
top
)
>
NULLREGION
)
surface
->
blit_data
=
get_region_data
(
blit
,
0
);
DeleteObject
(
blit
);
NtGdiDeleteObjectApp
(
blit
);
}
}
...
...
@@ -148,12 +148,12 @@ static void macdrv_surface_set_region(struct window_surface *window_surface, HRG
if
(
region
)
{
if
(
!
surface
->
region
)
surface
->
region
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
CombineRgn
(
surface
->
region
,
region
,
0
,
RGN_COPY
);
if
(
!
surface
->
region
)
surface
->
region
=
NtGdi
CreateRectRgn
(
0
,
0
,
0
,
0
);
NtGdi
CombineRgn
(
surface
->
region
,
region
,
0
,
RGN_COPY
);
}
else
{
if
(
surface
->
region
)
DeleteObject
(
surface
->
region
);
if
(
surface
->
region
)
NtGdiDeleteObjectApp
(
surface
->
region
);
surface
->
region
=
0
;
}
update_blit_data
(
surface
);
...
...
@@ -178,12 +178,14 @@ static void macdrv_surface_flush(struct window_surface *window_surface)
rect
=
cgrect_from_rect
(
surface
->
bounds
);
rect
=
CGRectOffset
(
rect
,
surface
->
header
.
rect
.
left
,
surface
->
header
.
rect
.
top
);
if
(
!
IsRectEmpty
(
&
surface
->
bounds
)
&&
(
region
=
CreateRectRgnIndirect
(
&
surface
->
bounds
)))
if
(
!
IsRectEmpty
(
&
surface
->
bounds
)
&&
(
region
=
NtGdiCreateRectRgn
(
surface
->
bounds
.
left
,
surface
->
bounds
.
top
,
surface
->
bounds
.
right
,
surface
->
bounds
.
bottom
)))
{
if
(
surface
->
drawn
)
{
CombineRgn
(
surface
->
drawn
,
surface
->
drawn
,
region
,
RGN_OR
);
DeleteObject
(
region
);
NtGdi
CombineRgn
(
surface
->
drawn
,
surface
->
drawn
,
region
,
RGN_OR
);
NtGdiDeleteObjectApp
(
region
);
}
else
surface
->
drawn
=
region
;
...
...
@@ -205,8 +207,8 @@ static void macdrv_surface_destroy(struct window_surface *window_surface)
struct
macdrv_window_surface
*
surface
=
get_mac_surface
(
window_surface
);
TRACE
(
"freeing %p bits %p
\n
"
,
surface
,
surface
->
bits
);
if
(
surface
->
region
)
DeleteObject
(
surface
->
region
);
if
(
surface
->
drawn
)
DeleteObject
(
surface
->
drawn
);
if
(
surface
->
region
)
NtGdiDeleteObjectApp
(
surface
->
region
);
if
(
surface
->
drawn
)
NtGdiDeleteObjectApp
(
surface
->
drawn
);
HeapFree
(
GetProcessHeap
(),
0
,
surface
->
blit_data
);
HeapFree
(
GetProcessHeap
(),
0
,
surface
->
bits
);
pthread_mutex_destroy
(
&
surface
->
mutex
);
...
...
@@ -283,11 +285,11 @@ struct window_surface *create_surface(macdrv_window window, const RECT *rect,
reset_bounds
(
&
surface
->
bounds
);
if
(
old_mac_surface
&&
old_mac_surface
->
drawn
)
{
surface
->
drawn
=
CreateRectRgnIndirect
(
rect
);
surface
->
drawn
=
NtGdiCreateRectRgn
(
rect
->
left
,
rect
->
top
,
rect
->
right
,
rect
->
bottom
);
OffsetRgn
(
surface
->
drawn
,
-
rect
->
left
,
-
rect
->
top
);
if
(
CombineRgn
(
surface
->
drawn
,
surface
->
drawn
,
old_mac_surface
->
drawn
,
RGN_AND
)
<=
NULLREGION
)
if
(
NtGdi
CombineRgn
(
surface
->
drawn
,
surface
->
drawn
,
old_mac_surface
->
drawn
,
RGN_AND
)
<=
NULLREGION
)
{
DeleteObject
(
surface
->
drawn
);
NtGdiDeleteObjectApp
(
surface
->
drawn
);
surface
->
drawn
=
0
;
}
}
...
...
@@ -456,10 +458,10 @@ void surface_clip_to_visible_rect(struct window_surface *window_surface, const R
rect
=
*
visible_rect
;
OffsetRect
(
&
rect
,
-
rect
.
left
,
-
rect
.
top
);
if
((
region
=
CreateRectRgnIndirect
(
&
rect
)))
if
((
region
=
NtGdiCreateRectRgn
(
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
)))
{
CombineRgn
(
surface
->
drawn
,
surface
->
drawn
,
region
,
RGN_AND
);
DeleteObject
(
region
);
NtGdi
CombineRgn
(
surface
->
drawn
,
surface
->
drawn
,
region
,
RGN_AND
);
NtGdiDeleteObjectApp
(
region
);
update_blit_data
(
surface
);
}
...
...
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