gdk/surface: Make pending schedule a phase enum

Scheduling an update when frozen would reschedule when unfrozen; change
this to a generic pending phase enum, and use this for resrcheduling
paint and compute-size.
This commit is contained in:
Jonas Ådahl 2020-11-24 22:00:38 +01:00
parent 0c8d97e3f7
commit 475c07e935
2 changed files with 8 additions and 13 deletions

View File

@ -1290,7 +1290,7 @@ gdk_surface_schedule_update (GdkSurface *surface)
if (surface->update_freeze_count ||
gdk_surface_is_toplevel_frozen (surface))
{
surface->pending_schedule_update = TRUE;
surface->pending_phases |= GDK_FRAME_CLOCK_PHASE_PAINT;
return;
}
@ -1319,7 +1319,7 @@ gdk_surface_request_compute_size (GdkSurface *surface)
if (surface->update_freeze_count ||
gdk_surface_is_toplevel_frozen (surface))
{
surface->pending_request_compute_size = TRUE;
surface->pending_phases |= GDK_FRAME_CLOCK_PHASE_COMPUTE_SIZE;
return;
}
@ -1568,18 +1568,14 @@ gdk_surface_thaw_updates (GdkSurface *surface)
if (--surface->update_freeze_count == 0)
{
_gdk_frame_clock_inhibit_freeze (surface->frame_clock);
GdkFrameClock *frame_clock = surface->frame_clock;
if (surface->pending_schedule_update)
{
surface->pending_schedule_update = FALSE;
gdk_surface_schedule_update (surface);
}
_gdk_frame_clock_inhibit_freeze (frame_clock);
if (surface->pending_request_compute_size)
if (surface->pending_phases)
{
surface->pending_request_compute_size = FALSE;
gdk_surface_request_compute_size (surface);
gdk_frame_clock_request_phase (frame_clock, surface->pending_phases);
surface->pending_phases = 0;
}
}
}

View File

@ -53,8 +53,7 @@ struct _GdkSurface
cairo_region_t *update_area;
guint update_freeze_count;
gboolean pending_schedule_update;
gboolean pending_request_compute_size;
GdkFrameClockPhase pending_phases;
/* This is the update_area that was in effect when the current expose
started. It may be smaller than the expose area if we'e painting
more than we have to, but it represents the "true" damage. */