mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-09 02:10:10 +00:00
Merge branch 'mr7057-preparation' into 'main'
gdk/wayland: Make the surface handle empty commits See merge request GNOME/gtk!7133
This commit is contained in:
commit
e699685003
@ -198,17 +198,8 @@ static void
|
||||
gdk_wayland_cairo_context_empty_frame (GdkDrawContext *draw_context)
|
||||
{
|
||||
GdkSurface *surface = gdk_draw_context_get_surface (draw_context);
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
|
||||
if (!impl->has_pending_subsurface_commits)
|
||||
return;
|
||||
|
||||
gdk_wayland_surface_sync (surface);
|
||||
gdk_wayland_surface_request_frame (surface);
|
||||
|
||||
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "Wayland surface commit", NULL);
|
||||
gdk_wayland_surface_commit (surface);
|
||||
gdk_wayland_surface_notify_committed (surface);
|
||||
gdk_wayland_surface_handle_empty_frame (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -88,14 +88,7 @@ gdk_wayland_gl_context_empty_frame (GdkDrawContext *draw_context)
|
||||
{
|
||||
GdkSurface *surface = gdk_draw_context_get_surface (draw_context);
|
||||
|
||||
if (gdk_wayland_surface_needs_commit (surface))
|
||||
{
|
||||
gdk_wayland_surface_sync (surface);
|
||||
gdk_wayland_surface_request_frame (surface);
|
||||
|
||||
gdk_wayland_surface_commit (surface);
|
||||
gdk_wayland_surface_notify_committed (surface);
|
||||
}
|
||||
gdk_wayland_surface_handle_empty_frame (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -131,7 +131,7 @@ guint _gdk_wayland_cursor_get_next_image_index (GdkWaylandDisplay *display,
|
||||
guint *next_image_delay);
|
||||
|
||||
void gdk_wayland_surface_sync (GdkSurface *surface);
|
||||
gboolean gdk_wayland_surface_needs_commit (GdkSurface *surface);
|
||||
void gdk_wayland_surface_handle_empty_frame (GdkSurface *surface);
|
||||
void gdk_wayland_surface_commit (GdkSurface *surface);
|
||||
void gdk_wayland_surface_notify_committed (GdkSurface *surface);
|
||||
void gdk_wayland_surface_request_frame (GdkSurface *surface);
|
||||
|
@ -775,7 +775,7 @@ gdk_wayland_surface_sync (GdkSurface *surface)
|
||||
gdk_wayland_surface_sync_viewport (surface);
|
||||
}
|
||||
|
||||
gboolean
|
||||
static gboolean
|
||||
gdk_wayland_surface_needs_commit (GdkSurface *surface)
|
||||
{
|
||||
GdkWaylandSurface *self = GDK_WAYLAND_SURFACE (surface);
|
||||
@ -787,6 +787,20 @@ gdk_wayland_surface_needs_commit (GdkSurface *surface)
|
||||
self->viewport_dirty;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_wayland_surface_handle_empty_frame (GdkSurface *surface)
|
||||
{
|
||||
if (!gdk_wayland_surface_needs_commit (surface))
|
||||
return;
|
||||
|
||||
gdk_wayland_surface_sync (surface);
|
||||
gdk_wayland_surface_request_frame (surface);
|
||||
|
||||
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "Wayland surface commit", NULL);
|
||||
gdk_wayland_surface_commit (surface);
|
||||
gdk_wayland_surface_notify_committed (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_surface_fractional_scale_preferred_scale_cb (void *data,
|
||||
struct wp_fractional_scale_v1 *fractional_scale,
|
||||
|
@ -77,16 +77,8 @@ static void
|
||||
gdk_vulkan_context_wayland_empty_frame (GdkDrawContext *context)
|
||||
{
|
||||
GdkSurface *surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
|
||||
if (!impl->has_pending_subsurface_commits)
|
||||
return;
|
||||
|
||||
gdk_wayland_surface_sync (surface);
|
||||
gdk_wayland_surface_request_frame (surface);
|
||||
|
||||
gdk_wayland_surface_commit (surface);
|
||||
gdk_wayland_surface_notify_committed (surface);
|
||||
gdk_wayland_surface_handle_empty_frame (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user