picking: Fix tracking of pick buffer validity

We have an optimization to track when there are multiple picks per
frame so we can do a full render of the pick buffer to reduce the
number of pick renders for a static scene.

There was a problem though in that we were tracking this information in
the ClutterMainContext, but conceptually this doesn't really make sense
because the pick buffer is associated with a stage framebuffer and there
can be multiple stages for one context.

This patch moves the state tracking to ClutterStage.
This commit is contained in:
Robert Bragg
2010-09-11 00:29:05 +01:00
parent b2a56c9cda
commit 56929942a8
4 changed files with 63 additions and 25 deletions

View File

@ -183,9 +183,6 @@ struct _ClutterMainContext
GList *repaint_funcs;
ClutterSettings *settings;
gint picks_per_frame;
gboolean have_complete_pick_buffer;
};
#define CLUTTER_CONTEXT() (_clutter_context_get_default ())
@ -279,6 +276,12 @@ int _clutter_stage_get_pending_swaps (ClutterStage *stage);
gboolean _clutter_stage_has_full_redraw_queued (ClutterStage *stage);
void _clutter_stage_set_pick_buffer_valid (ClutterStage *stage, gboolean valid);
gboolean _clutter_stage_get_pick_buffer_valid (ClutterStage *stage);
void _clutter_stage_increment_picks_per_frame_counter (ClutterStage *stage);
void _clutter_stage_reset_picks_per_frame_counter (ClutterStage *stage);
guint _clutter_stage_get_picks_per_frame_counter (ClutterStage *stage);
/* vfuncs implemented by backend */
GType _clutter_backend_impl_get_type (void);