mirror of
https://github.com/brl/mutter.git
synced 2025-08-07 09:04:41 +00:00
Revert "picking: Fix tracking of pick buffer validity"
This reverts commit d7e86e2696
.
This was a half baked patch that was pushed a bit early since it broke
test-texture-pick-with-alpha + the commit message refers to a change on
the wip/paint-box branch that hasn't happened yet.
This commit is contained in:
@@ -274,8 +274,12 @@ _clutter_do_redraw (ClutterStage *stage)
|
||||
|
||||
ctx = _clutter_context_get_default ();
|
||||
|
||||
_clutter_stage_set_pick_buffer_valid (stage, FALSE);
|
||||
_clutter_stage_unset_pick_counter (stage);
|
||||
/* We have an optimization to avoid pick renders while scene is static.
|
||||
* This is implied by seeing multiple picks per frame so we have to
|
||||
* reset a pick counter each frame and also invalidate any current pick
|
||||
* buffer. */
|
||||
ctx->picks_per_frame = 0;
|
||||
ctx->have_complete_pick_buffer = FALSE;
|
||||
|
||||
/* Before we can paint, we have to be sure we have the latest layout */
|
||||
_clutter_stage_maybe_relayout (CLUTTER_ACTOR (stage));
|
||||
@@ -597,7 +601,7 @@ _clutter_do_pick (ClutterStage *stage,
|
||||
/* It's possible that we currently have a static scene and have renderered a
|
||||
* full, unclipped pick buffer. If so we can simply continue to read from
|
||||
* this cached buffer until the scene next changes. */
|
||||
if (_clutter_stage_get_pick_buffer_valid (stage))
|
||||
if (context->have_complete_pick_buffer)
|
||||
{
|
||||
CLUTTER_TIMER_START (_clutter_uprof_context, pick_read);
|
||||
cogl_read_pixels (x, y, 1, 1,
|
||||
@@ -624,7 +628,7 @@ _clutter_do_pick (ClutterStage *stage,
|
||||
goto result;
|
||||
}
|
||||
|
||||
_clutter_stage_increment_pick_counter (stage);
|
||||
context->picks_per_frame++;
|
||||
|
||||
_clutter_backend_ensure_context (context->backend, stage);
|
||||
|
||||
@@ -634,7 +638,7 @@ _clutter_do_pick (ClutterStage *stage,
|
||||
/* If we are seeing multiple picks per frame that means the scene is static
|
||||
* so we promote to doing a non-scissored pick render so that all subsequent
|
||||
* picks for the same static scene won't require additional renders */
|
||||
if (_clutter_stage_get_pick_counter (stage) < 2)
|
||||
if (context->picks_per_frame < 2)
|
||||
{
|
||||
if (G_LIKELY (!(clutter_pick_debug_flags &
|
||||
CLUTTER_DEBUG_DUMP_PICK_BUFFERS)))
|
||||
@@ -676,7 +680,7 @@ _clutter_do_pick (ClutterStage *stage,
|
||||
cogl_clip_pop ();
|
||||
}
|
||||
else
|
||||
_clutter_stage_set_pick_buffer_valid (stage, TRUE);
|
||||
context->have_complete_pick_buffer = TRUE;
|
||||
|
||||
/* Make sure Cogl flushes any batched geometry to the GPU driver */
|
||||
cogl_flush ();
|
||||
|
Reference in New Issue
Block a user