static void
clutter_gst_yv12_glsl_post_paint (ClutterActor        *actor,
                                  ClutterGstVideoSink *sink)
{
  CoglHandle material;

  /* Remove the extra layers */
  material = clutter_texture_get_cogl_material (CLUTTER_TEXTURE (actor));
  cogl_material_remove_layer (material, 1);
  cogl_material_remove_layer (material, 2);

  /* disable the shader */
  cogl_program_use (COGL_INVALID_HANDLE);
}
Ejemplo n.º 2
0
static void
mex_tile_style_changed_cb (MexTile *self, MxStyleChangedFlags flags)
{
  MexTilePrivate *priv = self->priv;
  MxBorderImage *image;

  if (priv->header_padding)
    {
      g_boxed_free (MX_TYPE_PADDING, priv->header_padding);
      priv->header_padding = NULL;
    }

  if (priv->header_background_color)
    {
      g_boxed_free (CLUTTER_TYPE_COLOR, priv->header_background_color);
      priv->header_background_color = NULL;
    }

  mx_stylable_get (MX_STYLABLE (self),
                   "x-mex-header-background", &image,
                   "x-mex-header-background-color", &priv->header_background_color,
                   "x-mex-header-padding", &priv->header_padding,
                   NULL);

  mx_stylable_apply_clutter_text_attributes (MX_STYLABLE (self),
                                             CLUTTER_TEXT (priv->label));

  mx_stylable_apply_clutter_text_attributes (MX_STYLABLE (self),
                                             CLUTTER_TEXT (priv->secondary_label));

  if (image && image->uri)
    {
      CoglObject *background;

      background =
        mx_texture_cache_get_cogl_texture (mx_texture_cache_get_default (),
                                           image->uri);
      cogl_material_set_layer (priv->material, 0, background);
    }
  else
    {
      if (cogl_material_get_n_layers (priv->material))
        cogl_material_remove_layer (priv->material, 0);
    }

  if (image)
    g_boxed_free (MX_TYPE_BORDER_IMAGE, image);

  if (priv->icon1)
    mx_stylable_style_changed (MX_STYLABLE (priv->icon1), flags);

  if (priv->icon2)
    mx_stylable_style_changed (MX_STYLABLE (priv->icon2), flags);

  clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
}
static void
clutter_gst_yv12_fp_post_paint (ClutterActor        *actor,
                                ClutterGstVideoSink *sink)
{
  CoglHandle material;

  /* Cogl doesn't support changing OpenGL state to modify how Cogl primitives
   * work, but it also doesn't support ARBfp which we currently depend on. For
   * now we at least ask Cogl to flush any batched primitives so we avoid
   * binding our shader across the wrong geometry, but there is a risk that
   * Cogl may start to use ARBfp internally which will conflict with us. */
  cogl_flush ();

  /* Remove the extra layers */
  material = clutter_texture_get_cogl_material (CLUTTER_TEXTURE (actor));
  cogl_material_remove_layer (material, 1);
  cogl_material_remove_layer (material, 2);

  /* Disable the shader */
  glDisable (GL_FRAGMENT_PROGRAM_ARB);
}