[clutter/wip/clutter-1.99: 20/28] 1.99: Remove deprecated API in ClutterTexture



commit 15f624ba176851d51df5f45b6595bc4de882cff9
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Jun 21 18:21:45 2012 +0100

    1.99: Remove deprecated API in ClutterTexture

 clutter/clutter-texture.c |  627 ---------------------------------------------
 1 files changed, 0 insertions(+), 627 deletions(-)
---
diff --git a/clutter/clutter-texture.c b/clutter/clutter-texture.c
index fbac708..d76984c 100644
--- a/clutter/clutter-texture.c
+++ b/clutter/clutter-texture.c
@@ -55,9 +55,6 @@
 
 #define CLUTTER_ENABLE_EXPERIMENTAL_API
 
-/* sadly, we are still using ClutterShader internally */
-#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
-
 #include "clutter-texture.h"
 
 #include "clutter-actor-private.h"
@@ -71,10 +68,6 @@
 #include "clutter-scriptable.h"
 #include "clutter-stage-private.h"
 
-#include "deprecated/clutter-shader.h"
-#include "deprecated/clutter-texture.h"
-#include "deprecated/clutter-util.h"
-
 static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (ClutterTexture,
@@ -94,9 +87,6 @@ struct _ClutterTexturePrivate
 
   CoglPipeline *pipeline;
 
-  ClutterActor *fbo_source;
-  CoglHandle fbo_handle;
-
   CoglPipeline *pick_pipeline;
 
   gchar *filename;
@@ -188,9 +178,6 @@ static GMutex       upload_list_mutex;
 
 static CoglPipeline *texture_template_pipeline = NULL;
 
-static void
-texture_fbo_free_resources (ClutterTexture *texture);
-
 GQuark
 clutter_texture_error_quark (void)
 {
@@ -254,15 +241,6 @@ clutter_texture_unrealize (ClutterActor *actor)
   if (priv->pipeline == NULL)
     return;
 
-  if (priv->fbo_source != NULL)
-    {
-      /* Free up our fbo handle and texture resources, realize will recreate */
-      cogl_object_unref (priv->fbo_handle);
-      priv->fbo_handle = NULL;
-      texture_free_gl_resources (texture);
-      return;
-    }
-
   CLUTTER_NOTE (TEXTURE, "Texture unrealized");
 }
 
@@ -275,41 +253,6 @@ clutter_texture_realize (ClutterActor *actor)
   texture = CLUTTER_TEXTURE(actor);
   priv = texture->priv;
 
-  if (priv->fbo_source)
-    {
-      CoglTextureFlags flags = COGL_TEXTURE_NONE;
-      CoglHandle tex;
-
-      /* Handle FBO's */
-
-      if (priv->no_slice)
-        flags |= COGL_TEXTURE_NO_SLICING;
-
-      tex = cogl_texture_new_with_size (priv->image_width,
-                                        priv->image_height,
-                                        flags,
-                                        COGL_PIXEL_FORMAT_RGBA_8888_PRE);
-
-      cogl_pipeline_set_layer_texture (priv->pipeline, 0, tex);
-
-      priv->fbo_handle = cogl_offscreen_new_to_texture (tex);
-
-      /* The pipeline now has a reference to the texture so it will
-         stick around */
-      cogl_object_unref (tex);
-
-      if (priv->fbo_handle == NULL)
-        {
-          g_warning ("%s: Offscreen texture creation failed", G_STRLOC);
-	  CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REALIZED);
-          return;
-        }
-
-      clutter_actor_set_size (actor, priv->image_width, priv->image_height);
-
-      return;
-    }
-
   /* If the texture is not a FBO, then realization is a no-op but we
    * still want to be in REALIZED state to maintain invariants.
    * ClutterTexture doesn't need to be realized to have a Cogl texture
@@ -403,24 +346,6 @@ clutter_texture_get_preferred_height (ClutterActor *self,
     }
 }
 
-static void
-clutter_texture_allocate (ClutterActor           *self,
-			  const ClutterActorBox  *box,
-                          ClutterAllocationFlags  flags)
-{
-  ClutterTexturePrivate *priv = CLUTTER_TEXTURE (self)->priv;
-
-  /* chain up to set actor->allocation */
-  CLUTTER_ACTOR_CLASS (clutter_texture_parent_class)->allocate (self,
-                                                                box,
-                                                                flags);
-
-  /* If we adopted the source fbo then allocate that at its preferred
-     size */
-  if (priv->fbo_source && clutter_actor_get_parent (priv->fbo_source) == self)
-    clutter_actor_allocate_preferred_size (priv->fbo_source, flags);
-}
-
 static gboolean
 clutter_texture_has_overlaps (ClutterActor *self)
 {
@@ -430,145 +355,6 @@ clutter_texture_has_overlaps (ClutterActor *self)
 }
 
 static void
-set_viewport_with_buffer_under_fbo_source (ClutterActor *fbo_source,
-                                           int viewport_width,
-                                           int viewport_height)
-{
-  ClutterActorBox box = { 0, };
-  float x_offset, y_offset;
-
-  if (clutter_actor_get_paint_box (fbo_source, &box))
-    clutter_actor_box_get_origin (&box, &x_offset, &y_offset);
-  else
-    {
-      /* As a fallback when the paint box can't be determined we use
-       * the transformed allocation to come up with an offset instead.
-       *
-       * FIXME: when we don't have a paint box we should instead be
-       * falling back to a stage sized fbo with an offset of (0,0)
-       */
-
-      ClutterVertex verts[4];
-      float x_min = G_MAXFLOAT, y_min = G_MAXFLOAT;
-      int i;
-
-      /* Get the actors allocation transformed into screen coordinates.
-       *
-       * XXX: Note: this may not be a bounding box for the actor, since an
-       * actor with depth may escape the box due to its perspective
-       * projection. */
-      clutter_actor_get_abs_allocation_vertices (fbo_source, verts);
-
-      for (i = 0; i < G_N_ELEMENTS (verts); ++i)
-        {
-          if (verts[i].x < x_min)
-           x_min = verts[i].x;
-          if (verts[i].y < y_min)
-           y_min = verts[i].y;
-        }
-
-      /* XXX: It's not good enough to round by simply truncating the fraction here
-       * via a cast, as it results in offscreen rendering being offset by 1 pixel
-       * in many cases... */
-#define ROUND(x) ((x) >= 0 ? (long)((x) + 0.5) : (long)((x) - 0.5))
-
-      x_offset = ROUND (x_min);
-      y_offset = ROUND (y_min);
-
-#undef ROUND
-    }
-
-  /* translate the viewport so that the source actor lands on the
-   * sub-region backed by the offscreen framebuffer... */
-  cogl_set_viewport (-x_offset, -y_offset, viewport_width, viewport_height);
-}
-
-static void
-update_fbo (ClutterActor *self)
-{
-  ClutterTexture        *texture = CLUTTER_TEXTURE (self);
-  ClutterTexturePrivate *priv = texture->priv;
-  ClutterActor          *head;
-  ClutterShader         *shader = NULL;
-  ClutterActor          *stage = NULL;
-  CoglMatrix             projection;
-  CoglColor              transparent_col;
-
-  head = _clutter_context_peek_shader_stack ();
-  if (head != NULL)
-    shader = clutter_actor_get_shader (head);
-
-  /* Temporarily turn off the shader on the top of the context's
-   * shader stack, to restore the GL pipeline to it's natural state.
-   */
-  if (shader != NULL)
-    clutter_shader_set_is_enabled (shader, FALSE);
-
-  /* Redirect drawing to the fbo */
-  cogl_push_framebuffer (priv->fbo_handle);
-
-  if ((stage = clutter_actor_get_stage (self)) != NULL)
-    {
-      gfloat stage_width, stage_height;
-      ClutterActor *source_parent;
-
-      /* We copy the projection and modelview matrices from the stage to
-       * the offscreen framebuffer and create a viewport larger than the
-       * offscreen framebuffer - the same size as the stage.
-       *
-       * The fbo source actor gets rendered into this stage size viewport at the
-       * same position it normally would after applying all it's usual parent
-       * transforms and it's own scale and rotate transforms etc.
-       *
-       * The viewport is offset such that the offscreen buffer will be positioned
-       * under the actor.
-       */
-
-      _clutter_stage_get_projection_matrix (CLUTTER_STAGE (stage), &projection);
-
-      /* Set the projection matrix modelview matrix as it is for the
-       * stage... */
-      cogl_set_projection_matrix (&projection);
-
-      clutter_actor_get_size (stage, &stage_width, &stage_height);
-
-      /* Set a negatively offset the viewport so that the offscreen
-       * framebuffer is position underneath the fbo_source actor... */
-      set_viewport_with_buffer_under_fbo_source (priv->fbo_source,
-                                                 stage_width,
-                                                 stage_height);
-
-      /* Apply the source's parent transformations to the modelview */
-      if ((source_parent = clutter_actor_get_parent (priv->fbo_source)))
-        {
-          CoglMatrix modelview;
-          cogl_matrix_init_identity (&modelview);
-          _clutter_actor_apply_relative_transformation_matrix (source_parent,
-                                                               NULL,
-                                                               &modelview);
-          cogl_set_modelview_matrix (&modelview);
-        }
-    }
-
-
-  /* cogl_clear is called to clear the buffers */
-  cogl_color_init_from_4ub (&transparent_col, 0, 0, 0, 0);
-  cogl_clear (&transparent_col,
-              COGL_BUFFER_BIT_COLOR |
-              COGL_BUFFER_BIT_DEPTH);
-
-  /* Render the actor to the fbo */
-  clutter_actor_paint (priv->fbo_source);
-
-  /* Restore drawing to the previous framebuffer */
-  cogl_pop_framebuffer ();
-
-  /* If there is a shader on top of the shader stack, turn it back on. */
-  if (shader != NULL)
-    clutter_shader_set_is_enabled (shader, TRUE);
-}
-
-static void
 gen_texcoords_and_draw_cogl_rectangle (ClutterActor *self)
 {
   ClutterTexture *texture = CLUTTER_TEXTURE (self);
@@ -652,9 +438,6 @@ clutter_texture_pick (ClutterActor       *self,
           return;
         }
 
-      if (priv->fbo_handle != NULL)
-        update_fbo (self);
-
       cogl_color_init_from_4ub (&pick_color,
                                 color->red,
                                 color->green,
@@ -683,9 +466,6 @@ clutter_texture_paint (ClutterActor *self)
 		clutter_actor_get_name (self) ? clutter_actor_get_name (self)
                                               : "unknown");
 
-  if (priv->fbo_handle != NULL)
-    update_fbo (self);
-
   cogl_pipeline_set_color4ub (priv->pipeline,
 			      paint_opacity,
                               paint_opacity,
@@ -779,7 +559,6 @@ clutter_texture_dispose (GObject *object)
   ClutterTexturePrivate *priv = texture->priv;
 
   texture_free_gl_resources (texture);
-  texture_fbo_free_resources (texture);
 
   clutter_texture_async_load_cancel (texture);
 
@@ -980,7 +759,6 @@ clutter_texture_class_init (ClutterTextureClass *klass)
 
   actor_class->get_preferred_width  = clutter_texture_get_preferred_width;
   actor_class->get_preferred_height = clutter_texture_get_preferred_height;
-  actor_class->allocate             = clutter_texture_allocate;
 
   gobject_class->dispose      = clutter_texture_dispose;
   gobject_class->finalize     = clutter_texture_finalize;
@@ -1284,7 +1062,6 @@ clutter_texture_init (ClutterTexture *self)
   priv->repeat_x          = FALSE;
   priv->repeat_y          = FALSE;
   priv->sync_actor_size   = TRUE;
-  priv->fbo_handle        = NULL;
   priv->pick_pipeline     = NULL;
   priv->keep_aspect_ratio = FALSE;
   priv->pick_with_alpha   = FALSE;
@@ -1471,10 +1248,6 @@ clutter_texture_set_cogl_texture (ClutterTexture  *texture,
      already using */
   cogl_object_ref (cogl_tex);
 
-  /* Remove FBO if exisiting */
-  if (priv->fbo_source)
-    texture_fbo_free_resources (texture);
-
   /* Remove old texture */
   texture_free_gl_resources (texture);
 
@@ -1688,67 +1461,6 @@ clutter_texture_set_from_rgb_data (ClutterTexture       *texture,
 					error);
 }
 
-/**
- * clutter_texture_set_from_yuv_data:
- * @texture: A #ClutterTexture
- * @data: (array): Image data in YUV type colorspace.
- * @width: Width in pixels of image data.
- * @height: Height in pixels of image data
- * @flags: #ClutterTextureFlags
- * @error: Return location for a #GError, or %NULL.
- *
- * Sets a #ClutterTexture from YUV image data. If an error occurred,
- * %FALSE is returned and @error is set.
- *
- * The YUV support depends on the driver; the format supported by the
- * few drivers exposing this capability are not really useful.
- *
- * The proper way to convert image data in any YUV colorspace to any
- * RGB colorspace is to use a fragment shader associated with the
- * #ClutterTexture material.
- *
- * Return value: %TRUE if the texture was successfully updated
- *
- * Since: 0.4
- *
- * Deprecated: 1.10: Use clutter_texture_get_cogl_material() and
- *   the Cogl API to install a fragment shader for decoding YUV
- *   formats on the GPU
- */
-gboolean
-clutter_texture_set_from_yuv_data (ClutterTexture     *texture,
-				   const guchar       *data,
-				   gint                width,
-				   gint                height,
-				   ClutterTextureFlags flags,
-				   GError            **error)
-{
-  g_return_val_if_fail (CLUTTER_IS_TEXTURE (texture), FALSE);
-
-  if (!clutter_feature_available (CLUTTER_FEATURE_TEXTURE_YUV))
-    {
-      g_set_error (error, CLUTTER_TEXTURE_ERROR,
-                   CLUTTER_TEXTURE_ERROR_NO_YUV,
-                   _("YUV textures are not supported"));
-      return FALSE;
-    }
-
-  /* Convert the flags to a CoglPixelFormat */
-  if ((flags & CLUTTER_TEXTURE_YUV_FLAG_YUV2))
-    {
-      g_set_error (error, CLUTTER_TEXTURE_ERROR,
-		   CLUTTER_TEXTURE_ERROR_BAD_FORMAT,
-		   _("YUV2 textues are not supported"));
-      return FALSE;
-    }
-
-  return clutter_texture_set_from_data (texture, data,
-					COGL_PIXEL_FORMAT_YUV,
-					width, height,
-					width * 3, 3,
-					error);
-}
-
 /*
  * clutter_texture_async_load_complete:
  * @self: a #ClutterTexture
@@ -2358,345 +2070,6 @@ clutter_texture_set_area_from_rgb_data (ClutterTexture     *texture,
   return TRUE;
 }
 
-static void
-on_fbo_source_size_change (GObject          *object,
-                           GParamSpec       *param_spec,
-                           ClutterTexture   *texture)
-{
-  ClutterTexturePrivate *priv = texture->priv;
-  gfloat w, h;
-  ClutterActorBox box;
-  gboolean status;
-
-  status = clutter_actor_get_paint_box (priv->fbo_source, &box);
-  if (status)
-    clutter_actor_box_get_size (&box, &w, &h);
-
-  /* In the end we will size the framebuffer according to the paint
-   * box, but for code that does:
-   *   tex = clutter_texture_new_from_actor (src);
-   *   clutter_actor_get_size (tex, &width, &height);
-   * it seems more helpfull to return the src actor size if it has a
-   * degenerate paint box. The most likely reason it will have a
-   * degenerate paint box is simply that the src currently has no
-   * parent. */
-  if (status == FALSE || w == 0 || h == 0)
-    clutter_actor_get_size (priv->fbo_source, &w, &h);
-
-  /* We can't create a texture with a width or height of 0... */
-  w = MAX (1, w);
-  h = MAX (1, h);
-
-  if (w != priv->image_width || h != priv->image_height)
-    {
-      CoglTextureFlags flags = COGL_TEXTURE_NONE;
-      CoglHandle tex;
-
-      /* tear down the FBO */
-      if (priv->fbo_handle != NULL)
-        cogl_object_unref (priv->fbo_handle);
-
-      texture_free_gl_resources (texture);
-
-      priv->image_width = w;
-      priv->image_height = h;
-
-      flags |= COGL_TEXTURE_NO_SLICING;
-
-      tex = cogl_texture_new_with_size (MAX (priv->image_width, 1),
-                                        MAX (priv->image_height, 1),
-                                        flags,
-                                        COGL_PIXEL_FORMAT_RGBA_8888_PRE);
-
-      cogl_pipeline_set_layer_texture (priv->pipeline, 0, tex);
-
-      priv->fbo_handle = cogl_offscreen_new_to_texture (tex);
-
-      /* The pipeline now has a reference to the texture so it will
-         stick around */
-      cogl_object_unref (tex);
-
-      if (priv->fbo_handle == NULL)
-        {
-          g_warning ("%s: Offscreen texture creation failed", G_STRLOC);
-          return;
-        }
-
-      clutter_actor_set_size (CLUTTER_ACTOR (texture), w, h);
-    }
-}
-
-static void
-on_fbo_parent_change (ClutterActor        *actor,
-                      ClutterActor        *old_parent,
-                      ClutterTexture      *texture)
-{
-  ClutterActor        *parent = CLUTTER_ACTOR(texture);
-
-  while ((parent = clutter_actor_get_parent (parent)) != NULL)
-    {
-      if (parent == actor)
-        {
-          g_warning ("Offscreen texture is ancestor of source!");
-          /* Desperate but will avoid infinite loops */
-          clutter_actor_remove_child (parent, actor);
-        }
-    }
-}
-
-static void
-fbo_source_queue_redraw_cb (ClutterActor *source,
-			    ClutterActor *origin,
-			    ClutterTexture *texture)
-{
-  clutter_actor_queue_redraw (CLUTTER_ACTOR (texture));
-}
-
-static void
-fbo_source_queue_relayout_cb (ClutterActor *source,
-			      ClutterTexture *texture)
-{
-  clutter_actor_queue_relayout (CLUTTER_ACTOR (texture));
-}
-
-/**
- * clutter_texture_new_from_actor:
- * @actor: A source #ClutterActor
- *
- * Creates a new #ClutterTexture object with its source a prexisting
- * actor (and associated children). The textures content will contain
- * 'live' redirected output of the actors scene.
- *
- * Note this function is intented as a utility call for uniformly applying
- * shaders to groups and other potential visual effects. It requires that
- * the %CLUTTER_FEATURE_OFFSCREEN feature is supported by the current backend
- * and the target system.
- *
- * Some tips on usage:
- *
- * <itemizedlist>
- *   <listitem>
- *     <para>The source actor must be made visible (i.e by calling
- *     #clutter_actor_show).</para>
- *   </listitem>
- *   <listitem>
- *     <para>The source actor must have a parent in order for it to be
- *     allocated a size from the layouting mechanism. If the source
- *     actor does not have a parent when this function is called then
- *     the ClutterTexture will adopt it and allocate it at its
- *     preferred size. Using this you can clone an actor that is
- *     otherwise not displayed. Because of this feature if you do
- *     intend to display the source actor then you must make sure that
- *     the actor is parented before calling
- *     clutter_texture_new_from_actor() or that you unparent it before
- *     adding it to a container.</para>
- *   </listitem>
- *   <listitem>
- *     <para>When getting the image for the clone texture, Clutter
- *     will attempt to render the source actor exactly as it would
- *     appear if it was rendered on screen. The source actor's parent
- *     transformations are taken into account. Therefore if your
- *     source actor is rotated along the X or Y axes so that it has
- *     some depth, the texture will appear differently depending on
- *     the on-screen location of the source actor. While painting the
- *     source actor, Clutter will set up a temporary asymmetric
- *     perspective matrix as the projection matrix so that the source
- *     actor will be projected as if a small section of the screen was
- *     being viewed. Before version 0.8.2, an orthogonal identity
- *     projection was used which meant that the source actor would be
- *     clipped if any part of it was not on the zero Z-plane.</para>
- *   </listitem>
- *   <listitem>
- *     <para>Avoid reparenting the source with the created texture.</para>
- *   </listitem>
- *   <listitem>
- *     <para>A group can be padded with a transparent rectangle as to
- *     provide a border to contents for shader output (blurring text
- *     for example).</para>
- *   </listitem>
- *   <listitem>
- *     <para>The texture will automatically resize to contain a further
- *     transformed source. However, this involves overhead and can be
- *     avoided by placing the source actor in a bounding group
- *     sized large enough to contain any child tranformations.</para>
- *   </listitem>
- *   <listitem>
- *     <para>Uploading pixel data to the texture (e.g by using
- *     clutter_texture_set_from_file()) will destroy the offscreen texture
- *     data and end redirection.</para>
- *   </listitem>
- *   <listitem>
- *     <para>cogl_texture_get_data() with the handle returned by
- *     clutter_texture_get_cogl_texture() can be used to read the
- *     offscreen texture pixels into a pixbuf.</para>
- *   </listitem>
- * </itemizedlist>
- *
- * Return value: A newly created #ClutterTexture object, or %NULL on failure.
- *
- * Deprecated: 1.8: Use the #ClutterOffscreenEffect and #ClutterShaderEffect
- *   directly on the intended #ClutterActor to replace the functionality of
- *   this function.
- *
- * Since: 0.6
- */
-ClutterActor *
-clutter_texture_new_from_actor (ClutterActor *actor)
-{
-  ClutterTexture        *texture;
-  ClutterTexturePrivate *priv;
-  gfloat w, h;
-  ClutterActorBox box;
-  gboolean status;
-
-  g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL);
-
-  if (clutter_feature_available (CLUTTER_FEATURE_OFFSCREEN) == FALSE)
-    return NULL;
-
-  if (!CLUTTER_ACTOR_IS_REALIZED (actor))
-    {
-      clutter_actor_realize (actor);
-
-      if (!CLUTTER_ACTOR_IS_REALIZED (actor))
-	return NULL;
-    }
-
-  status = clutter_actor_get_paint_box (actor, &box);
-  if (status)
-    clutter_actor_box_get_size (&box, &w, &h);
-
-  /* In the end we will size the framebuffer according to the paint
-   * box, but for code that does:
-   *   tex = clutter_texture_new_from_actor (src);
-   *   clutter_actor_get_size (tex, &width, &height);
-   * it seems more helpfull to return the src actor size if it has a
-   * degenerate paint box. The most likely reason it will have a
-   * degenerate paint box is simply that the src currently has no
-   * parent. */
-  if (status == FALSE || w == 0 || h == 0)
-    clutter_actor_get_size (actor, &w, &h);
-
-  /* We can't create a 0x0 fbo so always bump the size up to at least
-   * 1 */
-  w = MAX (1, w);
-  h = MAX (1, h);
-
-  /* Hopefully now were good.. */
-  texture = g_object_new (CLUTTER_TYPE_TEXTURE,
-                          "disable-slicing", TRUE,
-                          NULL);
-
-  priv = texture->priv;
-
-  priv->fbo_source = g_object_ref_sink (actor);
-
-  /* If the actor doesn't have a parent then claim it so that it will
-     get a size allocation during layout */
-  if (clutter_actor_get_parent (actor) == NULL)
-    clutter_actor_add_child (CLUTTER_ACTOR (texture), actor);
-
-  /* Connect up any signals which could change our underlying size */
-  g_signal_connect (actor,
-                    "notify::width",
-                    G_CALLBACK(on_fbo_source_size_change),
-                    texture);
-  g_signal_connect (actor,
-                    "notify::height",
-                    G_CALLBACK(on_fbo_source_size_change),
-                    texture);
-  g_signal_connect (actor,
-                    "notify::scale-x",
-                    G_CALLBACK(on_fbo_source_size_change),
-                    texture);
-  g_signal_connect (actor,
-                    "notify::scale-y",
-                    G_CALLBACK(on_fbo_source_size_change),
-                    texture);
-  g_signal_connect (actor,
-                    "notify::rotation-angle-x",
-                    G_CALLBACK(on_fbo_source_size_change),
-                    texture);
-  g_signal_connect (actor,
-                    "notify::rotation-angle-y",
-                    G_CALLBACK(on_fbo_source_size_change),
-                    texture);
-  g_signal_connect (actor,
-                    "notify::rotation-angle-z",
-                    G_CALLBACK(on_fbo_source_size_change),
-                    texture);
-
-  g_signal_connect (actor, "queue-relayout",
-                    G_CALLBACK (fbo_source_queue_relayout_cb), texture);
-  g_signal_connect (actor, "queue-redraw",
-                    G_CALLBACK (fbo_source_queue_redraw_cb), texture);
-
-  /* And a warning if the source becomes a child of the texture */
-  g_signal_connect (actor,
-                    "parent-set",
-                    G_CALLBACK(on_fbo_parent_change),
-                    texture);
-
-  priv->image_width = w;
-  priv->image_height = h;
-
-  clutter_actor_set_size (CLUTTER_ACTOR (texture),
-                          priv->image_width,
-                          priv->image_height);
-
-  return CLUTTER_ACTOR (texture);
-}
-
-static void
-texture_fbo_free_resources (ClutterTexture *texture)
-{
-  ClutterTexturePrivate *priv;
-
-  priv = texture->priv;
-
-  if (priv->fbo_source != NULL)
-    {
-      ClutterActor *parent;
-
-      parent = clutter_actor_get_parent (priv->fbo_source);
-
-      /* If we parented the texture then unparent it again so that it
-	 will lose the reference */
-      if (parent == CLUTTER_ACTOR (texture))
-	clutter_actor_remove_child (parent, priv->fbo_source);
-
-      g_signal_handlers_disconnect_by_func
-                            (priv->fbo_source,
-                             G_CALLBACK(on_fbo_parent_change),
-                             texture);
-
-      g_signal_handlers_disconnect_by_func
-                            (priv->fbo_source,
-                             G_CALLBACK(on_fbo_source_size_change),
-                             texture);
-
-      g_signal_handlers_disconnect_by_func
-                            (priv->fbo_source,
-                             G_CALLBACK(fbo_source_queue_relayout_cb),
-                             texture);
-
-      g_signal_handlers_disconnect_by_func
-                            (priv->fbo_source,
-                             G_CALLBACK(fbo_source_queue_redraw_cb),
-                             texture);
-
-      g_object_unref (priv->fbo_source);
-
-      priv->fbo_source = NULL;
-    }
-
-  if (priv->fbo_handle != NULL)
-    {
-      cogl_object_unref (priv->fbo_handle);
-      priv->fbo_handle = NULL;
-    }
-}
-
 /**
  * clutter_texture_set_sync_size:
  * @texture: a #ClutterTexture



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]