mirror of
https://github.com/brl/mutter.git
synced 2024-12-04 13:50:41 -05:00
actor: Do not use G_UNLIKELY in paint()
We decide whether the paint() should be a real paint or a paint in pick mode depending on the global pick_mode value. Using G_UNLIKELY() on an operation that most likely is going to be executed once every frame is going to blow a lot of cache lines and frak with the CPU branch prediction. Not good.
This commit is contained in:
parent
6583f8bb49
commit
93a5b78e5a
@ -2515,7 +2515,18 @@ clutter_actor_paint (ClutterActor *self)
|
|||||||
clip_set = TRUE;
|
clip_set = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (G_UNLIKELY (context->pick_mode != CLUTTER_PICK_NONE))
|
if (context->pick_mode == CLUTTER_PICK_NONE)
|
||||||
|
{
|
||||||
|
CLUTTER_COUNTER_INC (_clutter_uprof_context, actor_paint_counter);
|
||||||
|
|
||||||
|
clutter_actor_shader_pre_paint (self, FALSE);
|
||||||
|
|
||||||
|
self->priv->propagated_one_redraw = FALSE;
|
||||||
|
g_signal_emit (self, actor_signals[PAINT], 0);
|
||||||
|
|
||||||
|
clutter_actor_shader_post_paint (self);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
ClutterColor col = { 0, };
|
ClutterColor col = { 0, };
|
||||||
|
|
||||||
@ -2529,17 +2540,6 @@ clutter_actor_paint (ClutterActor *self)
|
|||||||
*/
|
*/
|
||||||
g_signal_emit (self, actor_signals[PICK], 0, &col);
|
g_signal_emit (self, actor_signals[PICK], 0, &col);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
CLUTTER_COUNTER_INC (_clutter_uprof_context, actor_paint_counter);
|
|
||||||
|
|
||||||
clutter_actor_shader_pre_paint (self, FALSE);
|
|
||||||
|
|
||||||
self->priv->propagated_one_redraw = FALSE;
|
|
||||||
g_signal_emit (self, actor_signals[PAINT], 0);
|
|
||||||
|
|
||||||
clutter_actor_shader_post_paint (self);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clip_set)
|
if (clip_set)
|
||||||
cogl_clip_pop();
|
cogl_clip_pop();
|
||||||
|
Loading…
Reference in New Issue
Block a user