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
295d961e
Commit
295d961e
authored
Jul 03, 2023
by
Alexandros Frantzis
Committed by
Alexandre Julliard
Jul 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winewayland.drv: Send surface damage region to the compositor.
Send the surface damage region to the compositor, to enable it to optimize pixel data transfers.
parent
8f737258
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
wayland_surface.c
dlls/winewayland.drv/wayland_surface.c
+23
-3
waylanddrv.h
dlls/winewayland.drv/waylanddrv.h
+4
-1
window_surface.c
dlls/winewayland.drv/window_surface.c
+3
-2
No files found.
dlls/winewayland.drv/wayland_surface.c
View file @
295d961e
...
...
@@ -226,8 +226,11 @@ void wayland_surface_clear_role(struct wayland_surface *surface)
* released by the compositor.
*/
void
wayland_surface_attach_shm
(
struct
wayland_surface
*
surface
,
struct
wayland_shm_buffer
*
shm_buffer
)
struct
wayland_shm_buffer
*
shm_buffer
,
HRGN
surface_damage_region
)
{
RGNDATA
*
surface_damage
;
TRACE
(
"surface=%p shm_buffer=%p (%dx%d)
\n
"
,
surface
,
shm_buffer
,
shm_buffer
->
width
,
shm_buffer
->
height
);
...
...
@@ -235,8 +238,25 @@ void wayland_surface_attach_shm(struct wayland_surface *surface,
wayland_shm_buffer_ref
(
shm_buffer
);
wl_surface_attach
(
surface
->
wl_surface
,
shm_buffer
->
wl_buffer
,
0
,
0
);
wl_surface_damage_buffer
(
surface
->
wl_surface
,
0
,
0
,
shm_buffer
->
width
,
shm_buffer
->
height
);
/* Add surface damage, i.e., which parts of the surface have changed since
* the last surface commit. Note that this is different from the buffer
* damage region. */
surface_damage
=
get_region_data
(
surface_damage_region
);
if
(
surface_damage
)
{
RECT
*
rgn_rect
=
(
RECT
*
)
surface_damage
->
Buffer
;
RECT
*
rgn_rect_end
=
rgn_rect
+
surface_damage
->
rdh
.
nCount
;
for
(;
rgn_rect
<
rgn_rect_end
;
rgn_rect
++
)
{
wl_surface_damage_buffer
(
surface
->
wl_surface
,
rgn_rect
->
left
,
rgn_rect
->
top
,
rgn_rect
->
right
-
rgn_rect
->
left
,
rgn_rect
->
bottom
-
rgn_rect
->
top
);
}
free
(
surface_damage
);
}
}
/**********************************************************************
...
...
dlls/winewayland.drv/waylanddrv.h
View file @
295d961e
...
...
@@ -146,7 +146,8 @@ void wayland_surface_destroy(struct wayland_surface *surface) DECLSPEC_HIDDEN;
void
wayland_surface_make_toplevel
(
struct
wayland_surface
*
surface
)
DECLSPEC_HIDDEN
;
void
wayland_surface_clear_role
(
struct
wayland_surface
*
surface
)
DECLSPEC_HIDDEN
;
void
wayland_surface_attach_shm
(
struct
wayland_surface
*
surface
,
struct
wayland_shm_buffer
*
shm_buffer
)
DECLSPEC_HIDDEN
;
struct
wayland_shm_buffer
*
shm_buffer
,
HRGN
surface_damage_region
)
DECLSPEC_HIDDEN
;
/**********************************************************************
* Wayland SHM buffer
...
...
@@ -179,6 +180,8 @@ static inline BOOL intersect_rect(RECT *dst, const RECT *src1, const RECT *src2)
return
!
IsRectEmpty
(
dst
);
}
RGNDATA
*
get_region_data
(
HRGN
region
)
DECLSPEC_HIDDEN
;
/**********************************************************************
* USER driver functions
*/
...
...
dlls/winewayland.drv/window_surface.c
View file @
295d961e
...
...
@@ -271,7 +271,7 @@ static void wayland_window_surface_set_region(struct window_surface *window_surf
/**********************************************************************
* get_region_data
*/
static
RGNDATA
*
get_region_data
(
HRGN
region
)
RGNDATA
*
get_region_data
(
HRGN
region
)
{
RGNDATA
*
data
;
DWORD
size
;
...
...
@@ -446,7 +446,8 @@ static void wayland_window_surface_flush(struct window_surface *window_surface)
pthread_mutex_lock
(
&
wws
->
wayland_surface
->
mutex
);
if
(
wws
->
wayland_surface
->
current_serial
)
{
wayland_surface_attach_shm
(
wws
->
wayland_surface
,
shm_buffer
);
wayland_surface_attach_shm
(
wws
->
wayland_surface
,
shm_buffer
,
surface_damage_region
);
wl_surface_commit
(
wws
->
wayland_surface
->
wl_surface
);
flushed
=
TRUE
;
}
...
...
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