[cogl/fosdem-2012: 1/17] sub-texture: Exposes a getter for parent texture



commit 9913a8d4889a57c072808ade6b2a0b3076b049bf
Author: Robert Bragg <robert linux intel com>
Date:   Mon Dec 12 18:20:00 2011 +0000

    sub-texture: Exposes a getter for parent texture
    
    This adds a cogl_sub_texture_get_parent getter for the parent of a
    CoglSubTexture.

 cogl/cogl-sub-texture.c |    6 ++++++
 cogl/cogl-sub-texture.h |   16 ++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/cogl/cogl-sub-texture.c b/cogl/cogl-sub-texture.c
index d72c7ba..3967ecd 100644
--- a/cogl/cogl-sub-texture.c
+++ b/cogl/cogl-sub-texture.c
@@ -256,6 +256,12 @@ cogl_sub_texture_new (CoglContext *ctx,
   return _cogl_sub_texture_handle_new (sub_tex);
 }
 
+CoglTexture *
+cogl_sub_texture_get_parent (CoglSubTexture *sub_texture)
+{
+  return sub_texture->next_texture;
+}
+
 static int
 _cogl_sub_texture_get_max_waste (CoglTexture *tex)
 {
diff --git a/cogl/cogl-sub-texture.h b/cogl/cogl-sub-texture.h
index ca54d3b..6dae9ae 100644
--- a/cogl/cogl-sub-texture.h
+++ b/cogl/cogl-sub-texture.h
@@ -89,6 +89,22 @@ cogl_sub_texture_new (CoglContext *ctx,
                       int sub_width,
                       int sub_height);
 
+/**
+ * cogl_sub_texture_get_parent:
+ * @sub_texture: A pointer to a #CoglSubTexture
+ *
+ * Retrieves the parent texture that @sub_texture derives its content
+ * from.  This is the texture that was passed to
+ * cogl_sub_texture_new() as the parent_texture argument.
+ *
+ * Return value: (transfer none): The parent texture that @sub_texture
+ *               derives its content from.
+ * Since: 1.10
+ * Stability: unstable
+ */
+CoglTexture *
+cogl_sub_texture_get_parent (CoglSubTexture *sub_texture);
+
 #define cogl_is_sub_texture cogl_is_sub_texture_EXP
 /**
  * cogl_is_sub_texture:



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