From fc88e166f074ebb3a339c80234d8aaa3891541b9 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Mon, 12 Dec 2011 18:20:00 +0000 Subject: [PATCH] sub-texture: Exposes a getter for parent texture This adds a cogl_sub_texture_get_parent getter for the parent of a CoglSubTexture. Reviewed-by: Neil Roberts --- cogl/cogl-sub-texture.c | 6 ++++++ cogl/cogl-sub-texture.h | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/cogl/cogl-sub-texture.c b/cogl/cogl-sub-texture.c index d72c7bad7..3967ecd68 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 ca54d3b76..6dae9ae8a 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: