[gtk: 19/88] gdk/surface: Make pending schedule a phase enum
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk: 19/88] gdk/surface: Make pending schedule a phase enum
- Date: Tue, 8 Dec 2020 15:38:40 +0000 (UTC)
commit 475c07e935b92c2cdef3a0ff24c74ebdeb694d82
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Tue Nov 24 22:00:38 2020 +0100
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.
gdk/gdksurface.c | 18 +++++++-----------
gdk/gdksurfaceprivate.h | 3 +--
2 files changed, 8 insertions(+), 13 deletions(-)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 6cd7686bb2..f5f4a5790d 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -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;
}
}
}
diff --git a/gdk/gdksurfaceprivate.h b/gdk/gdksurfaceprivate.h
index a6a981dbb8..196e2b9aeb 100644
--- a/gdk/gdksurfaceprivate.h
+++ b/gdk/gdksurfaceprivate.h
@@ -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. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]