mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
bitmap: Remove use of CoglHandle in the CoglBitmap API
This replaces the use of CoglHandle with strongly type CoglBitmap * pointers instead. The only function not converted for now is cogl_is_bitmap which will be done in a later commit.
This commit is contained in:
parent
817c1cddcc
commit
653d1a3254
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "cogl-handle.h"
|
#include "cogl-handle.h"
|
||||||
|
|
||||||
typedef struct _CoglBitmap
|
struct _CoglBitmap
|
||||||
{
|
{
|
||||||
CoglHandleObject _parent;
|
CoglHandleObject _parent;
|
||||||
guint8 *data;
|
guint8 *data;
|
||||||
@ -38,7 +38,7 @@ typedef struct _CoglBitmap
|
|||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
int rowstride;
|
int rowstride;
|
||||||
} CoglBitmap;
|
};
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_cogl_bitmap_can_convert (CoglPixelFormat src, CoglPixelFormat dst);
|
_cogl_bitmap_can_convert (CoglPixelFormat src, CoglPixelFormat dst);
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
static void _cogl_bitmap_free (CoglBitmap *bmp);
|
static void _cogl_bitmap_free (CoglBitmap *bmp);
|
||||||
|
|
||||||
COGL_HANDLE_DEFINE (Bitmap, bitmap);
|
COGL_OBJECT_DEFINE (Bitmap, bitmap);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_cogl_bitmap_free (CoglBitmap *bmp)
|
_cogl_bitmap_free (CoglBitmap *bmp)
|
||||||
@ -162,7 +162,7 @@ cogl_bitmap_get_size_from_file (const char *filename,
|
|||||||
return _cogl_bitmap_get_size_from_file (filename, width, height);
|
return _cogl_bitmap_get_size_from_file (filename, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
CoglHandle
|
CoglBitmap *
|
||||||
cogl_bitmap_new_from_file (const char *filename,
|
cogl_bitmap_new_from_file (const char *filename,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
@ -185,6 +185,6 @@ cogl_bitmap_new_from_file (const char *filename,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = g_memdup (&bmp, sizeof (CoglBitmap));
|
ret = g_memdup (&bmp, sizeof (CoglBitmap));
|
||||||
return _cogl_bitmap_handle_new (ret);
|
return _cogl_bitmap_object_new (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
typedef struct _CoglBitmap CoglBitmap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:cogl-bitmap
|
* SECTION:cogl-bitmap
|
||||||
* @short_description: Fuctions for loading images
|
* @short_description: Fuctions for loading images
|
||||||
@ -51,12 +53,12 @@ G_BEGIN_DECLS
|
|||||||
* Loads an image file from disk. This function can be safely called from
|
* Loads an image file from disk. This function can be safely called from
|
||||||
* within a thread.
|
* within a thread.
|
||||||
*
|
*
|
||||||
* Return value: a #CoglHandle to the new loaded image data, or
|
* Return value: a #CoglBitmap to the new loaded image data, or
|
||||||
* %COGL_INVALID_HANDLE if loading the image failed.
|
* %NULL if loading the image failed.
|
||||||
*
|
*
|
||||||
* Since: 1.0
|
* Since: 1.0
|
||||||
*/
|
*/
|
||||||
CoglHandle
|
CoglBitmap *
|
||||||
cogl_bitmap_new_from_file (const char *filename,
|
cogl_bitmap_new_from_file (const char *filename,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user