summaryrefslogtreecommitdiff
path: root/cogl/cogl-bitmap.h
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2012-05-09 19:43:06 +0100
committerRobert Bragg <robert@linux.intel.com>2012-08-06 18:50:22 +0100
commit1686e754a70bce09781adb3c18118d27f36f0bee (patch)
tree0b71ea46a416e881cff7f27cc2e3b61831b6e32d /cogl/cogl-bitmap.h
parentd1dc4e1e0b69455c9df0a67bcc2aad7b55e3ee3a (diff)
downloadcogl-1686e754a70bce09781adb3c18118d27f36f0bee.tar.gz
bitmap: Adds cogl_android_bitmap_new_from_asset()
This adds some android specific api for creating a CoglBitmap from an Android asset. As part of the work it also seemed like a good time to change the internal bitmap constructors to take an explicit CoglContext argument and so the public cogl_bitmap_new_from_file() api was also changed accordingly to take a CoglContext pointer as the first argument. Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit 099d6d1b505b55bbd09c50d081deb41ab5764e19) Since we aren't able to break APIs on the 1.12 branch this cherry-pick skips the change to cogl_bitmap_new_from_file()
Diffstat (limited to 'cogl/cogl-bitmap.h')
-rw-r--r--cogl/cogl-bitmap.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/cogl/cogl-bitmap.h b/cogl/cogl-bitmap.h
index 5f5674a5..91714d44 100644
--- a/cogl/cogl-bitmap.h
+++ b/cogl/cogl-bitmap.h
@@ -33,6 +33,10 @@
#include <cogl/cogl-context.h>
#include <cogl/cogl-pixel-buffer.h>
+#ifdef COGL_HAS_ANDROID_SUPPORT
+#include <android/asset_manager.h>
+#endif
+
G_BEGIN_DECLS
typedef struct _CoglBitmap CoglBitmap;
@@ -65,6 +69,28 @@ CoglBitmap *
cogl_bitmap_new_from_file (const char *filename,
GError **error);
+#ifdef COGL_HAS_ANDROID_SUPPORT
+/**
+ * cogl_android_bitmap_new_from_asset:
+ * @context: A #CoglContext
+ * @manager: An Android Asset Manager.
+ * @filename: The file name for the asset
+ * @error: A return location for a GError exception.
+ *
+ * Loads an Android asset into a newly allocated #CoglBitmap.
+ *
+ * Return value: A newly allocated #CoglBitmap holding the image data of the
+ * specified asset.
+ *
+ * Since: 2.0
+ */
+CoglBitmap *
+cogl_android_bitmap_new_from_asset (CoglContext *context,
+ AAssetManager *manager,
+ const char *filename,
+ GError **error);
+#endif
+
#if defined (COGL_ENABLE_EXPERIMENTAL_API)
/**