Beispiel #1
0
static void
st_icon_paint (ClutterActor *actor)
{
  StIconPrivate *priv = ST_ICON (actor)->priv;

  st_widget_paint_background (ST_WIDGET (actor));

  if (priv->icon_texture)
    {
      if (priv->shadow_material)
        {
          ClutterActorBox allocation;
          float width, height;

          clutter_actor_get_allocation_box (priv->icon_texture, &allocation);
          clutter_actor_box_get_size (&allocation, &width, &height);

          _st_paint_shadow_with_opacity (priv->shadow_spec,
                                         priv->shadow_material,
                                         &allocation,
                                         clutter_actor_get_paint_opacity (priv->icon_texture));
        }

      clutter_actor_paint (priv->icon_texture);
    }
}
Beispiel #2
0
static void
st_icon_paint (ClutterActor *actor)
{
  StIconPrivate *priv = ST_ICON (actor)->priv;

  /* Chain up to paint background */
  CLUTTER_ACTOR_CLASS (st_icon_parent_class)->paint (actor);

  if (priv->icon_texture)
    {
      if (priv->shadow_material)
        {
          ClutterActorBox allocation;
          float width, height;

          clutter_actor_get_allocation_box (priv->icon_texture, &allocation);
          clutter_actor_box_get_size (&allocation, &width, &height);

          allocation.x1 = (width - priv->shadow_width) / 2;
          allocation.y1 = (height - priv->shadow_height) / 2;
          allocation.x2 = allocation.x1 + priv->shadow_width;
          allocation.y2 = allocation.y1 + priv->shadow_height;

          _st_paint_shadow_with_opacity (priv->shadow_spec,
                                         priv->shadow_material,
                                         &allocation,
                                         clutter_actor_get_paint_opacity (priv->icon_texture));
        }

      clutter_actor_paint (priv->icon_texture);
    }
}
Beispiel #3
0
/**
 * st_shadow_helper_paint:
 * @helper: a #StShadowHelper
 * @actor_box: the bounding box of the shadow
 * @paint_opacity: the opacity at which the shadow is painted
 *
 * Paints the shadow associated with @helper This must only
 * be called from the implementation of ClutterActor::paint().
 */
void
st_shadow_helper_paint (StShadowHelper  *helper,
                        ClutterActorBox *actor_box,
                        guint8           paint_opacity)
{
  ClutterActorBox allocation;
  float width, height;

  clutter_actor_box_get_size (actor_box, &width, &height);

  _st_paint_shadow_with_opacity (helper->shadow,
                                 helper->material,
                                 &allocation,
                                 paint_opacity);
}