mirror of
https://github.com/brl/mutter.git
synced 2025-02-09 01:54:10 +00:00
stage: Clean up
Remove some ifdeffed out dead code, and some duplication.
This commit is contained in:
parent
cd118f0dc0
commit
519da376f0
@ -691,44 +691,25 @@ clutter_stage_paint (ClutterActor *self)
|
|||||||
* priv->color.alpha
|
* priv->color.alpha
|
||||||
/ 255;
|
/ 255;
|
||||||
|
|
||||||
|
clear_flags = COGL_BUFFER_BIT_DEPTH;
|
||||||
|
if (!STAGE_NO_CLEAR_ON_PAINT (self))
|
||||||
|
clear_flags |= COGL_BUFFER_BIT_COLOR;
|
||||||
|
|
||||||
|
cogl_disable_fog ();
|
||||||
|
|
||||||
|
CLUTTER_TIMER_START (_clutter_uprof_context, stage_clear_timer);
|
||||||
/* we use the real alpha to clear the stage if :use-alpha is
|
/* we use the real alpha to clear the stage if :use-alpha is
|
||||||
* set; the effect depends entirely on how the Clutter backend
|
* set; the effect depends entirely on the Clutter backend
|
||||||
*/
|
*/
|
||||||
cogl_color_init_from_4ub (&stage_color,
|
cogl_color_init_from_4ub (&stage_color,
|
||||||
priv->color.red,
|
priv->color.red,
|
||||||
priv->color.green,
|
priv->color.green,
|
||||||
priv->color.blue,
|
priv->color.blue,
|
||||||
priv->use_alpha ? real_alpha
|
priv->use_alpha ? real_alpha : 255);
|
||||||
: 255);
|
|
||||||
cogl_color_premultiply (&stage_color);
|
cogl_color_premultiply (&stage_color);
|
||||||
|
|
||||||
clear_flags = COGL_BUFFER_BIT_DEPTH;
|
|
||||||
if (!STAGE_NO_CLEAR_ON_PAINT (self))
|
|
||||||
clear_flags |= COGL_BUFFER_BIT_COLOR;
|
|
||||||
|
|
||||||
CLUTTER_TIMER_START (_clutter_uprof_context, stage_clear_timer);
|
|
||||||
|
|
||||||
cogl_clear (&stage_color, clear_flags);
|
cogl_clear (&stage_color, clear_flags);
|
||||||
|
|
||||||
CLUTTER_TIMER_STOP (_clutter_uprof_context, stage_clear_timer);
|
CLUTTER_TIMER_STOP (_clutter_uprof_context, stage_clear_timer);
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (G_UNLIKELY (priv->use_fog))
|
|
||||||
{
|
|
||||||
/* we only expose the linear progression of the fog in
|
|
||||||
* the ClutterStage API, and that ignores the fog density.
|
|
||||||
* thus, we pass 1.0 as the density parameter
|
|
||||||
*/
|
|
||||||
cogl_set_fog (&stage_color,
|
|
||||||
COGL_FOG_MODE_LINEAR,
|
|
||||||
1.0,
|
|
||||||
priv->fog.z_near,
|
|
||||||
priv->fog.z_far);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cogl_disable_fog ();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
clutter_actor_iter_init (&iter, self);
|
clutter_actor_iter_init (&iter, self);
|
||||||
while (clutter_actor_iter_next (&iter, &child))
|
while (clutter_actor_iter_next (&iter, &child))
|
||||||
clutter_actor_paint (child);
|
clutter_actor_paint (child);
|
||||||
@ -1400,7 +1381,6 @@ _clutter_stage_do_pick (ClutterStage *stage,
|
|||||||
ClutterMainContext *context;
|
ClutterMainContext *context;
|
||||||
guchar pixel[4] = { 0xff, 0xff, 0xff, 0xff };
|
guchar pixel[4] = { 0xff, 0xff, 0xff, 0xff };
|
||||||
CoglColor stage_pick_id;
|
CoglColor stage_pick_id;
|
||||||
guint32 id_;
|
|
||||||
gboolean dither_enabled_save;
|
gboolean dither_enabled_save;
|
||||||
CoglFramebuffer *fb;
|
CoglFramebuffer *fb;
|
||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
@ -1463,19 +1443,7 @@ _clutter_stage_do_pick (ClutterStage *stage,
|
|||||||
CLUTTER_NOTE (PICK, "Reusing pick buffer from previous render to fetch "
|
CLUTTER_NOTE (PICK, "Reusing pick buffer from previous render to fetch "
|
||||||
"actor at %i,%i", x, y);
|
"actor at %i,%i", x, y);
|
||||||
|
|
||||||
/* FIXME: This is a lazy copy and paste of the logic at the end of this
|
goto check_pixel;
|
||||||
* function used when we actually do a pick render. It should be
|
|
||||||
* consolidated somehow.
|
|
||||||
*/
|
|
||||||
if (pixel[0] == 0xff && pixel[1] == 0xff && pixel[2] == 0xff)
|
|
||||||
{
|
|
||||||
actor = CLUTTER_ACTOR (stage);
|
|
||||||
goto result;
|
|
||||||
}
|
|
||||||
|
|
||||||
id_ = _clutter_pixel_to_id (pixel);
|
|
||||||
actor = _clutter_get_actor_by_id (stage, id_);
|
|
||||||
goto result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->picks_per_frame++;
|
priv->picks_per_frame++;
|
||||||
@ -1565,16 +1533,17 @@ _clutter_stage_do_pick (ClutterStage *stage,
|
|||||||
/* Restore whether GL_DITHER was enabled */
|
/* Restore whether GL_DITHER was enabled */
|
||||||
cogl_framebuffer_set_dither_enabled (fb, dither_enabled_save);
|
cogl_framebuffer_set_dither_enabled (fb, dither_enabled_save);
|
||||||
|
|
||||||
|
check_pixel:
|
||||||
if (pixel[0] == 0xff && pixel[1] == 0xff && pixel[2] == 0xff)
|
if (pixel[0] == 0xff && pixel[1] == 0xff && pixel[2] == 0xff)
|
||||||
{
|
{
|
||||||
actor = CLUTTER_ACTOR (stage);
|
actor = CLUTTER_ACTOR (stage);
|
||||||
goto result;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
guint32 id_ = _clutter_pixel_to_id (pixel);
|
||||||
|
|
||||||
id_ = _clutter_pixel_to_id (pixel);
|
actor = _clutter_get_actor_by_id (stage, id_);
|
||||||
actor = _clutter_get_actor_by_id (stage, id_);
|
}
|
||||||
|
|
||||||
result:
|
|
||||||
|
|
||||||
CLUTTER_TIMER_STOP (_clutter_uprof_context, pick_timer);
|
CLUTTER_TIMER_STOP (_clutter_uprof_context, pick_timer);
|
||||||
|
|
||||||
@ -3159,25 +3128,6 @@ void
|
|||||||
clutter_stage_set_use_fog (ClutterStage *stage,
|
clutter_stage_set_use_fog (ClutterStage *stage,
|
||||||
gboolean fog)
|
gboolean fog)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
ClutterStagePrivate *priv;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
||||||
|
|
||||||
priv = stage->priv;
|
|
||||||
|
|
||||||
if (priv->use_fog != fog)
|
|
||||||
{
|
|
||||||
priv->use_fog = fog;
|
|
||||||
|
|
||||||
CLUTTER_NOTE (MISC, "%s depth-cueing inside stage",
|
|
||||||
priv->use_fog ? "enabling" : "disabling");
|
|
||||||
|
|
||||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
|
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (stage), "use-fog");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3242,19 +3192,6 @@ void
|
|||||||
clutter_stage_set_fog (ClutterStage *stage,
|
clutter_stage_set_fog (ClutterStage *stage,
|
||||||
ClutterFog *fog)
|
ClutterFog *fog)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
ClutterStagePrivate *priv;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
||||||
g_return_if_fail (fog != NULL);
|
|
||||||
|
|
||||||
priv = stage->priv;
|
|
||||||
|
|
||||||
priv->fog = *fog;
|
|
||||||
|
|
||||||
if (priv->use_fog)
|
|
||||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user