gdk/frame-clock: Remove the newly added 'compute-size' phase
What was previously done in the layout phase is now done in response to a GdkSurface signal, which means size computation can happen on layout.
This commit is contained in:
@@ -78,7 +78,6 @@ enum {
|
||||
FLUSH_EVENTS,
|
||||
BEFORE_PAINT,
|
||||
UPDATE,
|
||||
COMPUTE_SIZE,
|
||||
LAYOUT,
|
||||
PAINT,
|
||||
AFTER_PAINT,
|
||||
@@ -185,21 +184,6 @@ gdk_frame_clock_class_init (GdkFrameClockClass *klass)
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
* GdkFrameClock::compute-size:
|
||||
* @clock: the frame clock emitting the signal
|
||||
*
|
||||
* This signal is used for computing the size of the underlying
|
||||
* #GdkSurface. Applications should generally not handle this signal.
|
||||
*/
|
||||
signals[COMPUTE_SIZE] =
|
||||
g_signal_new (g_intern_static_string ("compute-size"),
|
||||
GDK_TYPE_FRAME_CLOCK,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
* GdkFrameClock::layout:
|
||||
* @clock: the frame clock emitting the signal
|
||||
@@ -698,18 +682,6 @@ _gdk_frame_clock_emit_update (GdkFrameClock *frame_clock)
|
||||
gdk_profiler_end_mark (before, "frameclock update", NULL);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_frame_clock_emit_compute_size (GdkFrameClock *frame_clock)
|
||||
{
|
||||
gint64 before G_GNUC_UNUSED;
|
||||
|
||||
before = GDK_PROFILER_CURRENT_TIME;
|
||||
|
||||
g_signal_emit (frame_clock, signals[COMPUTE_SIZE], 0);
|
||||
|
||||
gdk_profiler_end_mark (before, "frameclock compute size", NULL);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_frame_clock_emit_layout (GdkFrameClock *frame_clock)
|
||||
{
|
||||
|
||||
@@ -50,8 +50,7 @@ typedef struct _GdkFrameClockClass GdkFrameClockClass;
|
||||
* @GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS: corresponds to GdkFrameClock::flush-events. Should not be handled by applications.
|
||||
* @GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT: corresponds to GdkFrameClock::before-paint. Should not be handled by applications.
|
||||
* @GDK_FRAME_CLOCK_PHASE_UPDATE: corresponds to GdkFrameClock::update.
|
||||
* @GDK_FRAME_CLOCK_PHASE_COMPUTE_SIZE: corresponds to GdkFrameClock::compute-size. Should not be handled by applications.
|
||||
* @GDK_FRAME_CLOCK_PHASE_LAYOUT: corresponds to GdkFrameClock::layout.
|
||||
* @GDK_FRAME_CLOCK_PHASE_LAYOUT: corresponds to GdkFrameClock::layout. Should not be handled by applicatiosn.
|
||||
* @GDK_FRAME_CLOCK_PHASE_PAINT: corresponds to GdkFrameClock::paint.
|
||||
* @GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS: corresponds to GdkFrameClock::resume-events. Should not be handled by applications.
|
||||
* @GDK_FRAME_CLOCK_PHASE_AFTER_PAINT: corresponds to GdkFrameClock::after-paint. Should not be handled by applications.
|
||||
@@ -65,11 +64,10 @@ typedef enum {
|
||||
GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS = 1 << 0,
|
||||
GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT = 1 << 1,
|
||||
GDK_FRAME_CLOCK_PHASE_UPDATE = 1 << 2,
|
||||
GDK_FRAME_CLOCK_PHASE_COMPUTE_SIZE = 1 << 3,
|
||||
GDK_FRAME_CLOCK_PHASE_LAYOUT = 1 << 4,
|
||||
GDK_FRAME_CLOCK_PHASE_PAINT = 1 << 5,
|
||||
GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS = 1 << 6,
|
||||
GDK_FRAME_CLOCK_PHASE_AFTER_PAINT = 1 << 7
|
||||
GDK_FRAME_CLOCK_PHASE_LAYOUT = 1 << 3,
|
||||
GDK_FRAME_CLOCK_PHASE_PAINT = 1 << 4,
|
||||
GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS = 1 << 5,
|
||||
GDK_FRAME_CLOCK_PHASE_AFTER_PAINT = 1 << 6
|
||||
} GdkFrameClockPhase;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
|
||||
@@ -552,18 +552,6 @@ gdk_frame_clock_paint_idle (void *data)
|
||||
}
|
||||
G_GNUC_FALLTHROUGH;
|
||||
|
||||
case GDK_FRAME_CLOCK_PHASE_COMPUTE_SIZE:
|
||||
if (priv->freeze_count == 0)
|
||||
{
|
||||
priv->phase = GDK_FRAME_CLOCK_PHASE_COMPUTE_SIZE;
|
||||
if ((priv->requested & GDK_FRAME_CLOCK_PHASE_COMPUTE_SIZE) != 0)
|
||||
{
|
||||
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_COMPUTE_SIZE;
|
||||
_gdk_frame_clock_emit_compute_size (clock);
|
||||
}
|
||||
}
|
||||
G_GNUC_FALLTHROUGH;
|
||||
|
||||
case GDK_FRAME_CLOCK_PHASE_LAYOUT:
|
||||
if (priv->freeze_count == 0)
|
||||
{
|
||||
|
||||
@@ -122,7 +122,6 @@ gboolean _gdk_frame_timings_steal (GdkFrameTimings *timings,
|
||||
void _gdk_frame_clock_emit_flush_events (GdkFrameClock *frame_clock);
|
||||
void _gdk_frame_clock_emit_before_paint (GdkFrameClock *frame_clock);
|
||||
void _gdk_frame_clock_emit_update (GdkFrameClock *frame_clock);
|
||||
void _gdk_frame_clock_emit_compute_size (GdkFrameClock *frame_clock);
|
||||
void _gdk_frame_clock_emit_layout (GdkFrameClock *frame_clock);
|
||||
void _gdk_frame_clock_emit_paint (GdkFrameClock *frame_clock);
|
||||
void _gdk_frame_clock_emit_after_paint (GdkFrameClock *frame_clock);
|
||||
|
||||
@@ -1311,25 +1311,6 @@ gdk_surface_emit_size_changed (GdkSurface *surface,
|
||||
g_signal_emit (surface, signals[SIZE_CHANGED], 0, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_surface_request_compute_size (GdkSurface *surface)
|
||||
{
|
||||
GdkFrameClock *frame_clock;
|
||||
|
||||
if (surface->update_freeze_count ||
|
||||
gdk_surface_is_toplevel_frozen (surface))
|
||||
{
|
||||
surface->pending_phases |= GDK_FRAME_CLOCK_PHASE_COMPUTE_SIZE;
|
||||
return;
|
||||
}
|
||||
|
||||
frame_clock = gdk_surface_get_frame_clock (surface);
|
||||
g_return_if_fail (frame_clock);
|
||||
|
||||
gdk_frame_clock_request_phase (frame_clock,
|
||||
GDK_FRAME_CLOCK_PHASE_COMPUTE_SIZE);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_surface_process_updates_internal (GdkSurface *surface)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user