summaryrefslogtreecommitdiff
path: root/cogl/cogl-pixel-buffer.c
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2010-06-30 18:06:04 +0100
committerRobert Bragg <robert@linux.intel.com>2010-06-30 18:51:31 +0100
commit1000c80444a3d99d0965632a571b9ae19cb8d048 (patch)
tree7af57d09a8111f29507a16a50a42705f7826b02d /cogl/cogl-pixel-buffer.c
parenta0a06f0342d3acee95cd4927534fdd5affe46b5c (diff)
downloadcogl-1000c80444a3d99d0965632a571b9ae19cb8d048.tar.gz
cogl: declare experimental symbols consistently
We had several different ways of exposing experimental API, in one case the symbols had no special suffix, in two other ways the symbols were given an _EXP suffix but in different ways. This makes all experimental API have an _EXP suffix which is handled using #defines in the header so the prototypes in the .c and .h files don't have the suffix. The documented reason for the suffix is so that anyone watching Cogl for ABI changes who sees symbols disappear will hopefully understand what's going on.
Diffstat (limited to 'cogl/cogl-pixel-buffer.c')
-rw-r--r--cogl/cogl-pixel-buffer.c82
1 files changed, 15 insertions, 67 deletions
diff --git a/cogl/cogl-pixel-buffer.c b/cogl/cogl-pixel-buffer.c
index 2ad748d2..00ca0b93 100644
--- a/cogl/cogl-pixel-buffer.c
+++ b/cogl/cogl-pixel-buffer.c
@@ -84,62 +84,10 @@ cogl_pixel_buffer_vtable;
static const CoglBufferVtable
cogl_malloc_pixel_buffer_vtable;
-/* we don't want to use the stock COGL_HANDLE_DEFINE * for 2 reasons:
- * - it defines already deprecated symbols
- * - we want to suffix the public symbols by _EXP */
-
-#define COGL_HANDLE_DEFINE_EXP(TypeName, type_name) \
- \
-static CoglHandleClass _cogl_##type_name##_class; \
- \
-GQuark \
-_cogl_handle_##type_name##_get_type (void) \
-{ \
- static GQuark type = 0; \
- if (!type) \
- type = g_quark_from_static_string ("Cogl"#TypeName); \
- return type; \
-} \
- \
-static CoglHandle \
-_cogl_##type_name##_handle_new (Cogl##TypeName *new_obj) \
-{ \
- CoglHandleObject *obj = (CoglHandleObject *)&new_obj->_parent;\
- obj->ref_count = 1; \
- \
- obj->klass = &_cogl_##type_name##_class; \
- if (!obj->klass->type) \
- { \
- obj->klass->type = _cogl_handle_##type_name##_get_type ();\
- obj->klass->virt_free = _cogl_##type_name##_free; \
- } \
- \
- _COGL_HANDLE_DEBUG_NEW (TypeName, obj); \
- return (CoglHandle) new_obj; \
-} \
- \
-Cogl##TypeName * \
-_cogl_##type_name##_pointer_from_handle (CoglHandle handle) \
-{ \
- return (Cogl##TypeName *) handle; \
-} \
- \
-gboolean \
-cogl_is_##type_name##_EXP (CoglHandle handle) \
-{ \
- CoglHandleObject *obj = (CoglHandleObject *)handle; \
- \
- if (handle == COGL_INVALID_HANDLE) \
- return FALSE; \
- \
- return (obj->klass->type == \
- _cogl_handle_##type_name##_get_type ()); \
-}
-
-COGL_HANDLE_DEFINE_EXP(PixelBuffer, pixel_buffer)
+COGL_HANDLE_DEFINE (PixelBuffer, pixel_buffer)
CoglHandle
-cogl_pixel_buffer_new_EXP (unsigned int size)
+cogl_pixel_buffer_new (unsigned int size)
{
CoglPixelBuffer *pixel_buffer = g_slice_new0 (CoglPixelBuffer);
CoglBuffer *buffer = COGL_BUFFER (pixel_buffer);
@@ -180,10 +128,10 @@ cogl_pixel_buffer_new_EXP (unsigned int size)
}
CoglHandle
-cogl_pixel_buffer_new_for_size_EXP (unsigned int width,
- unsigned int height,
- CoglPixelFormat format,
- unsigned int *rowstride)
+cogl_pixel_buffer_new_for_size (unsigned int width,
+ unsigned int height,
+ CoglPixelFormat format,
+ unsigned int *rowstride)
{
CoglHandle buffer;
CoglPixelBuffer *pixel_buffer;
@@ -193,13 +141,13 @@ cogl_pixel_buffer_new_for_size_EXP (unsigned int width,
if (G_UNLIKELY (format == COGL_PIXEL_FORMAT_ANY))
return COGL_INVALID_HANDLE;
- /* for now we fallback to cogl_pixel_buffer_new_EXP, later, we could ask
+ /* for now we fallback to cogl_pixel_buffer_new, later, we could ask
* libdrm a tiled buffer for instance */
stride = width * _cogl_get_format_bpp (format);
if (rowstride)
*rowstride = stride;
- buffer = cogl_pixel_buffer_new_EXP (height * stride);
+ buffer = cogl_pixel_buffer_new (height * stride);
if (G_UNLIKELY (buffer == COGL_INVALID_HANDLE))
return COGL_INVALID_HANDLE;
@@ -316,13 +264,13 @@ _cogl_pixel_buffer_set_data (CoglBuffer *buffer,
#if 0
gboolean
-cogl_pixel_buffer_set_region_EXP (CoglHandle buffer,
- guint8 *data,
- unsigned int src_width,
- unsigned int src_height,
- unsigned int src_rowstride,
- unsigned int dst_x,
- unsigned int dst_y)
+cogl_pixel_buffer_set_region (CoglHandle buffer,
+ guint8 *data,
+ unsigned int src_width,
+ unsigned int src_height,
+ unsigned int src_rowstride,
+ unsigned int dst_x,
+ unsigned int dst_y)
{
if (!cogl_is_pixel_buffer (buffer))
return FALSE;