summaryrefslogtreecommitdiff
path: root/cogl/cogl-texture-2d.c
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2012-04-04 13:57:42 +0100
committerNeil Roberts <neil@linux.intel.com>2012-04-04 14:24:01 +0100
commite7df2dbf79b7c5d40fb75452f8377a90d12eb910 (patch)
treea0a782eb2a7f2b05558f54fb9fa5c5f353d3f132 /cogl/cogl-texture-2d.c
parentbe9d5b34c66ac81656e37779eb64891a062f90af (diff)
downloadcogl-e7df2dbf79b7c5d40fb75452f8377a90d12eb910.tar.gz
bitmap: Store a pointer to the context
This adds a context member to CoglBitmap which stores the context it was created with. That way it can be used in texture constructors which use a bitmap. There is also an internal private function to get the context out of the bitmap which all of the texture constructors now use. _cogl_texture_3d_new_from_bitmap has had its context parameter removed so that it more closely matches the other bitmap constructors. Reviewed-by: Robert Bragg <robert@linux.intel.com>
Diffstat (limited to 'cogl/cogl-texture-2d.c')
-rw-r--r--cogl/cogl-texture-2d.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cogl/cogl-texture-2d.c b/cogl/cogl-texture-2d.c
index a3f04263..b14c6154 100644
--- a/cogl/cogl-texture-2d.c
+++ b/cogl/cogl-texture-2d.c
@@ -225,11 +225,12 @@ _cogl_texture_2d_new_from_bitmap (CoglBitmap *bmp,
GLenum gl_format;
GLenum gl_type;
guint8 *data;
-
- _COGL_GET_CONTEXT (ctx, COGL_INVALID_HANDLE);
+ CoglContext *ctx;
_COGL_RETURN_VAL_IF_FAIL (bmp != NULL, COGL_INVALID_HANDLE);
+ ctx = _cogl_bitmap_get_context (bmp);
+
internal_format =
_cogl_texture_determine_internal_format (cogl_bitmap_get_format (bmp),
internal_format);