summaryrefslogtreecommitdiff
path: root/cogl/cogl-framebuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'cogl/cogl-framebuffer.c')
-rw-r--r--cogl/cogl-framebuffer.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index fbd3dd6d..8487578b 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -607,9 +607,9 @@ _cogl_framebuffer_flush_dependency_journals (CoglFramebuffer *framebuffer)
}
CoglOffscreen *
-_cogl_offscreen_new_to_texture_full (CoglTexture *texture,
- CoglOffscreenFlags create_flags,
- int level)
+_cogl_offscreen_new_with_texture_full (CoglTexture *texture,
+ CoglOffscreenFlags create_flags,
+ int level)
{
CoglContext *ctx = texture->context;
CoglOffscreen *offscreen;
@@ -617,7 +617,6 @@ _cogl_offscreen_new_to_texture_full (CoglTexture *texture,
int level_width;
int level_height;
CoglOffscreen *ret;
- CoglError *error = NULL;
_COGL_RETURN_VAL_IF_FAIL (cogl_is_texture (texture), NULL);
_COGL_RETURN_VAL_IF_FAIL (level < _cogl_texture_get_n_levels (texture),
@@ -649,9 +648,19 @@ _cogl_offscreen_new_to_texture_full (CoglTexture *texture,
_cogl_texture_associate_framebuffer (texture, fb);
- if (!cogl_framebuffer_allocate (ret, &error))
+ return ret;
+}
+
+/* XXX: deprecated api */
+CoglOffscreen *
+cogl_offscreen_new_to_texture (CoglTexture *texture)
+{
+ CoglOffscreen *ret = _cogl_offscreen_new_with_texture_full (texture, 0, 0);
+ CoglError *error = NULL;
+
+ if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (ret), &error))
{
- cogl_object_unref (offscreen);
+ cogl_object_unref (ret);
cogl_error_free (error);
ret = NULL;
}
@@ -660,9 +669,9 @@ _cogl_offscreen_new_to_texture_full (CoglTexture *texture,
}
CoglOffscreen *
-cogl_offscreen_new_to_texture (CoglTexture *texture)
+cogl_offscreen_new_with_texture (CoglTexture *texture)
{
- return _cogl_offscreen_new_to_texture_full (texture, 0, 0);
+ return _cogl_offscreen_new_with_texture_full (texture, 0, 0);
}
static void