Switch use of primitive glib types to c99 equivalents

The coding style has for a long time said to avoid using redundant glib
data types such as gint or gchar etc because we feel that they make the
code look unnecessarily foreign to developers coming from outside of the
Gnome developer community.

Note: When we tried to find the historical rationale for the types we
just found that they were apparently only added for consistent syntax
highlighting which didn't seem that compelling.

Up until now we have been continuing to use some of the platform
specific type such as gint{8,16,32,64} and gsize but this patch switches
us over to using the standard c99 equivalents instead so we can further
ensure that our code looks familiar to the widest range of C developers
who might potentially contribute to Cogl.

So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
switches all Cogl code to instead use the int{8,16,32,64}_t and
uint{8,16,32,64}_t c99 types instead.

Instead of gsize we now use size_t

For now we are not going to use the c99 _Bool type and instead we have
introduced a new CoglBool type to use instead of gboolean.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)
This commit is contained in:
Robert Bragg 2012-04-16 21:56:40 +01:00
parent 09642a83b5
commit 54735dec84
252 changed files with 2090 additions and 2048 deletions

View File

@ -44,7 +44,7 @@ typedef struct _CoglPangoDisplayListRectangle CoglPangoDisplayListRectangle;
struct _CoglPangoDisplayList struct _CoglPangoDisplayList
{ {
gboolean color_override; CoglBool color_override;
CoglColor color; CoglColor color;
GSList *nodes; GSList *nodes;
GSList *last_node; GSList *last_node;
@ -62,7 +62,7 @@ struct _CoglPangoDisplayListNode
{ {
CoglPangoDisplayListNodeType type; CoglPangoDisplayListNodeType type;
gboolean color_override; CoglBool color_override;
CoglColor color; CoglColor color;
CoglPipeline *pipeline; CoglPipeline *pipeline;
@ -261,7 +261,7 @@ emit_vertex_buffer_geometry (CoglPangoDisplayListNode *node)
CoglAttributeBuffer *buffer; CoglAttributeBuffer *buffer;
CoglVertexP2T2 *verts, *v; CoglVertexP2T2 *verts, *v;
int n_verts; int n_verts;
gboolean allocated = FALSE; CoglBool allocated = FALSE;
CoglAttribute *attributes[2]; CoglAttribute *attributes[2];
CoglPrimitive *prim; CoglPrimitive *prim;
int i; int i;

View File

@ -167,7 +167,7 @@ cogl_pango_font_map_clear_glyph_cache (CoglPangoFontMap *fm)
*/ */
void void
cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *fm, cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *fm,
gboolean value) CoglBool value)
{ {
CoglPangoRenderer *renderer; CoglPangoRenderer *renderer;
@ -187,7 +187,7 @@ cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *fm,
* *
* Since: 1.0 * Since: 1.0
*/ */
gboolean CoglBool
cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *fm) cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *fm)
{ {
CoglPangoRenderer *renderer; CoglPangoRenderer *renderer;

View File

@ -49,16 +49,16 @@ struct _CoglPangoGlyphCache
/* TRUE if we've ever stored a texture in the global atlas. This is /* TRUE if we've ever stored a texture in the global atlas. This is
used to make sure we only register one callback to listen for used to make sure we only register one callback to listen for
global atlas reorganizations */ global atlas reorganizations */
gboolean using_global_atlas; CoglBool using_global_atlas;
/* True if some of the glyphs are dirty. This is used as an /* True if some of the glyphs are dirty. This is used as an
optimization in _cogl_pango_glyph_cache_set_dirty_glyphs to avoid optimization in _cogl_pango_glyph_cache_set_dirty_glyphs to avoid
iterating the hash table if we know none of them are dirty */ iterating the hash table if we know none of them are dirty */
gboolean has_dirty_glyphs; CoglBool has_dirty_glyphs;
/* Whether mipmapping is being used for this cache. This only /* Whether mipmapping is being used for this cache. This only
affects whether we decide to put the glyph in the global atlas */ affects whether we decide to put the glyph in the global atlas */
gboolean use_mipmapping; CoglBool use_mipmapping;
}; };
struct _CoglPangoGlyphCacheKey struct _CoglPangoGlyphCacheKey
@ -82,8 +82,8 @@ cogl_pango_glyph_cache_key_free (CoglPangoGlyphCacheKey *key)
g_slice_free (CoglPangoGlyphCacheKey, key); g_slice_free (CoglPangoGlyphCacheKey, key);
} }
static guint static unsigned int
cogl_pango_glyph_cache_hash_func (gconstpointer key) cogl_pango_glyph_cache_hash_func (const void *key)
{ {
const CoglPangoGlyphCacheKey *cache_key const CoglPangoGlyphCacheKey *cache_key
= (const CoglPangoGlyphCacheKey *) key; = (const CoglPangoGlyphCacheKey *) key;
@ -95,9 +95,8 @@ cogl_pango_glyph_cache_hash_func (gconstpointer key)
return GPOINTER_TO_UINT (cache_key->font) ^ cache_key->glyph; return GPOINTER_TO_UINT (cache_key->font) ^ cache_key->glyph;
} }
static gboolean static CoglBool
cogl_pango_glyph_cache_equal_func (gconstpointer a, cogl_pango_glyph_cache_equal_func (const void *a, const void *b)
gconstpointer b)
{ {
const CoglPangoGlyphCacheKey *key_a const CoglPangoGlyphCacheKey *key_a
= (const CoglPangoGlyphCacheKey *) a; = (const CoglPangoGlyphCacheKey *) a;
@ -112,7 +111,7 @@ cogl_pango_glyph_cache_equal_func (gconstpointer a,
} }
CoglPangoGlyphCache * CoglPangoGlyphCache *
cogl_pango_glyph_cache_new (gboolean use_mipmapping) cogl_pango_glyph_cache_new (CoglBool use_mipmapping)
{ {
CoglPangoGlyphCache *cache; CoglPangoGlyphCache *cache;
@ -198,7 +197,7 @@ cogl_pango_glyph_cache_update_position_cb (void *user_data,
value->dirty = TRUE; value->dirty = TRUE;
} }
static gboolean static CoglBool
cogl_pango_glyph_cache_add_to_global_atlas (CoglPangoGlyphCache *cache, cogl_pango_glyph_cache_add_to_global_atlas (CoglPangoGlyphCache *cache,
PangoFont *font, PangoFont *font,
PangoGlyph glyph, PangoGlyph glyph,
@ -244,7 +243,7 @@ cogl_pango_glyph_cache_add_to_global_atlas (CoglPangoGlyphCache *cache,
return TRUE; return TRUE;
} }
static gboolean static CoglBool
cogl_pango_glyph_cache_add_to_local_atlas (CoglPangoGlyphCache *cache, cogl_pango_glyph_cache_add_to_local_atlas (CoglPangoGlyphCache *cache,
PangoFont *font, PangoFont *font,
PangoGlyph glyph, PangoGlyph glyph,
@ -294,7 +293,7 @@ cogl_pango_glyph_cache_add_to_local_atlas (CoglPangoGlyphCache *cache,
CoglPangoGlyphCacheValue * CoglPangoGlyphCacheValue *
cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache, cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
gboolean create, CoglBool create,
PangoFont *font, PangoFont *font,
PangoGlyph glyph) PangoGlyph glyph)
{ {
@ -358,9 +357,9 @@ cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
} }
static void static void
_cogl_pango_glyph_cache_set_dirty_glyphs_cb (gpointer key_ptr, _cogl_pango_glyph_cache_set_dirty_glyphs_cb (void *key_ptr,
gpointer value_ptr, void *value_ptr,
gpointer user_data) void *user_data)
{ {
CoglPangoGlyphCacheKey *key = key_ptr; CoglPangoGlyphCacheKey *key = key_ptr;
CoglPangoGlyphCacheValue *value = value_ptr; CoglPangoGlyphCacheValue *value = value_ptr;

View File

@ -52,7 +52,7 @@ struct _CoglPangoGlyphCacheValue
/* This will be set to TRUE when the glyph atlas is reorganized /* This will be set to TRUE when the glyph atlas is reorganized
which means the glyph will need to be redrawn */ which means the glyph will need to be redrawn */
gboolean dirty; CoglBool dirty;
}; };
typedef void (* CoglPangoGlyphCacheDirtyFunc) (PangoFont *font, typedef void (* CoglPangoGlyphCacheDirtyFunc) (PangoFont *font,
@ -60,14 +60,14 @@ typedef void (* CoglPangoGlyphCacheDirtyFunc) (PangoFont *font,
CoglPangoGlyphCacheValue *value); CoglPangoGlyphCacheValue *value);
CoglPangoGlyphCache * CoglPangoGlyphCache *
cogl_pango_glyph_cache_new (gboolean use_mipmapping); cogl_pango_glyph_cache_new (CoglBool use_mipmapping);
void void
cogl_pango_glyph_cache_free (CoglPangoGlyphCache *cache); cogl_pango_glyph_cache_free (CoglPangoGlyphCache *cache);
CoglPangoGlyphCacheValue * CoglPangoGlyphCacheValue *
cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache, cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
gboolean create, CoglBool create,
PangoFont *font, PangoFont *font,
PangoGlyph glyph); PangoGlyph glyph);

View File

@ -44,7 +44,7 @@ struct _CoglPangoPipelineCache
CoglPipeline *base_texture_alpha_pipeline; CoglPipeline *base_texture_alpha_pipeline;
CoglPipeline *base_texture_rgba_pipeline; CoglPipeline *base_texture_rgba_pipeline;
gboolean use_mipmapping; CoglBool use_mipmapping;
}; };
struct _CoglPangoPipelineCacheEntry struct _CoglPangoPipelineCacheEntry
@ -58,14 +58,14 @@ struct _CoglPangoPipelineCacheEntry
}; };
static void static void
_cogl_pango_pipeline_cache_key_destroy (gpointer data) _cogl_pango_pipeline_cache_key_destroy (void *data)
{ {
if (data) if (data)
cogl_object_unref (data); cogl_object_unref (data);
} }
static void static void
_cogl_pango_pipeline_cache_value_destroy (gpointer data) _cogl_pango_pipeline_cache_value_destroy (void *data)
{ {
CoglPangoPipelineCacheEntry *cache_entry = data; CoglPangoPipelineCacheEntry *cache_entry = data;
@ -79,7 +79,7 @@ _cogl_pango_pipeline_cache_value_destroy (gpointer data)
} }
CoglPangoPipelineCache * CoglPangoPipelineCache *
_cogl_pango_pipeline_cache_new (gboolean use_mipmapping) _cogl_pango_pipeline_cache_new (CoglBool use_mipmapping)
{ {
CoglPangoPipelineCache *cache = g_new (CoglPangoPipelineCache, 1); CoglPangoPipelineCache *cache = g_new (CoglPangoPipelineCache, 1);

View File

@ -36,7 +36,7 @@ G_BEGIN_DECLS
typedef struct _CoglPangoPipelineCache CoglPangoPipelineCache; typedef struct _CoglPangoPipelineCache CoglPangoPipelineCache;
CoglPangoPipelineCache * CoglPangoPipelineCache *
_cogl_pango_pipeline_cache_new (gboolean use_mipmapping); _cogl_pango_pipeline_cache_new (CoglBool use_mipmapping);
/* Returns a pipeline that can be used to render glyphs in the given /* Returns a pipeline that can be used to render glyphs in the given
texture. The pipeline has a new reference so it is up to the caller texture. The pipeline has a new reference so it is up to the caller

View File

@ -30,8 +30,8 @@ G_BEGIN_DECLS
void _cogl_pango_renderer_clear_glyph_cache (CoglPangoRenderer *renderer); void _cogl_pango_renderer_clear_glyph_cache (CoglPangoRenderer *renderer);
void _cogl_pango_renderer_set_use_mipmapping (CoglPangoRenderer *renderer, void _cogl_pango_renderer_set_use_mipmapping (CoglPangoRenderer *renderer,
gboolean value); CoglBool value);
gboolean _cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer); CoglBool _cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer);
G_END_DECLS G_END_DECLS

View File

@ -56,7 +56,7 @@ struct _CoglPangoRenderer
CoglPangoRendererCaches no_mipmap_caches; CoglPangoRendererCaches no_mipmap_caches;
CoglPangoRendererCaches mipmap_caches; CoglPangoRendererCaches mipmap_caches;
gboolean use_mipmapping; CoglBool use_mipmapping;
/* The current display list that is being built */ /* The current display list that is being built */
CoglPangoDisplayList *display_list; CoglPangoDisplayList *display_list;
@ -82,7 +82,7 @@ struct _CoglPangoRendererQdata
/* Whether mipmapping was previously used to render this layout. We /* Whether mipmapping was previously used to render this layout. We
need to regenerate the display list if the mipmapping value is need to regenerate the display list if the mipmapping value is
changed because it will be using a different set of textures */ changed because it will be using a different set of textures */
gboolean mipmapping_used; CoglBool mipmapping_used;
}; };
static void static void
@ -446,12 +446,12 @@ _cogl_pango_renderer_clear_glyph_cache (CoglPangoRenderer *renderer)
void void
_cogl_pango_renderer_set_use_mipmapping (CoglPangoRenderer *renderer, _cogl_pango_renderer_set_use_mipmapping (CoglPangoRenderer *renderer,
gboolean value) CoglBool value)
{ {
renderer->use_mipmapping = value; renderer->use_mipmapping = value;
} }
gboolean CoglBool
_cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer) _cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer)
{ {
return renderer->use_mipmapping; return renderer->use_mipmapping;
@ -459,7 +459,7 @@ _cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer)
static CoglPangoGlyphCacheValue * static CoglPangoGlyphCacheValue *
cogl_pango_renderer_get_cached_glyph (PangoRenderer *renderer, cogl_pango_renderer_get_cached_glyph (PangoRenderer *renderer,
gboolean create, CoglBool create,
PangoFont *font, PangoFont *font,
PangoGlyph glyph) PangoGlyph glyph)
{ {

View File

@ -48,8 +48,8 @@ void cogl_pango_font_map_set_resolution (CoglPangoFontMap *font_
void cogl_pango_font_map_clear_glyph_cache (CoglPangoFontMap *fm); void cogl_pango_font_map_clear_glyph_cache (CoglPangoFontMap *fm);
void cogl_pango_ensure_glyph_cache_for_layout (PangoLayout *layout); void cogl_pango_ensure_glyph_cache_for_layout (PangoLayout *layout);
void cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *fm, void cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *fm,
gboolean value); CoglBool value);
gboolean cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *fm); CoglBool cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *fm);
PangoRenderer *cogl_pango_font_map_get_renderer (CoglPangoFontMap *fm); PangoRenderer *cogl_pango_font_map_get_renderer (CoglPangoFontMap *fm);
#define COGL_PANGO_TYPE_RENDERER (cogl_pango_renderer_get_type ()) #define COGL_PANGO_TYPE_RENDERER (cogl_pango_renderer_get_type ())

View File

@ -76,7 +76,7 @@ void
_cogl_atlas_texture_remove_reorganize_callback (GHookFunc callback, _cogl_atlas_texture_remove_reorganize_callback (GHookFunc callback,
void *user_data); void *user_data);
gboolean CoglBool
_cogl_is_atlas_texture (void *object); _cogl_is_atlas_texture (void *object);
#endif /* __COGL_ATLAS_TEXTURE_H */ #endif /* __COGL_ATLAS_TEXTURE_H */

View File

@ -69,7 +69,7 @@ _cogl_atlas_texture_create_sub_texture (CoglTexture *full_texture,
} }
static void static void
_cogl_atlas_texture_update_position_cb (gpointer user_data, _cogl_atlas_texture_update_position_cb (void *user_data,
CoglTexture *new_texture, CoglTexture *new_texture,
const CoglRectangleMapEntry *rectangle) const CoglRectangleMapEntry *rectangle)
{ {
@ -294,7 +294,7 @@ _cogl_atlas_texture_get_max_waste (CoglTexture *tex)
return cogl_texture_get_max_waste (atlas_tex->sub_texture); return cogl_texture_get_max_waste (atlas_tex->sub_texture);
} }
static gboolean static CoglBool
_cogl_atlas_texture_is_sliced (CoglTexture *tex) _cogl_atlas_texture_is_sliced (CoglTexture *tex)
{ {
CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex); CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex);
@ -303,7 +303,7 @@ _cogl_atlas_texture_is_sliced (CoglTexture *tex)
return cogl_texture_is_sliced (atlas_tex->sub_texture); return cogl_texture_is_sliced (atlas_tex->sub_texture);
} }
static gboolean static CoglBool
_cogl_atlas_texture_can_hardware_repeat (CoglTexture *tex) _cogl_atlas_texture_can_hardware_repeat (CoglTexture *tex)
{ {
CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex); CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex);
@ -334,7 +334,7 @@ _cogl_atlas_texture_transform_quad_coords_to_gl (CoglTexture *tex,
coords); coords);
} }
static gboolean static CoglBool
_cogl_atlas_texture_get_gl_texture (CoglTexture *tex, _cogl_atlas_texture_get_gl_texture (CoglTexture *tex,
GLuint *out_gl_handle, GLuint *out_gl_handle,
GLenum *out_gl_target) GLenum *out_gl_target)
@ -430,7 +430,7 @@ _cogl_atlas_texture_ensure_non_quad_rendering (CoglTexture *tex)
_cogl_texture_ensure_non_quad_rendering (atlas_tex->sub_texture); _cogl_texture_ensure_non_quad_rendering (atlas_tex->sub_texture);
} }
static gboolean static CoglBool
_cogl_atlas_texture_set_region_with_border (CoglAtlasTexture *atlas_tex, _cogl_atlas_texture_set_region_with_border (CoglAtlasTexture *atlas_tex,
int src_x, int src_x,
int src_y, int src_y,
@ -540,7 +540,7 @@ _cogl_atlas_texture_prepare_for_upload (CoglAtlasTexture *atlas_tex,
return override_bmp; return override_bmp;
} }
static gboolean static CoglBool
_cogl_atlas_texture_set_region (CoglTexture *tex, _cogl_atlas_texture_set_region (CoglTexture *tex,
int src_x, int src_x,
int src_y, int src_y,
@ -556,7 +556,7 @@ _cogl_atlas_texture_set_region (CoglTexture *tex,
pixels to the border */ pixels to the border */
if (atlas_tex->atlas) if (atlas_tex->atlas)
{ {
gboolean ret; CoglBool ret;
bmp = _cogl_atlas_texture_prepare_for_upload (atlas_tex, bmp = _cogl_atlas_texture_prepare_for_upload (atlas_tex,
bmp); bmp);
@ -619,7 +619,7 @@ _cogl_atlas_texture_get_height (CoglTexture *tex)
return cogl_texture_get_height (atlas_tex->sub_texture); return cogl_texture_get_height (atlas_tex->sub_texture);
} }
static gboolean static CoglBool
_cogl_atlas_texture_can_use_format (CoglPixelFormat format) _cogl_atlas_texture_can_use_format (CoglPixelFormat format)
{ {
/* We don't care about the ordering or the premult status and we can /* We don't care about the ordering or the premult status and we can

View File

@ -280,7 +280,7 @@ _cogl_atlas_create_texture (CoglAtlas *atlas,
if ((atlas->flags & COGL_ATLAS_CLEAR_TEXTURE)) if ((atlas->flags & COGL_ATLAS_CLEAR_TEXTURE))
{ {
guint8 *clear_data; uint8_t *clear_data;
CoglBitmap *clear_bmp; CoglBitmap *clear_bmp;
int bpp = _cogl_pixel_format_get_bytes_per_pixel (atlas->texture_format); int bpp = _cogl_pixel_format_get_bytes_per_pixel (atlas->texture_format);
@ -337,7 +337,7 @@ _cogl_atlas_notify_post_reorganize (CoglAtlas *atlas)
g_hook_list_invoke (&atlas->post_reorganize_callbacks, FALSE); g_hook_list_invoke (&atlas->post_reorganize_callbacks, FALSE);
} }
gboolean CoglBool
_cogl_atlas_reserve_space (CoglAtlas *atlas, _cogl_atlas_reserve_space (CoglAtlas *atlas,
unsigned int width, unsigned int width,
unsigned int height, unsigned int height,
@ -347,7 +347,7 @@ _cogl_atlas_reserve_space (CoglAtlas *atlas,
CoglRectangleMap *new_map; CoglRectangleMap *new_map;
CoglTexture2D *new_tex; CoglTexture2D *new_tex;
unsigned int map_width, map_height; unsigned int map_width, map_height;
gboolean ret; CoglBool ret;
CoglRectangleMapEntry new_position; CoglRectangleMapEntry new_position;
/* Check if we can fit the rectangle into the existing map */ /* Check if we can fit the rectangle into the existing map */

View File

@ -64,7 +64,7 @@ _cogl_atlas_new (CoglPixelFormat texture_format,
CoglAtlasFlags flags, CoglAtlasFlags flags,
CoglAtlasUpdatePositionCallback update_position_cb); CoglAtlasUpdatePositionCallback update_position_cb);
gboolean CoglBool
_cogl_atlas_reserve_space (CoglAtlas *atlas, _cogl_atlas_reserve_space (CoglAtlas *atlas,
unsigned int width, unsigned int width,
unsigned int height, unsigned int height,
@ -95,7 +95,7 @@ _cogl_atlas_remove_reorganize_callback (CoglAtlas *atlas,
GHookFunc post_callback, GHookFunc post_callback,
void *user_data); void *user_data);
gboolean CoglBool
_cogl_is_atlas (void *object); _cogl_is_atlas (void *object);
#endif /* __COGL_ATLAS_H */ #endif /* __COGL_ATLAS_H */

View File

@ -40,11 +40,11 @@ COGL_BUFFER_DEFINE (AttributeBuffer, attribute_buffer);
CoglAttributeBuffer * CoglAttributeBuffer *
cogl_attribute_buffer_new (CoglContext *context, cogl_attribute_buffer_new (CoglContext *context,
gsize bytes, size_t bytes,
const void *data) const void *data)
{ {
CoglAttributeBuffer *array = g_slice_new (CoglAttributeBuffer); CoglAttributeBuffer *array = g_slice_new (CoglAttributeBuffer);
gboolean use_malloc; CoglBool use_malloc;
if (!(context->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS)) if (!(context->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS))
use_malloc = TRUE; use_malloc = TRUE;

View File

@ -68,7 +68,7 @@ G_BEGIN_DECLS
*/ */
CoglAttributeBuffer * CoglAttributeBuffer *
cogl_attribute_buffer_new (CoglContext *context, cogl_attribute_buffer_new (CoglContext *context,
gsize bytes, size_t bytes,
const void *data); const void *data);
/** /**
@ -83,7 +83,7 @@ cogl_attribute_buffer_new (CoglContext *context,
* Since: 1.4 * Since: 1.4
* Stability: Unstable * Stability: Unstable
*/ */
gboolean CoglBool
cogl_is_attribute_buffer (void *object); cogl_is_attribute_buffer (void *object);
G_END_DECLS G_END_DECLS

View File

@ -46,7 +46,7 @@ typedef struct _CoglAttributeNameState
char *name; char *name;
CoglAttributeNameID name_id; CoglAttributeNameID name_id;
int name_index; int name_index;
gboolean normalized_default; CoglBool normalized_default;
int texture_unit; int texture_unit;
} CoglAttributeNameState; } CoglAttributeNameState;
@ -56,11 +56,11 @@ struct _CoglAttribute
CoglAttributeBuffer *attribute_buffer; CoglAttributeBuffer *attribute_buffer;
const CoglAttributeNameState *name_state; const CoglAttributeNameState *name_state;
gsize stride; size_t stride;
gsize offset; size_t offset;
int n_components; int n_components;
CoglAttributeType type; CoglAttributeType type;
gboolean normalized; CoglBool normalized;
int immutable_ref; int immutable_ref;
}; };

View File

@ -59,11 +59,11 @@ static void _cogl_attribute_free (CoglAttribute *attribute);
COGL_OBJECT_DEFINE (Attribute, attribute); COGL_OBJECT_DEFINE (Attribute, attribute);
static gboolean static CoglBool
validate_cogl_attribute_name (const char *name, validate_cogl_attribute_name (const char *name,
char **real_attribute_name, char **real_attribute_name,
CoglAttributeNameID *name_id, CoglAttributeNameID *name_id,
gboolean *normalized, CoglBool *normalized,
int *texture_unit) int *texture_unit)
{ {
name = name + 5; /* skip "cogl_" */ name = name + 5; /* skip "cogl_" */
@ -161,8 +161,8 @@ error:
CoglAttribute * CoglAttribute *
cogl_attribute_new (CoglAttributeBuffer *attribute_buffer, cogl_attribute_new (CoglAttributeBuffer *attribute_buffer,
const char *name, const char *name,
gsize stride, size_t stride,
gsize offset, size_t offset,
int n_components, int n_components,
CoglAttributeType type) CoglAttributeType type)
{ {
@ -236,7 +236,7 @@ error:
return NULL; return NULL;
} }
gboolean CoglBool
cogl_attribute_get_normalized (CoglAttribute *attribute) cogl_attribute_get_normalized (CoglAttribute *attribute)
{ {
_COGL_RETURN_VAL_IF_FAIL (cogl_is_attribute (attribute), FALSE); _COGL_RETURN_VAL_IF_FAIL (cogl_is_attribute (attribute), FALSE);
@ -247,7 +247,7 @@ cogl_attribute_get_normalized (CoglAttribute *attribute)
static void static void
warn_about_midscene_changes (void) warn_about_midscene_changes (void)
{ {
static gboolean seen = FALSE; static CoglBool seen = FALSE;
if (!seen) if (!seen)
{ {
g_warning ("Mid-scene modification of attributes has " g_warning ("Mid-scene modification of attributes has "
@ -258,7 +258,7 @@ warn_about_midscene_changes (void)
void void
cogl_attribute_set_normalized (CoglAttribute *attribute, cogl_attribute_set_normalized (CoglAttribute *attribute,
gboolean normalized) CoglBool normalized)
{ {
_COGL_RETURN_IF_FAIL (cogl_is_attribute (attribute)); _COGL_RETURN_IF_FAIL (cogl_is_attribute (attribute));
@ -323,10 +323,10 @@ typedef struct
{ {
int unit; int unit;
CoglPipelineFlushOptions options; CoglPipelineFlushOptions options;
guint32 fallback_layers; uint32_t fallback_layers;
} ValidateLayerState; } ValidateLayerState;
static gboolean static CoglBool
validate_layer_cb (CoglPipeline *pipeline, validate_layer_cb (CoglPipeline *pipeline,
int layer_index, int layer_index,
void *user_data) void *user_data)
@ -334,7 +334,7 @@ validate_layer_cb (CoglPipeline *pipeline,
CoglTexture *texture = CoglTexture *texture =
cogl_pipeline_get_layer_texture (pipeline, layer_index); cogl_pipeline_get_layer_texture (pipeline, layer_index);
ValidateLayerState *state = user_data; ValidateLayerState *state = user_data;
gboolean status = TRUE; CoglBool status = TRUE;
/* invalid textures will be handled correctly in /* invalid textures will be handled correctly in
* _cogl_pipeline_flush_layers_gl_state */ * _cogl_pipeline_flush_layers_gl_state */
@ -389,7 +389,7 @@ typedef struct _ForeachChangedBitState
CoglPipeline *pipeline; CoglPipeline *pipeline;
} ForeachChangedBitState; } ForeachChangedBitState;
static gboolean static CoglBool
toggle_builtin_attribute_enabled_cb (int bit_num, void *user_data) toggle_builtin_attribute_enabled_cb (int bit_num, void *user_data)
{ {
ForeachChangedBitState *state = user_data; ForeachChangedBitState *state = user_data;
@ -401,7 +401,7 @@ toggle_builtin_attribute_enabled_cb (int bit_num, void *user_data)
#if defined (HAVE_COGL_GL) || defined (HAVE_COGL_GLES) #if defined (HAVE_COGL_GL) || defined (HAVE_COGL_GLES)
{ {
gboolean enabled = _cogl_bitmask_get (state->new_bits, bit_num); CoglBool enabled = _cogl_bitmask_get (state->new_bits, bit_num);
GLenum cap; GLenum cap;
switch (bit_num) switch (bit_num)
@ -426,7 +426,7 @@ toggle_builtin_attribute_enabled_cb (int bit_num, void *user_data)
return TRUE; return TRUE;
} }
static gboolean static CoglBool
toggle_texcood_attribute_enabled_cb (int bit_num, void *user_data) toggle_texcood_attribute_enabled_cb (int bit_num, void *user_data)
{ {
ForeachChangedBitState *state = user_data; ForeachChangedBitState *state = user_data;
@ -438,7 +438,7 @@ toggle_texcood_attribute_enabled_cb (int bit_num, void *user_data)
#if defined (HAVE_COGL_GL) || defined (HAVE_COGL_GLES) #if defined (HAVE_COGL_GL) || defined (HAVE_COGL_GLES)
{ {
gboolean enabled = _cogl_bitmask_get (state->new_bits, bit_num); CoglBool enabled = _cogl_bitmask_get (state->new_bits, bit_num);
GE( context, glClientActiveTexture (GL_TEXTURE0 + bit_num) ); GE( context, glClientActiveTexture (GL_TEXTURE0 + bit_num) );
@ -452,11 +452,11 @@ toggle_texcood_attribute_enabled_cb (int bit_num, void *user_data)
return TRUE; return TRUE;
} }
static gboolean static CoglBool
toggle_custom_attribute_enabled_cb (int bit_num, void *user_data) toggle_custom_attribute_enabled_cb (int bit_num, void *user_data)
{ {
ForeachChangedBitState *state = user_data; ForeachChangedBitState *state = user_data;
gboolean enabled = _cogl_bitmask_get (state->new_bits, bit_num); CoglBool enabled = _cogl_bitmask_get (state->new_bits, bit_num);
CoglContext *context = state->context; CoglContext *context = state->context;
if (enabled) if (enabled)
@ -496,7 +496,7 @@ static void
setup_generic_attribute (CoglContext *context, setup_generic_attribute (CoglContext *context,
CoglPipeline *pipeline, CoglPipeline *pipeline,
CoglAttribute *attribute, CoglAttribute *attribute,
guint8 *base) uint8_t *base)
{ {
int name_index = attribute->name_state->name_index; int name_index = attribute->name_state->name_index;
int attrib_location = int attrib_location =
@ -555,7 +555,7 @@ _cogl_flush_attributes_state (CoglFramebuffer *framebuffer,
int n_attributes) int n_attributes)
{ {
int i; int i;
gboolean skip_gl_color = FALSE; CoglBool skip_gl_color = FALSE;
CoglPipeline *copy = NULL; CoglPipeline *copy = NULL;
int n_tex_coord_attribs = 0; int n_tex_coord_attribs = 0;
ValidateLayerState layers_state; ValidateLayerState layers_state;
@ -689,7 +689,7 @@ _cogl_flush_attributes_state (CoglFramebuffer *framebuffer,
CoglAttribute *attribute = attributes[i]; CoglAttribute *attribute = attributes[i];
CoglAttributeBuffer *attribute_buffer; CoglAttributeBuffer *attribute_buffer;
CoglBuffer *buffer; CoglBuffer *buffer;
guint8 *base; uint8_t *base;
attribute_buffer = cogl_attribute_get_buffer (attribute); attribute_buffer = cogl_attribute_get_buffer (attribute);
buffer = COGL_BUFFER (attribute_buffer); buffer = COGL_BUFFER (attribute_buffer);

View File

@ -137,8 +137,8 @@ G_BEGIN_DECLS
CoglAttribute * CoglAttribute *
cogl_attribute_new (CoglAttributeBuffer *attribute_buffer, cogl_attribute_new (CoglAttributeBuffer *attribute_buffer,
const char *name, const char *name,
gsize stride, size_t stride,
gsize offset, size_t offset,
int components, int components,
CoglAttributeType type); CoglAttributeType type);
@ -162,7 +162,7 @@ cogl_attribute_new (CoglAttributeBuffer *attribute_buffer,
*/ */
void void
cogl_attribute_set_normalized (CoglAttribute *attribute, cogl_attribute_set_normalized (CoglAttribute *attribute,
gboolean normalized); CoglBool normalized);
/** /**
* cogl_attribute_get_normalized: * cogl_attribute_get_normalized:
@ -174,7 +174,7 @@ cogl_attribute_set_normalized (CoglAttribute *attribute,
* Stability: unstable * Stability: unstable
* Since: 1.10 * Since: 1.10
*/ */
gboolean CoglBool
cogl_attribute_get_normalized (CoglAttribute *attribute); cogl_attribute_get_normalized (CoglAttribute *attribute);
/** /**
@ -213,7 +213,7 @@ cogl_attribute_set_buffer (CoglAttribute *attribute,
* Return value: %TRUE if the @object references a #CoglAttribute, * Return value: %TRUE if the @object references a #CoglAttribute,
* %FALSE otherwise * %FALSE otherwise
*/ */
gboolean CoglBool
cogl_is_attribute (void *object); cogl_is_attribute (void *object);
G_END_DECLS G_END_DECLS

View File

@ -31,7 +31,7 @@
#include <string.h> #include <string.h>
#define component_type guint8 #define component_type uint8_t
/* We want to specially optimise the packing when we are converting /* We want to specially optimise the packing when we are converting
to/from an 8-bit type so that it won't do anything. That way for to/from an 8-bit type so that it won't do anything. That way for
example if we are just doing a swizzle conversion then the inner example if we are just doing a swizzle conversion then the inner
@ -43,7 +43,7 @@
#undef UNPACK_BYTE #undef UNPACK_BYTE
#undef component_type #undef component_type
#define component_type guint16 #define component_type uint16_t
#define UNPACK_BYTE(b) (((b) * 65535 + 127) / 255) #define UNPACK_BYTE(b) (((b) * 65535 + 127) / 255)
#define PACK_BYTE(b) (((b) * 255 + 32767) / 65535) #define PACK_BYTE(b) (((b) * 255 + 32767) / 65535)
#include "cogl-bitmap-packing.h" #include "cogl-bitmap-packing.h"
@ -54,7 +54,7 @@
/* (Un)Premultiplication */ /* (Un)Premultiplication */
inline static void inline static void
_cogl_unpremult_alpha_0 (guint8 *dst) _cogl_unpremult_alpha_0 (uint8_t *dst)
{ {
dst[0] = 0; dst[0] = 0;
dst[1] = 0; dst[1] = 0;
@ -63,9 +63,9 @@ _cogl_unpremult_alpha_0 (guint8 *dst)
} }
inline static void inline static void
_cogl_unpremult_alpha_last (guint8 *dst) _cogl_unpremult_alpha_last (uint8_t *dst)
{ {
guint8 alpha = dst[3]; uint8_t alpha = dst[3];
dst[0] = (dst[0] * 255) / alpha; dst[0] = (dst[0] * 255) / alpha;
dst[1] = (dst[1] * 255) / alpha; dst[1] = (dst[1] * 255) / alpha;
@ -73,9 +73,9 @@ _cogl_unpremult_alpha_last (guint8 *dst)
} }
inline static void inline static void
_cogl_unpremult_alpha_first (guint8 *dst) _cogl_unpremult_alpha_first (uint8_t *dst)
{ {
guint8 alpha = dst[0]; uint8_t alpha = dst[0];
dst[1] = (dst[1] * 255) / alpha; dst[1] = (dst[1] * 255) / alpha;
dst[2] = (dst[2] * 255) / alpha; dst[2] = (dst[2] * 255) / alpha;
@ -93,9 +93,9 @@ _cogl_unpremult_alpha_first (guint8 *dst)
} G_STMT_END } G_STMT_END
inline static void inline static void
_cogl_premult_alpha_last (guint8 *dst) _cogl_premult_alpha_last (uint8_t *dst)
{ {
guint8 alpha = dst[3]; uint8_t alpha = dst[3];
/* Using a separate temporary per component has given slightly better /* Using a separate temporary per component has given slightly better
* code generation with GCC in the past; it shouldn't do any worse in * code generation with GCC in the past; it shouldn't do any worse in
* any case. * any case.
@ -107,9 +107,9 @@ _cogl_premult_alpha_last (guint8 *dst)
} }
inline static void inline static void
_cogl_premult_alpha_first (guint8 *dst) _cogl_premult_alpha_first (uint8_t *dst)
{ {
guint8 alpha = dst[0]; uint8_t alpha = dst[0];
unsigned int t1, t2, t3; unsigned int t1, t2, t3;
MULT(dst[1], alpha, t1); MULT(dst[1], alpha, t1);
@ -130,13 +130,13 @@ _cogl_premult_alpha_first (guint8 *dst)
#ifdef COGL_USE_PREMULT_SSE2 #ifdef COGL_USE_PREMULT_SSE2
inline static void inline static void
_cogl_premult_alpha_last_four_pixels_sse2 (guint8 *p) _cogl_premult_alpha_last_four_pixels_sse2 (uint8_t *p)
{ {
/* 8 copies of 128 used below */ /* 8 copies of 128 used below */
static const gint16 eight_halves[8] __attribute__ ((aligned (16))) = static const int16_t eight_halves[8] __attribute__ ((aligned (16))) =
{ 128, 128, 128, 128, 128, 128, 128, 128 }; { 128, 128, 128, 128, 128, 128, 128, 128 };
/* Mask of the rgb components of the four pixels */ /* Mask of the rgb components of the four pixels */
static const gint8 just_rgb[16] __attribute__ ((aligned (16))) = static const int8_t just_rgb[16] __attribute__ ((aligned (16))) =
{ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, { 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00,
0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00 }; 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00 };
/* Each SSE register only holds two pixels because we need to work /* Each SSE register only holds two pixels because we need to work
@ -205,7 +205,7 @@ _cogl_premult_alpha_last_four_pixels_sse2 (guint8 *p)
#endif /* COGL_USE_PREMULT_SSE2 */ #endif /* COGL_USE_PREMULT_SSE2 */
static void static void
_cogl_bitmap_premult_unpacked_span_guint8 (guint8 *data, _cogl_bitmap_premult_unpacked_span_uint8_t (uint8_t *data,
int width) int width)
{ {
#ifdef COGL_USE_PREMULT_SSE2 #ifdef COGL_USE_PREMULT_SSE2
@ -231,7 +231,7 @@ _cogl_bitmap_premult_unpacked_span_guint8 (guint8 *data,
} }
static void static void
_cogl_bitmap_unpremult_unpacked_span_guint8 (guint8 *data, _cogl_bitmap_unpremult_unpacked_span_uint8_t (uint8_t *data,
int width) int width)
{ {
int x; int x;
@ -247,15 +247,15 @@ _cogl_bitmap_unpremult_unpacked_span_guint8 (guint8 *data,
} }
static void static void
_cogl_bitmap_unpremult_unpacked_span_guint16 (guint16 *data, _cogl_bitmap_unpremult_unpacked_span_uint16_t (uint16_t *data,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint16 alpha = data[3]; uint16_t alpha = data[3];
if (alpha == 0) if (alpha == 0)
memset (data, 0, sizeof (guint16) * 3); memset (data, 0, sizeof (uint16_t) * 3);
else else
{ {
data[0] = (data[0] * 65535) / alpha; data[0] = (data[0] * 65535) / alpha;
@ -266,12 +266,12 @@ _cogl_bitmap_unpremult_unpacked_span_guint16 (guint16 *data,
} }
static void static void
_cogl_bitmap_premult_unpacked_span_guint16 (guint16 *data, _cogl_bitmap_premult_unpacked_span_uint16_t (uint16_t *data,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint16 alpha = data[3]; uint16_t alpha = data[3];
data[0] = (data[0] * alpha) / 65535; data[0] = (data[0] * alpha) / 65535;
data[1] = (data[1] * alpha) / 65535; data[1] = (data[1] * alpha) / 65535;
@ -279,7 +279,7 @@ _cogl_bitmap_premult_unpacked_span_guint16 (guint16 *data,
} }
} }
static gboolean static CoglBool
_cogl_bitmap_can_fast_premult (CoglPixelFormat format) _cogl_bitmap_can_fast_premult (CoglPixelFormat format)
{ {
switch (format & ~COGL_PREMULT_BIT) switch (format & ~COGL_PREMULT_BIT)
@ -295,7 +295,7 @@ _cogl_bitmap_can_fast_premult (CoglPixelFormat format)
} }
} }
static gboolean static CoglBool
_cogl_bitmap_needs_short_temp_buffer (CoglPixelFormat format) _cogl_bitmap_needs_short_temp_buffer (CoglPixelFormat format)
{ {
/* If the format is using more than 8 bits per component then we'll /* If the format is using more than 8 bits per component then we'll
@ -343,23 +343,23 @@ _cogl_bitmap_needs_short_temp_buffer (CoglPixelFormat format)
g_assert_not_reached (); g_assert_not_reached ();
} }
gboolean CoglBool
_cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp, _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
CoglBitmap *dst_bmp) CoglBitmap *dst_bmp)
{ {
guint8 *src_data; uint8_t *src_data;
guint8 *dst_data; uint8_t *dst_data;
guint8 *src; uint8_t *src;
guint8 *dst; uint8_t *dst;
void *tmp_row; void *tmp_row;
int src_rowstride; int src_rowstride;
int dst_rowstride; int dst_rowstride;
int y; int y;
int width, height; int width, height;
CoglPixelFormat src_format; CoglPixelFormat src_format;
CoglPixelFormat dst_format; CoglPixelFormat dst_format;
gboolean use_16; CoglBool use_16;
gboolean need_premult; CoglBool need_premult;
src_format = cogl_bitmap_get_format (src_bmp); src_format = cogl_bitmap_get_format (src_bmp);
src_rowstride = cogl_bitmap_get_rowstride (src_bmp); src_rowstride = cogl_bitmap_get_rowstride (src_bmp);
@ -421,7 +421,7 @@ _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
/* Allocate a buffer to hold a temporary RGBA row */ /* Allocate a buffer to hold a temporary RGBA row */
tmp_row = g_malloc (width * tmp_row = g_malloc (width *
(use_16 ? sizeof (guint16) : sizeof (guint8)) * 4); (use_16 ? sizeof (uint16_t) : sizeof (uint8_t)) * 4);
/* FIXME: Optimize */ /* FIXME: Optimize */
for (y = 0; y < height; y++) for (y = 0; y < height; y++)
@ -430,9 +430,9 @@ _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
dst = dst_data + y * dst_rowstride; dst = dst_data + y * dst_rowstride;
if (use_16) if (use_16)
_cogl_unpack_guint16 (src_format, src, tmp_row, width); _cogl_unpack_uint16_t (src_format, src, tmp_row, width);
else else
_cogl_unpack_guint8 (src_format, src, tmp_row, width); _cogl_unpack_uint8_t (src_format, src, tmp_row, width);
/* Handle premultiplication */ /* Handle premultiplication */
if (need_premult) if (need_premult)
@ -440,23 +440,23 @@ _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
if (dst_format & COGL_PREMULT_BIT) if (dst_format & COGL_PREMULT_BIT)
{ {
if (use_16) if (use_16)
_cogl_bitmap_premult_unpacked_span_guint16 (tmp_row, width); _cogl_bitmap_premult_unpacked_span_uint16_t (tmp_row, width);
else else
_cogl_bitmap_premult_unpacked_span_guint8 (tmp_row, width); _cogl_bitmap_premult_unpacked_span_uint8_t (tmp_row, width);
} }
else else
{ {
if (use_16) if (use_16)
_cogl_bitmap_unpremult_unpacked_span_guint16 (tmp_row, width); _cogl_bitmap_unpremult_unpacked_span_uint16_t (tmp_row, width);
else else
_cogl_bitmap_unpremult_unpacked_span_guint8 (tmp_row, width); _cogl_bitmap_unpremult_unpacked_span_uint8_t (tmp_row, width);
} }
} }
if (use_16) if (use_16)
_cogl_pack_guint16 (dst_format, tmp_row, dst, width); _cogl_pack_uint16_t (dst_format, tmp_row, dst, width);
else else
_cogl_pack_guint8 (dst_format, tmp_row, dst, width); _cogl_pack_uint8_t (dst_format, tmp_row, dst, width);
} }
_cogl_bitmap_unmap (src_bmp); _cogl_bitmap_unmap (src_bmp);
@ -492,15 +492,15 @@ _cogl_bitmap_convert (CoglBitmap *src_bmp,
return dst_bmp; return dst_bmp;
} }
gboolean CoglBool
_cogl_bitmap_unpremult (CoglBitmap *bmp) _cogl_bitmap_unpremult (CoglBitmap *bmp)
{ {
guint8 *p, *data; uint8_t *p, *data;
guint16 *tmp_row; uint16_t *tmp_row;
int x,y; int x,y;
CoglPixelFormat format; CoglPixelFormat format;
int width, height; int width, height;
int rowstride; int rowstride;
format = cogl_bitmap_get_format (bmp); format = cogl_bitmap_get_format (bmp);
width = cogl_bitmap_get_width (bmp); width = cogl_bitmap_get_width (bmp);
@ -519,17 +519,17 @@ _cogl_bitmap_unpremult (CoglBitmap *bmp)
if (_cogl_bitmap_can_fast_premult (format)) if (_cogl_bitmap_can_fast_premult (format))
tmp_row = NULL; tmp_row = NULL;
else else
tmp_row = g_malloc (sizeof (guint16) * 4 * width); tmp_row = g_malloc (sizeof (uint16_t) * 4 * width);
for (y = 0; y < height; y++) for (y = 0; y < height; y++)
{ {
p = (guint8*) data + y * rowstride; p = (uint8_t*) data + y * rowstride;
if (tmp_row) if (tmp_row)
{ {
_cogl_unpack_guint16 (format, p, tmp_row, width); _cogl_unpack_uint16_t (format, p, tmp_row, width);
_cogl_bitmap_unpremult_unpacked_span_guint16 (tmp_row, width); _cogl_bitmap_unpremult_unpacked_span_uint16_t (tmp_row, width);
_cogl_pack_guint16 (format, tmp_row, p, width); _cogl_pack_uint16_t (format, tmp_row, p, width);
} }
else else
{ {
@ -545,7 +545,7 @@ _cogl_bitmap_unpremult (CoglBitmap *bmp)
} }
} }
else else
_cogl_bitmap_unpremult_unpacked_span_guint8 (p, width); _cogl_bitmap_unpremult_unpacked_span_uint8_t (p, width);
} }
} }
@ -558,15 +558,15 @@ _cogl_bitmap_unpremult (CoglBitmap *bmp)
return TRUE; return TRUE;
} }
gboolean CoglBool
_cogl_bitmap_premult (CoglBitmap *bmp) _cogl_bitmap_premult (CoglBitmap *bmp)
{ {
guint8 *p, *data; uint8_t *p, *data;
guint16 *tmp_row; uint16_t *tmp_row;
int x,y; int x,y;
CoglPixelFormat format; CoglPixelFormat format;
int width, height; int width, height;
int rowstride; int rowstride;
format = cogl_bitmap_get_format (bmp); format = cogl_bitmap_get_format (bmp);
width = cogl_bitmap_get_width (bmp); width = cogl_bitmap_get_width (bmp);
@ -584,17 +584,17 @@ _cogl_bitmap_premult (CoglBitmap *bmp)
if (_cogl_bitmap_can_fast_premult (format)) if (_cogl_bitmap_can_fast_premult (format))
tmp_row = NULL; tmp_row = NULL;
else else
tmp_row = g_malloc (sizeof (guint16) * 4 * width); tmp_row = g_malloc (sizeof (uint16_t) * 4 * width);
for (y = 0; y < height; y++) for (y = 0; y < height; y++)
{ {
p = (guint8*) data + y * rowstride; p = (uint8_t*) data + y * rowstride;
if (tmp_row) if (tmp_row)
{ {
_cogl_unpack_guint16 (format, p, tmp_row, width); _cogl_unpack_uint16_t (format, p, tmp_row, width);
_cogl_bitmap_premult_unpacked_span_guint16 (tmp_row, width); _cogl_bitmap_premult_unpacked_span_uint16_t (tmp_row, width);
_cogl_pack_guint16 (format, tmp_row, p, width); _cogl_pack_uint16_t (format, tmp_row, p, width);
} }
else else
{ {
@ -607,7 +607,7 @@ _cogl_bitmap_premult (CoglBitmap *bmp)
} }
} }
else else
_cogl_bitmap_premult_unpacked_span_guint8 (p, width); _cogl_bitmap_premult_unpacked_span_uint8_t (p, width);
} }
} }

View File

@ -22,7 +22,7 @@
*/ */
/* This file is included multiple times with different definitions for /* This file is included multiple times with different definitions for
the component_type type (either guint8 or guint16). The code ends the component_type type (either uint8_t or uint16_t). The code ends
up exactly the same for both but we only want to end up hitting the up exactly the same for both but we only want to end up hitting the
16-bit path when one of the types in the conversion is > 8 bits per 16-bit path when one of the types in the conversion is > 8 bits per
component. */ component. */
@ -42,7 +42,7 @@
511) / 1023) 511) / 1023)
inline static void inline static void
G_PASTE (_cogl_unpack_a_8_, component_type) (const guint8 *src, G_PASTE (_cogl_unpack_a_8_, component_type) (const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
@ -58,7 +58,7 @@ G_PASTE (_cogl_unpack_a_8_, component_type) (const guint8 *src,
} }
inline static void inline static void
G_PASTE (_cogl_unpack_g_8_, component_type) (const guint8 *src, G_PASTE (_cogl_unpack_g_8_, component_type) (const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
@ -79,7 +79,7 @@ G_PASTE (_cogl_unpack_g_8_, component_type) (const guint8 *src,
} }
inline static void inline static void
G_PASTE (_cogl_unpack_rgb_888_, component_type) (const guint8 *src, G_PASTE (_cogl_unpack_rgb_888_, component_type) (const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
@ -95,7 +95,7 @@ G_PASTE (_cogl_unpack_rgb_888_, component_type) (const guint8 *src,
} }
inline static void inline static void
G_PASTE (_cogl_unpack_bgr_888_, component_type) (const guint8 *src, G_PASTE (_cogl_unpack_bgr_888_, component_type) (const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
@ -111,7 +111,7 @@ G_PASTE (_cogl_unpack_bgr_888_, component_type) (const guint8 *src,
} }
inline static void inline static void
G_PASTE (_cogl_unpack_bgra_8888_, component_type) (const guint8 *src, G_PASTE (_cogl_unpack_bgra_8888_, component_type) (const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
@ -127,7 +127,7 @@ G_PASTE (_cogl_unpack_bgra_8888_, component_type) (const guint8 *src,
} }
inline static void inline static void
G_PASTE (_cogl_unpack_argb_8888_, component_type) (const guint8 *src, G_PASTE (_cogl_unpack_argb_8888_, component_type) (const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
@ -143,7 +143,7 @@ G_PASTE (_cogl_unpack_argb_8888_, component_type) (const guint8 *src,
} }
inline static void inline static void
G_PASTE (_cogl_unpack_abgr_8888_, component_type) (const guint8 *src, G_PASTE (_cogl_unpack_abgr_8888_, component_type) (const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
@ -159,7 +159,7 @@ G_PASTE (_cogl_unpack_abgr_8888_, component_type) (const guint8 *src,
} }
inline static void inline static void
G_PASTE (_cogl_unpack_rgba_8888_, component_type) (const guint8 *src, G_PASTE (_cogl_unpack_rgba_8888_, component_type) (const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
@ -175,13 +175,13 @@ G_PASTE (_cogl_unpack_rgba_8888_, component_type) (const guint8 *src,
} }
inline static void inline static void
G_PASTE (_cogl_unpack_rgb_565_, component_type) (const guint8 *src, G_PASTE (_cogl_unpack_rgb_565_, component_type) (const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint16 v = *(const guint16 *) src; uint16_t v = *(const uint16_t *) src;
dst[0] = UNPACK_5 (v >> 11); dst[0] = UNPACK_5 (v >> 11);
dst[1] = UNPACK_6 ((v >> 5) & 63); dst[1] = UNPACK_6 ((v >> 5) & 63);
@ -193,13 +193,13 @@ G_PASTE (_cogl_unpack_rgb_565_, component_type) (const guint8 *src,
} }
inline static void inline static void
G_PASTE (_cogl_unpack_rgba_4444_, component_type) (const guint8 *src, G_PASTE (_cogl_unpack_rgba_4444_, component_type) (const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint16 v = *(const guint16 *) src; uint16_t v = *(const uint16_t *) src;
dst[0] = UNPACK_4 (v >> 12); dst[0] = UNPACK_4 (v >> 12);
dst[1] = UNPACK_4 ((v >> 8) & 15); dst[1] = UNPACK_4 ((v >> 8) & 15);
@ -211,13 +211,13 @@ G_PASTE (_cogl_unpack_rgba_4444_, component_type) (const guint8 *src,
} }
inline static void inline static void
G_PASTE (_cogl_unpack_rgba_5551_, component_type) (const guint8 *src, G_PASTE (_cogl_unpack_rgba_5551_, component_type) (const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint16 v = *(const guint16 *) src; uint16_t v = *(const uint16_t *) src;
dst[0] = UNPACK_5 (v >> 11); dst[0] = UNPACK_5 (v >> 11);
dst[1] = UNPACK_5 ((v >> 6) & 31); dst[1] = UNPACK_5 ((v >> 6) & 31);
@ -229,13 +229,13 @@ G_PASTE (_cogl_unpack_rgba_5551_, component_type) (const guint8 *src,
} }
inline static void inline static void
G_PASTE (_cogl_unpack_rgba_1010102_, component_type) (const guint8 *src, G_PASTE (_cogl_unpack_rgba_1010102_, component_type) (const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint32 v = *(const guint32 *) src; uint32_t v = *(const uint32_t *) src;
dst[0] = UNPACK_10 (v >> 22); dst[0] = UNPACK_10 (v >> 22);
dst[1] = UNPACK_10 ((v >> 12) & 1023); dst[1] = UNPACK_10 ((v >> 12) & 1023);
@ -247,13 +247,13 @@ G_PASTE (_cogl_unpack_rgba_1010102_, component_type) (const guint8 *src,
} }
inline static void inline static void
G_PASTE (_cogl_unpack_bgra_1010102_, component_type) (const guint8 *src, G_PASTE (_cogl_unpack_bgra_1010102_, component_type) (const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint32 v = *(const guint32 *) src; uint32_t v = *(const uint32_t *) src;
dst[2] = UNPACK_10 (v >> 22); dst[2] = UNPACK_10 (v >> 22);
dst[1] = UNPACK_10 ((v >> 12) & 1023); dst[1] = UNPACK_10 ((v >> 12) & 1023);
@ -265,13 +265,13 @@ G_PASTE (_cogl_unpack_bgra_1010102_, component_type) (const guint8 *src,
} }
inline static void inline static void
G_PASTE (_cogl_unpack_argb_2101010_, component_type) (const guint8 *src, G_PASTE (_cogl_unpack_argb_2101010_, component_type) (const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint32 v = *(const guint32 *) src; uint32_t v = *(const uint32_t *) src;
dst[3] = UNPACK_2 (v >> 30); dst[3] = UNPACK_2 (v >> 30);
dst[0] = UNPACK_10 ((v >> 20) & 1023); dst[0] = UNPACK_10 ((v >> 20) & 1023);
@ -283,13 +283,13 @@ G_PASTE (_cogl_unpack_argb_2101010_, component_type) (const guint8 *src,
} }
inline static void inline static void
G_PASTE (_cogl_unpack_abgr_2101010_, component_type) (const guint8 *src, G_PASTE (_cogl_unpack_abgr_2101010_, component_type) (const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint32 v = *(const guint32 *) src; uint32_t v = *(const uint32_t *) src;
dst[3] = UNPACK_2 (v >> 30); dst[3] = UNPACK_2 (v >> 30);
dst[2] = UNPACK_10 ((v >> 20) & 1023); dst[2] = UNPACK_10 ((v >> 20) & 1023);
@ -309,7 +309,7 @@ G_PASTE (_cogl_unpack_abgr_2101010_, component_type) (const guint8 *src,
inline static void inline static void
G_PASTE (_cogl_unpack_, component_type) (CoglPixelFormat format, G_PASTE (_cogl_unpack_, component_type) (CoglPixelFormat format,
const guint8 *src, const uint8_t *src,
component_type *dst, component_type *dst,
int width) int width)
{ {
@ -392,7 +392,7 @@ G_PASTE (_cogl_unpack_, component_type) (CoglPixelFormat format,
inline static void inline static void
G_PASTE (_cogl_pack_a_8_, component_type) (const component_type *src, G_PASTE (_cogl_pack_a_8_, component_type) (const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
@ -405,7 +405,7 @@ G_PASTE (_cogl_pack_a_8_, component_type) (const component_type *src,
inline static void inline static void
G_PASTE (_cogl_pack_g_8_, component_type) (const component_type *src, G_PASTE (_cogl_pack_g_8_, component_type) (const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
/* FIXME: I'm not sure if this is right. It looks like Nvidia and /* FIXME: I'm not sure if this is right. It looks like Nvidia and
@ -423,7 +423,7 @@ G_PASTE (_cogl_pack_g_8_, component_type) (const component_type *src,
inline static void inline static void
G_PASTE (_cogl_pack_rgb_888_, component_type) (const component_type *src, G_PASTE (_cogl_pack_rgb_888_, component_type) (const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
@ -438,7 +438,7 @@ G_PASTE (_cogl_pack_rgb_888_, component_type) (const component_type *src,
inline static void inline static void
G_PASTE (_cogl_pack_bgr_888_, component_type) (const component_type *src, G_PASTE (_cogl_pack_bgr_888_, component_type) (const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
@ -453,7 +453,7 @@ G_PASTE (_cogl_pack_bgr_888_, component_type) (const component_type *src,
inline static void inline static void
G_PASTE (_cogl_pack_bgra_8888_, component_type) (const component_type *src, G_PASTE (_cogl_pack_bgra_8888_, component_type) (const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
@ -469,7 +469,7 @@ G_PASTE (_cogl_pack_bgra_8888_, component_type) (const component_type *src,
inline static void inline static void
G_PASTE (_cogl_pack_argb_8888_, component_type) (const component_type *src, G_PASTE (_cogl_pack_argb_8888_, component_type) (const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
@ -485,7 +485,7 @@ G_PASTE (_cogl_pack_argb_8888_, component_type) (const component_type *src,
inline static void inline static void
G_PASTE (_cogl_pack_abgr_8888_, component_type) (const component_type *src, G_PASTE (_cogl_pack_abgr_8888_, component_type) (const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
@ -501,7 +501,7 @@ G_PASTE (_cogl_pack_abgr_8888_, component_type) (const component_type *src,
inline static void inline static void
G_PASTE (_cogl_pack_rgba_8888_, component_type) (const component_type *src, G_PASTE (_cogl_pack_rgba_8888_, component_type) (const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
@ -517,12 +517,12 @@ G_PASTE (_cogl_pack_rgba_8888_, component_type) (const component_type *src,
inline static void inline static void
G_PASTE (_cogl_pack_rgb_565_, component_type) (const component_type *src, G_PASTE (_cogl_pack_rgb_565_, component_type) (const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint16 *v = (guint16 *) dst; uint16_t *v = (uint16_t *) dst;
*v = ((PACK_5 (src[0]) << 11) | *v = ((PACK_5 (src[0]) << 11) |
(PACK_6 (src[1]) << 5) | (PACK_6 (src[1]) << 5) |
@ -534,12 +534,12 @@ G_PASTE (_cogl_pack_rgb_565_, component_type) (const component_type *src,
inline static void inline static void
G_PASTE (_cogl_pack_rgba_4444_, component_type) (const component_type *src, G_PASTE (_cogl_pack_rgba_4444_, component_type) (const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint16 *v = (guint16 *) dst; uint16_t *v = (uint16_t *) dst;
*v = ((PACK_4 (src[0]) << 12) | *v = ((PACK_4 (src[0]) << 12) |
(PACK_4 (src[1]) << 8) | (PACK_4 (src[1]) << 8) |
@ -552,12 +552,12 @@ G_PASTE (_cogl_pack_rgba_4444_, component_type) (const component_type *src,
inline static void inline static void
G_PASTE (_cogl_pack_rgba_5551_, component_type) (const component_type *src, G_PASTE (_cogl_pack_rgba_5551_, component_type) (const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint16 *v = (guint16 *) dst; uint16_t *v = (uint16_t *) dst;
*v = ((PACK_5 (src[0]) << 11) | *v = ((PACK_5 (src[0]) << 11) |
(PACK_5 (src[1]) << 6) | (PACK_5 (src[1]) << 6) |
@ -570,12 +570,12 @@ G_PASTE (_cogl_pack_rgba_5551_, component_type) (const component_type *src,
inline static void inline static void
G_PASTE (_cogl_pack_rgba_1010102_, component_type) (const component_type *src, G_PASTE (_cogl_pack_rgba_1010102_, component_type) (const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint32 *v = (guint32 *) dst; uint32_t *v = (uint32_t *) dst;
*v = ((PACK_10 (src[0]) << 22) | *v = ((PACK_10 (src[0]) << 22) |
(PACK_10 (src[1]) << 12) | (PACK_10 (src[1]) << 12) |
@ -588,12 +588,12 @@ G_PASTE (_cogl_pack_rgba_1010102_, component_type) (const component_type *src,
inline static void inline static void
G_PASTE (_cogl_pack_bgra_1010102_, component_type) (const component_type *src, G_PASTE (_cogl_pack_bgra_1010102_, component_type) (const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint32 *v = (guint32 *) dst; uint32_t *v = (uint32_t *) dst;
*v = ((PACK_10 (src[2]) << 22) | *v = ((PACK_10 (src[2]) << 22) |
(PACK_10 (src[1]) << 12) | (PACK_10 (src[1]) << 12) |
@ -606,12 +606,12 @@ G_PASTE (_cogl_pack_bgra_1010102_, component_type) (const component_type *src,
inline static void inline static void
G_PASTE (_cogl_pack_argb_2101010_, component_type) (const component_type *src, G_PASTE (_cogl_pack_argb_2101010_, component_type) (const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint32 *v = (guint32 *) dst; uint32_t *v = (uint32_t *) dst;
*v = ((PACK_2 (src[3]) << 30) | *v = ((PACK_2 (src[3]) << 30) |
(PACK_10 (src[0]) << 20) | (PACK_10 (src[0]) << 20) |
@ -624,12 +624,12 @@ G_PASTE (_cogl_pack_argb_2101010_, component_type) (const component_type *src,
inline static void inline static void
G_PASTE (_cogl_pack_abgr_2101010_, component_type) (const component_type *src, G_PASTE (_cogl_pack_abgr_2101010_, component_type) (const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
while (width-- > 0) while (width-- > 0)
{ {
guint32 *v = (guint32 *) dst; uint32_t *v = (uint32_t *) dst;
*v = ((PACK_2 (src[3]) << 30) | *v = ((PACK_2 (src[3]) << 30) |
(PACK_10 (src[2]) << 20) | (PACK_10 (src[2]) << 20) |
@ -651,7 +651,7 @@ G_PASTE (_cogl_pack_abgr_2101010_, component_type) (const component_type *src,
inline static void inline static void
G_PASTE (_cogl_pack_, component_type) (CoglPixelFormat format, G_PASTE (_cogl_pack_, component_type) (CoglPixelFormat format,
const component_type *src, const component_type *src,
guint8 *dst, uint8_t *dst,
int width) int width)
{ {
switch (format) switch (format)

View File

@ -40,7 +40,7 @@
#ifdef USE_QUARTZ #ifdef USE_QUARTZ
gboolean CoglBool
_cogl_bitmap_get_size_from_file (const char *filename, _cogl_bitmap_get_size_from_file (const char *filename,
int *width, int *width,
int *height) int *height)
@ -64,8 +64,8 @@ _cogl_bitmap_from_file (const char *filename,
CGImageRef image; CGImageRef image;
int save_errno; int save_errno;
CFStringRef type; CFStringRef type;
gsize width, height, rowstride; size_t width, height, rowstride;
guint8 *out_data; uint8_t *out_data;
CGColorSpaceRef color_space; CGColorSpaceRef color_space;
CGContextRef bitmap_context; CGContextRef bitmap_context;
CoglBitmap *bmp; CoglBitmap *bmp;
@ -159,7 +159,7 @@ _cogl_bitmap_from_file (const char *filename,
#elif defined(USE_GDKPIXBUF) #elif defined(USE_GDKPIXBUF)
gboolean CoglBool
_cogl_bitmap_get_size_from_file (const char *filename, _cogl_bitmap_get_size_from_file (const char *filename,
int *width, int *width,
int *height) int *height)
@ -178,7 +178,7 @@ _cogl_bitmap_from_file (const char *filename,
{ {
static CoglUserDataKey pixbuf_key; static CoglUserDataKey pixbuf_key;
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
gboolean has_alpha; CoglBool has_alpha;
GdkColorspace color_space; GdkColorspace color_space;
CoglPixelFormat pixel_format; CoglPixelFormat pixel_format;
int width; int width;
@ -255,7 +255,7 @@ _cogl_bitmap_from_file (const char *filename,
#include "stb_image.c" #include "stb_image.c"
gboolean CoglBool
_cogl_bitmap_get_size_from_file (const char *filename, _cogl_bitmap_get_size_from_file (const char *filename,
int *width, int *width,
int *height) int *height)
@ -278,7 +278,7 @@ _cogl_bitmap_from_file (const char *filename,
int stb_pixel_format; int stb_pixel_format;
int width; int width;
int height; int height;
guint8 *pixels; uint8_t *pixels;
_COGL_GET_CONTEXT (ctx, NULL); _COGL_GET_CONTEXT (ctx, NULL);

View File

@ -71,7 +71,7 @@ CoglBitmap *
_cogl_bitmap_convert (CoglBitmap *bmp, _cogl_bitmap_convert (CoglBitmap *bmp,
CoglPixelFormat dst_format); CoglPixelFormat dst_format);
gboolean CoglBool
_cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp, _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
CoglBitmap *dst_bmp); CoglBitmap *dst_bmp);
@ -79,17 +79,17 @@ CoglBitmap *
_cogl_bitmap_from_file (const char *filename, _cogl_bitmap_from_file (const char *filename,
GError **error); GError **error);
gboolean CoglBool
_cogl_bitmap_unpremult (CoglBitmap *dst_bmp); _cogl_bitmap_unpremult (CoglBitmap *dst_bmp);
gboolean CoglBool
_cogl_bitmap_premult (CoglBitmap *dst_bmp); _cogl_bitmap_premult (CoglBitmap *dst_bmp);
gboolean CoglBool
_cogl_bitmap_convert_premult_status (CoglBitmap *bmp, _cogl_bitmap_convert_premult_status (CoglBitmap *bmp,
CoglPixelFormat dst_format); CoglPixelFormat dst_format);
gboolean CoglBool
_cogl_bitmap_copy_subregion (CoglBitmap *src, _cogl_bitmap_copy_subregion (CoglBitmap *src,
CoglBitmap *dst, CoglBitmap *dst,
int src_x, int src_x,
@ -103,7 +103,7 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
CoglBitmap * CoglBitmap *
_cogl_bitmap_copy (CoglBitmap *src_bmp); _cogl_bitmap_copy (CoglBitmap *src_bmp);
gboolean CoglBool
_cogl_bitmap_get_size_from_file (const char *filename, _cogl_bitmap_get_size_from_file (const char *filename,
int *width, int *width,
int *height); int *height);
@ -120,7 +120,7 @@ _cogl_bitmap_set_format (CoglBitmap *bitmap,
uploads data using gdk_pixbuf_new_subpixbuf with a sub region uploads data using gdk_pixbuf_new_subpixbuf with a sub region
containing the last row of the pixbuf because in that case the containing the last row of the pixbuf because in that case the
rowstride can be much larger than the width of the image */ rowstride can be much larger than the width of the image */
guint8 * uint8_t *
_cogl_bitmap_map (CoglBitmap *bitmap, _cogl_bitmap_map (CoglBitmap *bitmap,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints); CoglBufferMapHint hints);
@ -134,7 +134,7 @@ _cogl_bitmap_unmap (CoglBitmap *bitmap);
was created with new_from_buffer but it will however be good to was created with new_from_buffer but it will however be good to
pass to glTexImage2D for example. The access should be READ for pass to glTexImage2D for example. The access should be READ for
unpacking and WRITE for packing. It can not be both */ unpacking and WRITE for packing. It can not be both */
guint8 * uint8_t *
_cogl_bitmap_bind (CoglBitmap *bitmap, _cogl_bitmap_bind (CoglBitmap *bitmap,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints); CoglBufferMapHint hints);

View File

@ -37,28 +37,28 @@
struct _CoglBitmap struct _CoglBitmap
{ {
CoglObject _parent; CoglObject _parent;
/* Pointer back to the context that this bitmap was created with */ /* Pointer back to the context that this bitmap was created with */
CoglContext *context; CoglContext *context;
CoglPixelFormat format; CoglPixelFormat format;
int width; int width;
int height; int height;
int rowstride; int rowstride;
guint8 *data; uint8_t *data;
gboolean mapped; CoglBool mapped;
gboolean bound; CoglBool bound;
/* If this is non-null then 'data' is ignored and instead it is /* If this is non-null then 'data' is ignored and instead it is
fetched from this shared bitmap. */ fetched from this shared bitmap. */
CoglBitmap *shared_bmp; CoglBitmap *shared_bmp;
/* If this is non-null then 'data' is treated as an offset into the /* If this is non-null then 'data' is treated as an offset into the
buffer and map will divert to mapping the buffer */ buffer and map will divert to mapping the buffer */
CoglBuffer *buffer; CoglBuffer *buffer;
}; };
static void _cogl_bitmap_free (CoglBitmap *bmp); static void _cogl_bitmap_free (CoglBitmap *bmp);
@ -83,7 +83,7 @@ _cogl_bitmap_free (CoglBitmap *bmp)
g_slice_free (CoglBitmap, bmp); g_slice_free (CoglBitmap, bmp);
} }
gboolean CoglBool
_cogl_bitmap_convert_premult_status (CoglBitmap *bmp, _cogl_bitmap_convert_premult_status (CoglBitmap *bmp,
CoglPixelFormat dst_format) CoglPixelFormat dst_format)
{ {
@ -125,7 +125,7 @@ _cogl_bitmap_copy (CoglBitmap *src_bmp)
return dst_bmp; return dst_bmp;
} }
gboolean CoglBool
_cogl_bitmap_copy_subregion (CoglBitmap *src, _cogl_bitmap_copy_subregion (CoglBitmap *src,
CoglBitmap *dst, CoglBitmap *dst,
int src_x, int src_x,
@ -135,11 +135,11 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
int width, int width,
int height) int height)
{ {
guint8 *srcdata; uint8_t *srcdata;
guint8 *dstdata; uint8_t *dstdata;
int bpp; int bpp;
int line; int line;
gboolean succeeded = FALSE; CoglBool succeeded = FALSE;
/* Intended only for fast copies when format is equal! */ /* Intended only for fast copies when format is equal! */
g_assert ((src->format & ~COGL_PREMULT_BIT) == g_assert ((src->format & ~COGL_PREMULT_BIT) ==
@ -172,7 +172,7 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
return succeeded; return succeeded;
} }
gboolean CoglBool
cogl_bitmap_get_size_from_file (const char *filename, cogl_bitmap_get_size_from_file (const char *filename,
int *width, int *width,
int *height) int *height)
@ -186,7 +186,7 @@ cogl_bitmap_new_for_data (CoglContext *context,
int height, int height,
CoglPixelFormat format, CoglPixelFormat format,
int rowstride, int rowstride,
guint8 *data) uint8_t *data)
{ {
CoglBitmap *bmp; CoglBitmap *bmp;
@ -216,7 +216,7 @@ _cogl_bitmap_new_with_malloc_buffer (CoglContext *context,
static CoglUserDataKey bitmap_free_key; static CoglUserDataKey bitmap_free_key;
int bpp = _cogl_pixel_format_get_bytes_per_pixel (format); int bpp = _cogl_pixel_format_get_bytes_per_pixel (format);
int rowstride = ((width * bpp) + 3) & ~3; int rowstride = ((width * bpp) + 3) & ~3;
guint8 *data = g_malloc (rowstride * height); uint8_t *data = g_malloc (rowstride * height);
CoglBitmap *bitmap; CoglBitmap *bitmap;
bitmap = cogl_bitmap_new_for_data (context, bitmap = cogl_bitmap_new_for_data (context,
@ -365,7 +365,7 @@ cogl_bitmap_error_quark (void)
return g_quark_from_static_string ("cogl-bitmap-error-quark"); return g_quark_from_static_string ("cogl-bitmap-error-quark");
} }
guint8 * uint8_t *
_cogl_bitmap_map (CoglBitmap *bitmap, _cogl_bitmap_map (CoglBitmap *bitmap,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints) CoglBufferMapHint hints)
@ -378,7 +378,7 @@ _cogl_bitmap_map (CoglBitmap *bitmap,
if (bitmap->buffer) if (bitmap->buffer)
{ {
guint8 *data = cogl_buffer_map (bitmap->buffer, uint8_t *data = cogl_buffer_map (bitmap->buffer,
access, access,
hints); hints);
@ -420,12 +420,12 @@ _cogl_bitmap_unmap (CoglBitmap *bitmap)
cogl_buffer_unmap (bitmap->buffer); cogl_buffer_unmap (bitmap->buffer);
} }
guint8 * uint8_t *
_cogl_bitmap_bind (CoglBitmap *bitmap, _cogl_bitmap_bind (CoglBitmap *bitmap,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints) CoglBufferMapHint hints)
{ {
guint8 *ptr; uint8_t *ptr;
/* Divert to another bitmap if this data is shared */ /* Divert to another bitmap if this data is shared */
if (bitmap->shared_bmp) if (bitmap->shared_bmp)
@ -437,7 +437,7 @@ _cogl_bitmap_bind (CoglBitmap *bitmap,
implementation of bind is the same as map */ implementation of bind is the same as map */
if (bitmap->buffer == NULL) if (bitmap->buffer == NULL)
{ {
guint8 *data = _cogl_bitmap_map (bitmap, access, hints); uint8_t *data = _cogl_bitmap_map (bitmap, access, hints);
if (data) if (data)
bitmap->bound = TRUE; bitmap->bound = TRUE;
return data; return data;

View File

@ -155,7 +155,7 @@ cogl_bitmap_new_for_data (CoglContext *context,
int height, int height,
CoglPixelFormat format, CoglPixelFormat format,
int rowstride, int rowstride,
guint8 *data); uint8_t *data);
/** /**
* cogl_bitmap_get_format: * cogl_bitmap_get_format:
@ -232,7 +232,7 @@ cogl_bitmap_get_buffer (CoglBitmap *bitmap);
* *
* Since: 1.0 * Since: 1.0
*/ */
gboolean CoglBool
cogl_bitmap_get_size_from_file (const char *filename, cogl_bitmap_get_size_from_file (const char *filename,
int *width, int *width,
int *height); int *height);
@ -248,7 +248,7 @@ cogl_bitmap_get_size_from_file (const char *filename,
* *
* Since: 1.0 * Since: 1.0
*/ */
gboolean CoglBool
cogl_is_bitmap (void *object); cogl_is_bitmap (void *object);
/** /**

View File

@ -49,7 +49,7 @@ _COGL_STATIC_ASSERT (sizeof (unsigned long) <= sizeof (void *),
#define BIT_MASK(bit_num) \ #define BIT_MASK(bit_num) \
(1UL << BIT_INDEX (bit_num)) (1UL << BIT_INDEX (bit_num))
gboolean CoglBool
_cogl_bitmask_get_from_array (const CoglBitmask *bitmask, _cogl_bitmask_get_from_array (const CoglBitmask *bitmask,
unsigned int bit_num) unsigned int bit_num)
{ {
@ -83,7 +83,7 @@ _cogl_bitmask_convert_to_array (CoglBitmask *bitmask)
void void
_cogl_bitmask_set_in_array (CoglBitmask *bitmask, _cogl_bitmask_set_in_array (CoglBitmask *bitmask,
unsigned int bit_num, unsigned int bit_num,
gboolean value) CoglBool value)
{ {
GArray *array; GArray *array;
unsigned int array_index; unsigned int array_index;
@ -147,7 +147,7 @@ _cogl_bitmask_set_bits (CoglBitmask *dst,
void void
_cogl_bitmask_set_range_in_array (CoglBitmask *bitmask, _cogl_bitmask_set_range_in_array (CoglBitmask *bitmask,
unsigned int n_bits, unsigned int n_bits,
gboolean value) CoglBool value)
{ {
GArray *array; GArray *array;
unsigned int array_index, bit_index; unsigned int array_index, bit_index;

View File

@ -85,19 +85,19 @@ typedef struct _CoglBitmaskImaginaryType *CoglBitmask;
#define _cogl_bitmask_init(bitmask) \ #define _cogl_bitmask_init(bitmask) \
G_STMT_START { *(bitmask) = _cogl_bitmask_from_bits (0); } G_STMT_END G_STMT_START { *(bitmask) = _cogl_bitmask_from_bits (0); } G_STMT_END
gboolean CoglBool
_cogl_bitmask_get_from_array (const CoglBitmask *bitmask, _cogl_bitmask_get_from_array (const CoglBitmask *bitmask,
unsigned int bit_num); unsigned int bit_num);
void void
_cogl_bitmask_set_in_array (CoglBitmask *bitmask, _cogl_bitmask_set_in_array (CoglBitmask *bitmask,
unsigned int bit_num, unsigned int bit_num,
gboolean value); CoglBool value);
void void
_cogl_bitmask_set_range_in_array (CoglBitmask *bitmask, _cogl_bitmask_set_range_in_array (CoglBitmask *bitmask,
unsigned int n_bits, unsigned int n_bits,
gboolean value); CoglBool value);
void void
_cogl_bitmask_clear_all_in_array (CoglBitmask *bitmask); _cogl_bitmask_clear_all_in_array (CoglBitmask *bitmask);
@ -138,7 +138,7 @@ _cogl_bitmask_xor_bits (CoglBitmask *dst,
const CoglBitmask *src); const CoglBitmask *src);
/* The foreach function can return FALSE to stop iteration */ /* The foreach function can return FALSE to stop iteration */
typedef gboolean (* CoglBitmaskForeachFunc) (int bit_num, void *user_data); typedef CoglBool (* CoglBitmaskForeachFunc) (int bit_num, void *user_data);
/* /*
* cogl_bitmask_foreach: * cogl_bitmask_foreach:
@ -160,7 +160,7 @@ _cogl_bitmask_foreach (const CoglBitmask *bitmask,
* *
* Return value: whether bit number @bit_num is set in @bitmask * Return value: whether bit number @bit_num is set in @bitmask
*/ */
static inline gboolean static inline CoglBool
_cogl_bitmask_get (const CoglBitmask *bitmask, unsigned int bit_num) _cogl_bitmask_get (const CoglBitmask *bitmask, unsigned int bit_num)
{ {
if (_cogl_bitmask_has_array (bitmask)) if (_cogl_bitmask_has_array (bitmask))
@ -180,7 +180,7 @@ _cogl_bitmask_get (const CoglBitmask *bitmask, unsigned int bit_num)
* Sets or resets a bit number @bit_num in @bitmask according to @value. * Sets or resets a bit number @bit_num in @bitmask according to @value.
*/ */
static inline void static inline void
_cogl_bitmask_set (CoglBitmask *bitmask, unsigned int bit_num, gboolean value) _cogl_bitmask_set (CoglBitmask *bitmask, unsigned int bit_num, CoglBool value)
{ {
if (_cogl_bitmask_has_array (bitmask) || if (_cogl_bitmask_has_array (bitmask) ||
bit_num >= COGL_BITMASK_MAX_DIRECT_BITS) bit_num >= COGL_BITMASK_MAX_DIRECT_BITS)
@ -204,7 +204,7 @@ _cogl_bitmask_set (CoglBitmask *bitmask, unsigned int bit_num, gboolean value)
static inline void static inline void
_cogl_bitmask_set_range (CoglBitmask *bitmask, _cogl_bitmask_set_range (CoglBitmask *bitmask,
unsigned int n_bits, unsigned int n_bits,
gboolean value) CoglBool value)
{ {
if (_cogl_bitmask_has_array (bitmask) || if (_cogl_bitmask_has_array (bitmask) ||
n_bits > COGL_BITMASK_MAX_DIRECT_BITS) n_bits > COGL_BITMASK_MAX_DIRECT_BITS)

View File

@ -158,7 +158,7 @@ _cogl_blend_string_split_rgba_statement (CoglBlendStringStatement *statement,
} }
} }
static gboolean static CoglBool
validate_tex_combine_statements (CoglBlendStringStatement *statements, validate_tex_combine_statements (CoglBlendStringStatement *statements,
int n_statements, int n_statements,
GError **error) GError **error)
@ -204,7 +204,7 @@ error:
return FALSE; return FALSE;
} }
static gboolean static CoglBool
validate_blend_statements (CoglBlendStringStatement *statements, validate_blend_statements (CoglBlendStringStatement *statements,
int n_statements, int n_statements,
GError **error) GError **error)
@ -283,7 +283,7 @@ error:
return FALSE; return FALSE;
} }
static gboolean static CoglBool
validate_statements_for_context (CoglBlendStringStatement *statements, validate_statements_for_context (CoglBlendStringStatement *statements,
int n_statements, int n_statements,
CoglBlendStringContext context, CoglBlendStringContext context,
@ -392,9 +392,9 @@ get_function_info (const char *mark,
const char *p, const char *p,
CoglBlendStringContext context) CoglBlendStringContext context)
{ {
gsize len = p - mark; size_t len = p - mark;
CoglBlendStringFunctionInfo *functions; CoglBlendStringFunctionInfo *functions;
gsize array_len; size_t array_len;
int i; int i;
if (context == COGL_BLEND_STRING_CONTEXT_BLENDING) if (context == COGL_BLEND_STRING_CONTEXT_BLENDING)
@ -422,9 +422,9 @@ get_color_src_info (const char *mark,
const char *p, const char *p,
CoglBlendStringContext context) CoglBlendStringContext context)
{ {
gsize len = p - mark; size_t len = p - mark;
CoglBlendStringColorSourceInfo *sources; CoglBlendStringColorSourceInfo *sources;
gsize array_len; size_t array_len;
int i; int i;
if (context == COGL_BLEND_STRING_CONTEXT_BLENDING) if (context == COGL_BLEND_STRING_CONTEXT_BLENDING)
@ -455,19 +455,19 @@ get_color_src_info (const char *mark,
return NULL; return NULL;
} }
static gboolean static CoglBool
is_symbol_char (const char c) is_symbol_char (const char c)
{ {
return (g_ascii_isalpha (c) || c == '_') ? TRUE : FALSE; return (g_ascii_isalpha (c) || c == '_') ? TRUE : FALSE;
} }
static gboolean static CoglBool
is_alphanum_char (const char c) is_alphanum_char (const char c)
{ {
return (g_ascii_isalnum (c) || c == '_') ? TRUE : FALSE; return (g_ascii_isalnum (c) || c == '_') ? TRUE : FALSE;
} }
static gboolean static CoglBool
parse_argument (const char *string, /* original user string */ parse_argument (const char *string, /* original user string */
const char **ret_p, /* start of argument IN:OUT */ const char **ret_p, /* start of argument IN:OUT */
const CoglBlendStringStatement *statement, const CoglBlendStringStatement *statement,
@ -480,8 +480,8 @@ parse_argument (const char *string, /* original user string */
const char *mark = NULL; const char *mark = NULL;
const char *error_string = NULL; const char *error_string = NULL;
ParserArgState state = PARSER_ARG_STATE_START; ParserArgState state = PARSER_ARG_STATE_START;
gboolean parsing_factor = FALSE; CoglBool parsing_factor = FALSE;
gboolean implicit_factor_brace; CoglBool implicit_factor_brace;
arg->source.is_zero = FALSE; arg->source.is_zero = FALSE;
arg->source.info = NULL; arg->source.info = NULL;
@ -597,7 +597,7 @@ parse_argument (const char *string, /* original user string */
case PARSER_ARG_STATE_SCRAPING_MASK: case PARSER_ARG_STATE_SCRAPING_MASK:
if (*p == ']') if (*p == ']')
{ {
gsize len = p - mark; size_t len = p - mark;
CoglBlendStringColorSource *source = CoglBlendStringColorSource *source =
parsing_factor ? &arg->factor.source : &arg->source; parsing_factor ? &arg->factor.source : &arg->source;
@ -668,7 +668,7 @@ parse_argument (const char *string, /* original user string */
case PARSER_ARG_STATE_MAYBE_SRC_ALPHA_SATURATE: case PARSER_ARG_STATE_MAYBE_SRC_ALPHA_SATURATE:
if (!is_symbol_char (*p)) if (!is_symbol_char (*p))
{ {
gsize len = p - mark; size_t len = p - mark;
if (len >= strlen ("SRC_ALPHA_SATURATE") && if (len >= strlen ("SRC_ALPHA_SATURATE") &&
strncmp (mark, "SRC_ALPHA_SATURATE", len) == 0) strncmp (mark, "SRC_ALPHA_SATURATE", len) == 0)
{ {

View File

@ -65,23 +65,23 @@ typedef struct _CoglBlendStringColorSourceInfo
{ {
CoglBlendStringColorSourceType type; CoglBlendStringColorSourceType type;
const char *name; const char *name;
gsize name_len; size_t name_len;
} CoglBlendStringColorSourceInfo; } CoglBlendStringColorSourceInfo;
typedef struct _CoglBlendStringColorSource typedef struct _CoglBlendStringColorSource
{ {
gboolean is_zero; CoglBool is_zero;
const CoglBlendStringColorSourceInfo *info; const CoglBlendStringColorSourceInfo *info;
int texture; /* for the TEXTURE_N color source */ int texture; /* for the TEXTURE_N color source */
gboolean one_minus; CoglBool one_minus;
CoglBlendStringChannelMask mask; CoglBlendStringChannelMask mask;
} CoglBlendStringColorSource; } CoglBlendStringColorSource;
typedef struct _CoglBlendStringFactor typedef struct _CoglBlendStringFactor
{ {
gboolean is_one; CoglBool is_one;
gboolean is_src_alpha_saturate; CoglBool is_src_alpha_saturate;
gboolean is_color; CoglBool is_color;
CoglBlendStringColorSource source; CoglBlendStringColorSource source;
} CoglBlendStringFactor; } CoglBlendStringFactor;
@ -110,7 +110,7 @@ typedef struct _CoglBlendStringFunctionInfo
{ {
enum _CoglBlendStringFunctionType type; enum _CoglBlendStringFunctionType type;
const char *name; const char *name;
gsize name_len; size_t name_len;
int argc; int argc;
} CoglBlendStringFunctionInfo; } CoglBlendStringFunctionInfo;
@ -122,7 +122,7 @@ typedef struct _CoglBlendStringStatement
} CoglBlendStringStatement; } CoglBlendStringStatement;
gboolean CoglBool
_cogl_blend_string_compile (const char *string, _cogl_blend_string_compile (const char *string,
CoglBlendStringContext context, CoglBlendStringContext context,
CoglBlendStringStatement *statements, CoglBlendStringStatement *statements,

View File

@ -40,7 +40,7 @@
static const CoglBlitMode *_cogl_blit_default_mode = NULL; static const CoglBlitMode *_cogl_blit_default_mode = NULL;
static gboolean static CoglBool
_cogl_blit_texture_render_begin (CoglBlitData *data) _cogl_blit_texture_render_begin (CoglBlitData *data)
{ {
CoglOffscreen *offscreen; CoglOffscreen *offscreen;
@ -142,7 +142,7 @@ _cogl_blit_texture_render_end (CoglBlitData *data)
data->dst_tex); data->dst_tex);
} }
static gboolean static CoglBool
_cogl_blit_framebuffer_begin (CoglBlitData *data) _cogl_blit_framebuffer_begin (CoglBlitData *data)
{ {
CoglOffscreen *dst_offscreen = NULL, *src_offscreen = NULL; CoglOffscreen *dst_offscreen = NULL, *src_offscreen = NULL;
@ -212,7 +212,7 @@ _cogl_blit_framebuffer_end (CoglBlitData *data)
cogl_pop_framebuffer (); cogl_pop_framebuffer ();
} }
static gboolean static CoglBool
_cogl_blit_copy_tex_sub_image_begin (CoglBlitData *data) _cogl_blit_copy_tex_sub_image_begin (CoglBlitData *data)
{ {
CoglOffscreen *offscreen; CoglOffscreen *offscreen;
@ -264,7 +264,7 @@ _cogl_blit_copy_tex_sub_image_end (CoglBlitData *data)
cogl_pop_framebuffer (); cogl_pop_framebuffer ();
} }
static gboolean static CoglBool
_cogl_blit_get_tex_data_begin (CoglBlitData *data) _cogl_blit_get_tex_data_begin (CoglBlitData *data)
{ {
data->format = cogl_texture_get_format (data->src_tex); data->format = cogl_texture_get_format (data->src_tex);

View File

@ -35,7 +35,7 @@
typedef struct _CoglBlitData CoglBlitData; typedef struct _CoglBlitData CoglBlitData;
typedef gboolean (* CoglBlitBeginFunc) (CoglBlitData *data); typedef CoglBool (* CoglBlitBeginFunc) (CoglBlitData *data);
typedef void (* CoglBlitEndFunc) (CoglBlitData *data); typedef void (* CoglBlitEndFunc) (CoglBlitData *data);
typedef void (* CoglBlitFunc) (CoglBlitData *data, typedef void (* CoglBlitFunc) (CoglBlitData *data,

View File

@ -30,7 +30,7 @@
#include "cogl-boxed-value.h" #include "cogl-boxed-value.h"
#include "cogl-context-private.h" #include "cogl-context-private.h"
gboolean CoglBool
_cogl_boxed_value_equal (const CoglBoxedValue *bva, _cogl_boxed_value_equal (const CoglBoxedValue *bva,
const CoglBoxedValue *bvb) const CoglBoxedValue *bvb)
{ {
@ -109,9 +109,9 @@ _cogl_boxed_value_set_x (CoglBoxedValue *bv,
int size, int size,
int count, int count,
CoglBoxedType type, CoglBoxedType type,
gsize value_size, size_t value_size,
gconstpointer value, const void *value,
gboolean transpose) CoglBool transpose)
{ {
if (count == 1) if (count == 1)
{ {
@ -190,7 +190,7 @@ void
_cogl_boxed_value_set_matrix (CoglBoxedValue *bv, _cogl_boxed_value_set_matrix (CoglBoxedValue *bv,
int dimensions, int dimensions,
int count, int count,
gboolean transpose, CoglBool transpose,
const float *value) const float *value)
{ {
_cogl_boxed_value_set_x (bv, _cogl_boxed_value_set_x (bv,

View File

@ -39,7 +39,7 @@ typedef struct _CoglBoxedValue
{ {
CoglBoxedType type; CoglBoxedType type;
int size, count; int size, count;
gboolean transpose; CoglBool transpose;
union { union {
float float_value[4]; float float_value[4];
@ -58,7 +58,7 @@ typedef struct _CoglBoxedValue
_bv->count = 1; \ _bv->count = 1; \
} G_STMT_END } G_STMT_END
gboolean CoglBool
_cogl_boxed_value_equal (const CoglBoxedValue *bva, _cogl_boxed_value_equal (const CoglBoxedValue *bva,
const CoglBoxedValue *bvb); const CoglBoxedValue *bvb);
@ -86,7 +86,7 @@ void
_cogl_boxed_value_set_matrix (CoglBoxedValue *bv, _cogl_boxed_value_set_matrix (CoglBoxedValue *bv,
int dimensions, int dimensions,
int count, int count,
gboolean transpose, CoglBool transpose,
const float *value); const float *value);
/* /*

View File

@ -47,7 +47,7 @@ struct _CoglBufferVtable
void (* unmap) (CoglBuffer *buffer); void (* unmap) (CoglBuffer *buffer);
gboolean (* set_data) (CoglBuffer *buffer, CoglBool (* set_data) (CoglBuffer *buffer,
unsigned int offset, unsigned int offset,
const void *data, const void *data,
unsigned int size); unsigned int size);
@ -78,29 +78,28 @@ typedef enum {
struct _CoglBuffer struct _CoglBuffer
{ {
CoglObject _parent; CoglObject _parent;
CoglContext *context; CoglContext *context;
CoglBufferVtable vtable; CoglBufferVtable vtable;
CoglBufferBindTarget last_target; CoglBufferBindTarget last_target;
CoglBufferFlags flags; CoglBufferFlags flags;
GLuint gl_handle; /* OpenGL handle */ GLuint gl_handle; /* OpenGL handle */
unsigned int size; /* size of the buffer, in bytes */ unsigned int size; /* size of the buffer, in bytes */
CoglBufferUsageHint usage_hint; CoglBufferUsageHint usage_hint;
CoglBufferUpdateHint update_hint; CoglBufferUpdateHint update_hint;
guint8 *data; /* points to the mapped memory when /* points to the mapped memory when the CoglBuffer is a VBO, PBO,
* the CoglBuffer is a VBO, PBO, ... or * ... or points to allocated memory in the fallback paths */
* points to allocated memory in the uint8_t *data;
* fallback paths */
int immutable_ref; int immutable_ref;
guint store_created:1; unsigned int store_created:1;
}; };
/* This is used to register a type to the list of handle types that /* This is used to register a type to the list of handle types that
@ -117,7 +116,7 @@ void
_cogl_buffer_initialize (CoglBuffer *buffer, _cogl_buffer_initialize (CoglBuffer *buffer,
CoglContext *context, CoglContext *context,
unsigned int size, unsigned int size,
gboolean use_malloc, CoglBool use_malloc,
CoglBufferBindTarget default_target, CoglBufferBindTarget default_target,
CoglBufferUsageHint usage_hint, CoglBufferUsageHint usage_hint,
CoglBufferUpdateHint update_hint); CoglBufferUpdateHint update_hint);

View File

@ -84,7 +84,7 @@ _cogl_buffer_register_buffer_type (const CoglObjectClass *klass)
_cogl_buffer_types = g_slist_prepend (_cogl_buffer_types, (void *) klass); _cogl_buffer_types = g_slist_prepend (_cogl_buffer_types, (void *) klass);
} }
gboolean CoglBool
cogl_is_buffer (void *object) cogl_is_buffer (void *object)
{ {
const CoglObject *obj = object; const CoglObject *obj = object;
@ -188,7 +188,7 @@ bo_map (CoglBuffer *buffer,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints) CoglBufferMapHint hints)
{ {
guint8 *data; uint8_t *data;
CoglBufferBindTarget target; CoglBufferBindTarget target;
GLenum gl_target; GLenum gl_target;
CoglContext *ctx = buffer->context; CoglContext *ctx = buffer->context;
@ -235,7 +235,7 @@ bo_unmap (CoglBuffer *buffer)
_cogl_buffer_unbind (buffer); _cogl_buffer_unbind (buffer);
} }
static gboolean static CoglBool
bo_set_data (CoglBuffer *buffer, bo_set_data (CoglBuffer *buffer,
unsigned int offset, unsigned int offset,
const void *data, const void *data,
@ -276,7 +276,7 @@ malloc_unmap (CoglBuffer *buffer)
buffer->flags &= ~COGL_BUFFER_FLAG_MAPPED; buffer->flags &= ~COGL_BUFFER_FLAG_MAPPED;
} }
static gboolean static CoglBool
malloc_set_data (CoglBuffer *buffer, malloc_set_data (CoglBuffer *buffer,
unsigned int offset, unsigned int offset,
const void *data, const void *data,
@ -290,7 +290,7 @@ void
_cogl_buffer_initialize (CoglBuffer *buffer, _cogl_buffer_initialize (CoglBuffer *buffer,
CoglContext *context, CoglContext *context,
unsigned int size, unsigned int size,
gboolean use_malloc, CoglBool use_malloc,
CoglBufferBindTarget default_target, CoglBufferBindTarget default_target,
CoglBufferUsageHint usage_hint, CoglBufferUsageHint usage_hint,
CoglBufferUpdateHint update_hint) CoglBufferUpdateHint update_hint)
@ -419,7 +419,7 @@ cogl_buffer_get_update_hint (CoglBuffer *buffer)
static void static void
warn_about_midscene_changes (void) warn_about_midscene_changes (void)
{ {
static gboolean seen = FALSE; static CoglBool seen = FALSE;
if (!seen) if (!seen)
{ {
g_warning ("Mid-scene modification of buffers has " g_warning ("Mid-scene modification of buffers has "
@ -507,11 +507,11 @@ _cogl_buffer_unmap_for_fill_or_fallback (CoglBuffer *buffer)
cogl_buffer_unmap (buffer); cogl_buffer_unmap (buffer);
} }
gboolean CoglBool
cogl_buffer_set_data (CoglBuffer *buffer, cogl_buffer_set_data (CoglBuffer *buffer,
gsize offset, size_t offset,
const void *data, const void *data,
gsize size) size_t size)
{ {
_COGL_RETURN_VAL_IF_FAIL (cogl_is_buffer (buffer), FALSE); _COGL_RETURN_VAL_IF_FAIL (cogl_is_buffer (buffer), FALSE);
_COGL_RETURN_VAL_IF_FAIL ((offset + size) <= buffer->size, FALSE); _COGL_RETURN_VAL_IF_FAIL ((offset + size) <= buffer->size, FALSE);

View File

@ -74,7 +74,7 @@ typedef struct _CoglBuffer CoglBuffer;
* Since: 1.2 * Since: 1.2
* Stability: unstable * Stability: unstable
*/ */
gboolean CoglBool
cogl_is_buffer (void *object); cogl_is_buffer (void *object);
/** /**
@ -231,11 +231,11 @@ cogl_buffer_unmap (CoglBuffer *buffer);
* Since: 1.2 * Since: 1.2
* Stability: unstable * Stability: unstable
*/ */
gboolean CoglBool
cogl_buffer_set_data (CoglBuffer *buffer, cogl_buffer_set_data (CoglBuffer *buffer,
gsize offset, size_t offset,
const void *data, const void *data,
gsize size); size_t size);
G_END_DECLS G_END_DECLS

View File

@ -211,7 +211,7 @@ add_stencil_clip_rectangle (CoglFramebuffer *framebuffer,
float y_1, float y_1,
float x_2, float x_2,
float y_2, float y_2,
gboolean first) CoglBool first)
{ {
CoglMatrixStack *modelview_stack = CoglMatrixStack *modelview_stack =
_cogl_framebuffer_get_modelview_stack (framebuffer); _cogl_framebuffer_get_modelview_stack (framebuffer);
@ -287,8 +287,8 @@ add_stencil_clip_silhouette (CoglFramebuffer *framebuffer,
float bounds_y1, float bounds_y1,
float bounds_x2, float bounds_x2,
float bounds_y2, float bounds_y2,
gboolean merge, CoglBool merge,
gboolean need_clear, CoglBool need_clear,
void *user_data) void *user_data)
{ {
CoglMatrixStack *modelview_stack = CoglMatrixStack *modelview_stack =
@ -395,8 +395,8 @@ paint_path_silhouette (void *user_data)
static void static void
add_stencil_clip_path (CoglFramebuffer *framebuffer, add_stencil_clip_path (CoglFramebuffer *framebuffer,
CoglPath *path, CoglPath *path,
gboolean merge, CoglBool merge,
gboolean need_clear) CoglBool need_clear)
{ {
CoglPathData *data = path->data; CoglPathData *data = path->data;
add_stencil_clip_silhouette (framebuffer, add_stencil_clip_silhouette (framebuffer,
@ -429,8 +429,8 @@ add_stencil_clip_primitive (CoglFramebuffer *framebuffer,
float bounds_y1, float bounds_y1,
float bounds_x2, float bounds_x2,
float bounds_y2, float bounds_y2,
gboolean merge, CoglBool merge,
gboolean need_clear) CoglBool need_clear)
{ {
add_stencil_clip_silhouette (framebuffer, add_stencil_clip_silhouette (framebuffer,
paint_primitive_silhouette, paint_primitive_silhouette,
@ -473,7 +473,7 @@ disable_clip_planes (void)
GE( ctx, glDisable (GL_CLIP_PLANE0) ); GE( ctx, glDisable (GL_CLIP_PLANE0) );
} }
static gpointer static void *
_cogl_clip_stack_push_entry (CoglClipStack *clip_stack, _cogl_clip_stack_push_entry (CoglClipStack *clip_stack,
size_t size, size_t size,
CoglClipStackType type) CoglClipStackType type)
@ -797,8 +797,8 @@ _cogl_clip_stack_flush (CoglClipStack *stack,
CoglFramebuffer *framebuffer) CoglFramebuffer *framebuffer)
{ {
int has_clip_planes; int has_clip_planes;
gboolean using_clip_planes = FALSE; CoglBool using_clip_planes = FALSE;
gboolean using_stencil_buffer = FALSE; CoglBool using_stencil_buffer = FALSE;
int scissor_x0; int scissor_x0;
int scissor_y0; int scissor_y0;
int scissor_x1; int scissor_x1;

View File

@ -128,7 +128,7 @@ struct _CoglClipStackRect
modelview matrix is that same as when a rectangle is added to the modelview matrix is that same as when a rectangle is added to the
journal. In that case we can use the original clip coordinates journal. In that case we can use the original clip coordinates
and modify the rectangle instead. */ and modify the rectangle instead. */
gboolean can_be_scissor; CoglBool can_be_scissor;
/* The matrix that was current when the clip was set */ /* The matrix that was current when the clip was set */
CoglMatrix matrix; CoglMatrix matrix;

View File

@ -43,13 +43,13 @@
#endif #endif
#include "cogl-clutter.h" #include "cogl-clutter.h"
gboolean CoglBool
cogl_clutter_check_extension (const char *name, const char *ext) cogl_clutter_check_extension (const char *name, const char *ext)
{ {
return _cogl_check_extension (name, ext); return _cogl_check_extension (name, ext);
} }
gboolean CoglBool
cogl_clutter_winsys_has_feature (CoglWinsysFeature feature) cogl_clutter_winsys_has_feature (CoglWinsysFeature feature)
{ {
return _cogl_winsys_has_feature (feature); return _cogl_winsys_has_feature (feature);

View File

@ -31,11 +31,11 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define cogl_clutter_check_extension cogl_clutter_check_extension_CLUTTER #define cogl_clutter_check_extension cogl_clutter_check_extension_CLUTTER
gboolean CoglBool
cogl_clutter_check_extension (const char *name, const char *ext); cogl_clutter_check_extension (const char *name, const char *ext);
#define cogl_clutter_winsys_has_feature cogl_clutter_winsys_has_feature_CLUTTER #define cogl_clutter_winsys_has_feature cogl_clutter_winsys_has_feature_CLUTTER
gboolean CoglBool
cogl_clutter_winsys_has_feature (CoglWinsysFeature feature); cogl_clutter_winsys_has_feature (CoglWinsysFeature feature);
#define cogl_onscreen_clutter_backend_set_size cogl_onscreen_clutter_backend_set_size_CLUTTER #define cogl_onscreen_clutter_backend_set_size cogl_onscreen_clutter_backend_set_size_CLUTTER

View File

@ -39,7 +39,7 @@
void void
_cogl_color_get_rgba_4ubv (const CoglColor *color, _cogl_color_get_rgba_4ubv (const CoglColor *color,
guint8 *dest); uint8_t *dest);
#endif /* __COGL_COLOR_PRIVATE_PRIVATE_H */ #endif /* __COGL_COLOR_PRIVATE_PRIVATE_H */

View File

@ -56,10 +56,10 @@ cogl_color_free (CoglColor *color)
void void
cogl_color_init_from_4ub (CoglColor *color, cogl_color_init_from_4ub (CoglColor *color,
guint8 red, uint8_t red,
guint8 green, uint8_t green,
guint8 blue, uint8_t blue,
guint8 alpha) uint8_t alpha)
{ {
_COGL_RETURN_IF_FAIL (color != NULL); _COGL_RETURN_IF_FAIL (color != NULL);
@ -72,20 +72,20 @@ cogl_color_init_from_4ub (CoglColor *color,
/* XXX: deprecated, use cogl_color_init_from_4ub */ /* XXX: deprecated, use cogl_color_init_from_4ub */
void void
cogl_color_set_from_4ub (CoglColor *dest, cogl_color_set_from_4ub (CoglColor *dest,
guint8 red, uint8_t red,
guint8 green, uint8_t green,
guint8 blue, uint8_t blue,
guint8 alpha) uint8_t alpha)
{ {
cogl_color_init_from_4ub (dest, red, green, blue, alpha); cogl_color_init_from_4ub (dest, red, green, blue, alpha);
} }
void void
cogl_color_init_from_4f (CoglColor *color, cogl_color_init_from_4f (CoglColor *color,
float red, float red,
float green, float green,
float blue, float blue,
float alpha) float alpha)
{ {
_COGL_RETURN_IF_FAIL (color != NULL); _COGL_RETURN_IF_FAIL (color != NULL);
@ -98,10 +98,10 @@ cogl_color_init_from_4f (CoglColor *color,
/* XXX: deprecated, use cogl_color_init_from_4f */ /* XXX: deprecated, use cogl_color_init_from_4f */
void void
cogl_color_set_from_4f (CoglColor *color, cogl_color_set_from_4f (CoglColor *color,
float red, float red,
float green, float green,
float blue, float blue,
float alpha) float alpha)
{ {
cogl_color_init_from_4f (color, red, green, blue, alpha); cogl_color_init_from_4f (color, red, green, blue, alpha);
} }
@ -220,41 +220,41 @@ cogl_color_set_green_byte (CoglColor *color,
void void
cogl_color_set_green_float (CoglColor *color, cogl_color_set_green_float (CoglColor *color,
float green) float green)
{ {
color->green = green * 255.0; color->green = green * 255.0;
} }
void void
cogl_color_set_green (CoglColor *color, cogl_color_set_green (CoglColor *color,
float green) float green)
{ {
color->green = green * 255.0; color->green = green * 255.0;
} }
void void
cogl_color_set_blue_byte (CoglColor *color, cogl_color_set_blue_byte (CoglColor *color,
unsigned char blue) unsigned char blue)
{ {
color->blue = blue; color->blue = blue;
} }
void void
cogl_color_set_blue_float (CoglColor *color, cogl_color_set_blue_float (CoglColor *color,
float blue) float blue)
{ {
color->blue = blue * 255.0; color->blue = blue * 255.0;
} }
void void
cogl_color_set_blue (CoglColor *color, cogl_color_set_blue (CoglColor *color,
float blue) float blue)
{ {
color->blue = blue * 255.0; color->blue = blue * 255.0;
} }
void void
cogl_color_set_alpha_byte (CoglColor *color, cogl_color_set_alpha_byte (CoglColor *color,
unsigned char alpha) unsigned char alpha)
{ {
color->alpha = alpha; color->alpha = alpha;
@ -262,14 +262,14 @@ cogl_color_set_alpha_byte (CoglColor *color,
void void
cogl_color_set_alpha_float (CoglColor *color, cogl_color_set_alpha_float (CoglColor *color,
float alpha) float alpha)
{ {
color->alpha = alpha * 255.0; color->alpha = alpha * 255.0;
} }
void void
cogl_color_set_alpha (CoglColor *color, cogl_color_set_alpha (CoglColor *color,
float alpha) float alpha)
{ {
color->alpha = alpha * 255.0; color->alpha = alpha * 255.0;
} }
@ -293,10 +293,10 @@ cogl_color_unpremultiply (CoglColor *color)
} }
} }
gboolean CoglBool
cogl_color_equal (gconstpointer v1, gconstpointer v2) cogl_color_equal (const void *v1, const void *v2)
{ {
const guint32 *c1 = v1, *c2 = v2; const uint32_t *c1 = v1, *c2 = v2;
_COGL_RETURN_VAL_IF_FAIL (v1 != NULL, FALSE); _COGL_RETURN_VAL_IF_FAIL (v1 != NULL, FALSE);
_COGL_RETURN_VAL_IF_FAIL (v2 != NULL, FALSE); _COGL_RETURN_VAL_IF_FAIL (v2 != NULL, FALSE);
@ -307,7 +307,7 @@ cogl_color_equal (gconstpointer v1, gconstpointer v2)
void void
_cogl_color_get_rgba_4ubv (const CoglColor *color, _cogl_color_get_rgba_4ubv (const CoglColor *color,
guint8 *dest) uint8_t *dest)
{ {
memcpy (dest, color, 4); memcpy (dest, color, 4);
} }

View File

@ -94,10 +94,10 @@ cogl_color_free (CoglColor *color);
*/ */
void void
cogl_color_init_from_4ub (CoglColor *color, cogl_color_init_from_4ub (CoglColor *color,
guint8 red, uint8_t red,
guint8 green, uint8_t green,
guint8 blue, uint8_t blue,
guint8 alpha); uint8_t alpha);
/** /**
* cogl_color_set_from_4ub: * cogl_color_set_from_4ub:
@ -114,10 +114,10 @@ cogl_color_init_from_4ub (CoglColor *color,
*/ */
void void
cogl_color_set_from_4ub (CoglColor *color, cogl_color_set_from_4ub (CoglColor *color,
guint8 red, uint8_t red,
guint8 green, uint8_t green,
guint8 blue, uint8_t blue,
guint8 alpha); uint8_t alpha);
/** /**
* cogl_color_init_from_4f: * cogl_color_init_from_4f:
@ -467,7 +467,7 @@ cogl_color_set_red (CoglColor *color,
*/ */
void void
cogl_color_set_green (CoglColor *color, cogl_color_set_green (CoglColor *color,
float green); float green);
/** /**
* cogl_color_set_blue: * cogl_color_set_blue:
@ -480,7 +480,7 @@ cogl_color_set_green (CoglColor *color,
*/ */
void void
cogl_color_set_blue (CoglColor *color, cogl_color_set_blue (CoglColor *color,
float blue); float blue);
/** /**
* cogl_color_set_alpha: * cogl_color_set_alpha:
@ -493,7 +493,7 @@ cogl_color_set_blue (CoglColor *color,
*/ */
void void
cogl_color_set_alpha (CoglColor *color, cogl_color_set_alpha (CoglColor *color,
float alpha); float alpha);
/** /**
* cogl_color_premultiply: * cogl_color_premultiply:
@ -535,9 +535,8 @@ cogl_color_unpremultiply (CoglColor *color);
* *
* Since: 1.0 * Since: 1.0
*/ */
gboolean CoglBool
cogl_color_equal (gconstpointer v1, cogl_color_equal (const void *v1, const void *v2);
gconstpointer v2);
G_END_DECLS G_END_DECLS

View File

@ -84,7 +84,7 @@ _cogl_config_read (void)
GKeyFile *key_file = g_key_file_new (); GKeyFile *key_file = g_key_file_new ();
const char * const *system_dirs = g_get_system_config_dirs (); const char * const *system_dirs = g_get_system_config_dirs ();
char *filename; char *filename;
gboolean status = FALSE; CoglBool status = FALSE;
int i; int i;
for (i = 0; system_dirs[i]; i++) for (i = 0; system_dirs[i]; i++)

View File

@ -100,7 +100,7 @@ struct _CoglContext
CoglBitmask enable_custom_attributes_tmp; CoglBitmask enable_custom_attributes_tmp;
CoglBitmask changed_bits_tmp; CoglBitmask changed_bits_tmp;
gboolean legacy_backface_culling_enabled; CoglBool legacy_backface_culling_enabled;
/* A few handy matrix constants */ /* A few handy matrix constants */
CoglMatrix identity_matrix; CoglMatrix identity_matrix;
@ -154,18 +154,18 @@ struct _CoglContext
/* Some simple caching, to minimize state changes... */ /* Some simple caching, to minimize state changes... */
CoglPipeline *current_pipeline; CoglPipeline *current_pipeline;
unsigned long current_pipeline_changes_since_flush; unsigned long current_pipeline_changes_since_flush;
gboolean current_pipeline_skip_gl_color; CoglBool current_pipeline_skip_gl_color;
unsigned long current_pipeline_age; unsigned long current_pipeline_age;
gboolean gl_blend_enable_cache; CoglBool gl_blend_enable_cache;
gboolean depth_test_enabled_cache; CoglBool depth_test_enabled_cache;
CoglDepthTestFunction depth_test_function_cache; CoglDepthTestFunction depth_test_function_cache;
gboolean depth_writing_enabled_cache; CoglBool depth_writing_enabled_cache;
float depth_range_near_cache; float depth_range_near_cache;
float depth_range_far_cache; float depth_range_far_cache;
gboolean legacy_depth_test_enabled; CoglBool legacy_depth_test_enabled;
CoglBuffer *current_buffer[COGL_BUFFER_BIND_TARGET_COUNT]; CoglBuffer *current_buffer[COGL_BUFFER_BIND_TARGET_COUNT];
@ -191,7 +191,7 @@ struct _CoglContext
CoglIndices *rectangle_short_indices; CoglIndices *rectangle_short_indices;
int rectangle_short_indices_len; int rectangle_short_indices_len;
gboolean in_begin_gl_block; CoglBool in_begin_gl_block;
CoglPipeline *texture_download_pipeline; CoglPipeline *texture_download_pipeline;
CoglPipeline *blit_texture_pipeline; CoglPipeline *blit_texture_pipeline;
@ -203,7 +203,7 @@ struct _CoglContext
displaying the quad batches. It needs to be global so that it can displaying the quad batches. It needs to be global so that it can
be reset by cogl_clear. It needs to be reset to increase the be reset by cogl_clear. It needs to be reset to increase the
chances of getting the same colour during an animation */ chances of getting the same colour during an animation */
guint8 journal_rectangles_color; uint8_t journal_rectangles_color;
/* Cached values for GL_MAX_TEXTURE_[IMAGE_]UNITS to avoid calling /* Cached values for GL_MAX_TEXTURE_[IMAGE_]UNITS to avoid calling
glGetInteger too often */ glGetInteger too often */
@ -218,7 +218,7 @@ struct _CoglContext
CoglPipelineProgramType current_vertex_program_type; CoglPipelineProgramType current_vertex_program_type;
GLuint current_gl_program; GLuint current_gl_program;
gboolean current_gl_dither_enabled; CoglBool current_gl_dither_enabled;
CoglColorMask current_gl_color_mask; CoglColorMask current_gl_color_mask;
/* List of types that will be considered a subclass of CoglTexture in /* List of types that will be considered a subclass of CoglTexture in
@ -237,7 +237,7 @@ struct _CoglContext
doesn't need to be a valid pointer. We can't just use NULL in doesn't need to be a valid pointer. We can't just use NULL in
current_clip_stack to mark a dirty state because NULL is a valid current_clip_stack to mark a dirty state because NULL is a valid
stack (meaning no clipping) */ stack (meaning no clipping) */
gboolean current_clip_stack_valid; CoglBool current_clip_stack_valid;
/* The clip state that was flushed. This isn't intended to be used /* The clip state that was flushed. This isn't intended to be used
as a stack to push and pop new entries. Instead the current stack as a stack to push and pop new entries. Instead the current stack
that the user wants is part of the framebuffer state. This is that the user wants is part of the framebuffer state. This is
@ -249,13 +249,13 @@ struct _CoglContext
state. If TRUE then any further use of the stencil buffer (such state. If TRUE then any further use of the stencil buffer (such
as for drawing paths) would need to be merged with the existing as for drawing paths) would need to be merged with the existing
stencil buffer */ stencil buffer */
gboolean current_clip_stack_uses_stencil; CoglBool current_clip_stack_uses_stencil;
/* This is used as a temporary buffer to fill a CoglBuffer when /* This is used as a temporary buffer to fill a CoglBuffer when
cogl_buffer_map fails and we only want to map to fill it with new cogl_buffer_map fails and we only want to map to fill it with new
data */ data */
GByteArray *buffer_map_fallback_array; GByteArray *buffer_map_fallback_array;
gboolean buffer_map_fallback_in_use; CoglBool buffer_map_fallback_in_use;
CoglWinsysRectangleState rectangle_state; CoglWinsysRectangleState rectangle_state;
@ -324,7 +324,7 @@ _cogl_context_get_winsys (CoglContext *context);
* to know when to re-query the GL extensions. The backend should also * to know when to re-query the GL extensions. The backend should also
* check whether the GL context is supported by Cogl. If not it should * check whether the GL context is supported by Cogl. If not it should
* return FALSE and set @error */ * return FALSE and set @error */
gboolean CoglBool
_cogl_context_update_features (CoglContext *context, _cogl_context_update_features (CoglContext *context,
GError **error); GError **error);

View File

@ -589,7 +589,7 @@ cogl_egl_context_get_egl_display (CoglContext *context)
} }
#endif #endif
gboolean CoglBool
_cogl_context_update_features (CoglContext *context, _cogl_context_update_features (CoglContext *context,
GError **error) GError **error)
{ {

View File

@ -153,7 +153,7 @@ cogl_android_set_native_window (ANativeWindow *window);
* Since: 1.10 * Since: 1.10
* Stability: Unstable * Stability: Unstable
*/ */
gboolean CoglBool
cogl_is_context (void *object); cogl_is_context (void *object);
#endif /* COGL_ENABLE_EXPERIMENTAL_2_0_API */ #endif /* COGL_ENABLE_EXPERIMENTAL_2_0_API */
@ -256,7 +256,7 @@ typedef enum _CoglFeatureID
* Since: 1.10 * Since: 1.10
* Stability: unstable * Stability: unstable
*/ */
gboolean CoglBool
cogl_has_feature (CoglContext *context, CoglFeatureID feature); cogl_has_feature (CoglContext *context, CoglFeatureID feature);
/** /**
@ -276,7 +276,7 @@ cogl_has_feature (CoglContext *context, CoglFeatureID feature);
* Since: 1.10 * Since: 1.10
* Stability: unstable * Stability: unstable
*/ */
gboolean CoglBool
cogl_has_features (CoglContext *context, ...); cogl_has_features (CoglContext *context, ...);
/** /**

View File

@ -89,16 +89,16 @@ GHashTable *_cogl_debug_instances;
static void static void
_cogl_parse_debug_string_for_keys (const char *value, _cogl_parse_debug_string_for_keys (const char *value,
gboolean enable, CoglBool enable,
const GDebugKey *keys, const GDebugKey *keys,
unsigned int nkeys) unsigned int nkeys)
{ {
int long_num, key_num; int long_num, key_num;
/* g_parse_debug_string expects the value field in GDebugKey to be a /* g_parse_debug_string expects the value field in GDebugKey to be a
mask in a guint but the flags is stored in an array of multiple mask in an unsigned int but the flags are stored in an array of
longs so we need to build a separate array for each possible multiple longs so we need to build a separate array for each
guint */ possible unsigned int */
for (long_num = 0; long_num < COGL_DEBUG_N_LONGS; long_num++) for (long_num = 0; long_num < COGL_DEBUG_N_LONGS; long_num++)
{ {
@ -147,8 +147,8 @@ _cogl_parse_debug_string_for_keys (const char *value,
void void
_cogl_parse_debug_string (const char *value, _cogl_parse_debug_string (const char *value,
gboolean enable, CoglBool enable,
gboolean ignore_help) CoglBool ignore_help)
{ {
if (ignore_help && strcmp (value, "help") == 0) if (ignore_help && strcmp (value, "help") == 0)
return; return;
@ -197,10 +197,10 @@ _cogl_parse_debug_string (const char *value,
} }
#ifdef COGL_ENABLE_DEBUG #ifdef COGL_ENABLE_DEBUG
static gboolean static CoglBool
cogl_arg_debug_cb (const char *key, cogl_arg_debug_cb (const char *key,
const char *value, const char *value,
gpointer user_data) void *user_data)
{ {
_cogl_parse_debug_string (value, _cogl_parse_debug_string (value,
TRUE /* enable the flags */, TRUE /* enable the flags */,
@ -208,10 +208,10 @@ cogl_arg_debug_cb (const char *key,
return TRUE; return TRUE;
} }
static gboolean static CoglBool
cogl_arg_no_debug_cb (const char *key, cogl_arg_no_debug_cb (const char *key,
const char *value, const char *value,
gpointer user_data) void *user_data)
{ {
_cogl_parse_debug_string (value, _cogl_parse_debug_string (value,
FALSE, /* disable the flags */ FALSE, /* disable the flags */
@ -254,11 +254,11 @@ _cogl_debug_check_environment (void)
} }
} }
static gboolean static CoglBool
pre_parse_hook (GOptionContext *context, pre_parse_hook (GOptionContext *context,
GOptionGroup *group, GOptionGroup *group,
gpointer data, void *data,
GError **error) GError **error)
{ {
_cogl_init (); _cogl_init ();

View File

@ -126,8 +126,8 @@ _cogl_debug_check_environment (void);
void void
_cogl_parse_debug_string (const char *value, _cogl_parse_debug_string (const char *value,
gboolean enable, CoglBool enable,
gboolean ignore_help); CoglBool ignore_help);
G_END_DECLS G_END_DECLS

View File

@ -46,13 +46,13 @@ cogl_depth_state_init (CoglDepthState *state)
void void
cogl_depth_state_set_test_enabled (CoglDepthState *state, cogl_depth_state_set_test_enabled (CoglDepthState *state,
gboolean enabled) CoglBool enabled)
{ {
_COGL_RETURN_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC); _COGL_RETURN_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC);
state->test_enabled = enabled; state->test_enabled = enabled;
} }
gboolean CoglBool
cogl_depth_state_get_test_enabled (CoglDepthState *state) cogl_depth_state_get_test_enabled (CoglDepthState *state)
{ {
_COGL_RETURN_VAL_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC, FALSE); _COGL_RETURN_VAL_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC, FALSE);
@ -61,13 +61,13 @@ cogl_depth_state_get_test_enabled (CoglDepthState *state)
void void
cogl_depth_state_set_write_enabled (CoglDepthState *state, cogl_depth_state_set_write_enabled (CoglDepthState *state,
gboolean enabled) CoglBool enabled)
{ {
_COGL_RETURN_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC); _COGL_RETURN_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC);
state->write_enabled = enabled; state->write_enabled = enabled;
} }
gboolean CoglBool
cogl_depth_state_get_write_enabled (CoglDepthState *state) cogl_depth_state_get_write_enabled (CoglDepthState *state)
{ {
_COGL_RETURN_VAL_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC, FALSE); _COGL_RETURN_VAL_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC, FALSE);

View File

@ -41,24 +41,24 @@ G_BEGIN_DECLS
typedef struct typedef struct
{ {
guint32 COGL_PRIVATE (magic); uint32_t COGL_PRIVATE (magic);
gboolean COGL_PRIVATE (test_enabled); CoglBool COGL_PRIVATE (test_enabled);
CoglDepthTestFunction COGL_PRIVATE (test_function); CoglDepthTestFunction COGL_PRIVATE (test_function);
gboolean COGL_PRIVATE (write_enabled); CoglBool COGL_PRIVATE (write_enabled);
float COGL_PRIVATE (range_near); float COGL_PRIVATE (range_near);
float COGL_PRIVATE (range_far); float COGL_PRIVATE (range_far);
guint32 COGL_PRIVATE (padding0); uint32_t COGL_PRIVATE (padding0);
guint32 COGL_PRIVATE (padding1); uint32_t COGL_PRIVATE (padding1);
guint32 COGL_PRIVATE (padding2); uint32_t COGL_PRIVATE (padding2);
guint32 COGL_PRIVATE (padding3); uint32_t COGL_PRIVATE (padding3);
guint32 COGL_PRIVATE (padding4); uint32_t COGL_PRIVATE (padding4);
guint32 COGL_PRIVATE (padding5); uint32_t COGL_PRIVATE (padding5);
guint32 COGL_PRIVATE (padding6); uint32_t COGL_PRIVATE (padding6);
guint32 COGL_PRIVATE (padding7); uint32_t COGL_PRIVATE (padding7);
guint32 COGL_PRIVATE (padding8); uint32_t COGL_PRIVATE (padding8);
guint32 COGL_PRIVATE (padding9); uint32_t COGL_PRIVATE (padding9);
} CoglDepthState; } CoglDepthState;
@ -104,7 +104,7 @@ cogl_depth_state_init (CoglDepthState *state);
*/ */
void void
cogl_depth_state_set_test_enabled (CoglDepthState *state, cogl_depth_state_set_test_enabled (CoglDepthState *state,
gboolean enable); CoglBool enable);
/** /**
* cogl_depth_state_get_test_enabled: * cogl_depth_state_get_test_enabled:
@ -117,7 +117,7 @@ cogl_depth_state_set_test_enabled (CoglDepthState *state,
* Since: 2.0 * Since: 2.0
* Stability: Unstable * Stability: Unstable
*/ */
gboolean CoglBool
cogl_depth_state_get_test_enabled (CoglDepthState *state); cogl_depth_state_get_test_enabled (CoglDepthState *state);
/** /**
@ -142,7 +142,7 @@ cogl_depth_state_get_test_enabled (CoglDepthState *state);
*/ */
void void
cogl_depth_state_set_write_enabled (CoglDepthState *state, cogl_depth_state_set_write_enabled (CoglDepthState *state,
gboolean enable); CoglBool enable);
/** /**
* cogl_depth_state_get_write_enabled: * cogl_depth_state_get_write_enabled:
@ -155,7 +155,7 @@ cogl_depth_state_set_write_enabled (CoglDepthState *state,
* Since: 2.0 * Since: 2.0
* Stability: Unstable * Stability: Unstable
*/ */
gboolean CoglBool
cogl_depth_state_get_write_enabled (CoglDepthState *state); cogl_depth_state_get_write_enabled (CoglDepthState *state);
/** /**

View File

@ -38,7 +38,7 @@ struct _CoglDisplay
{ {
CoglObject _parent; CoglObject _parent;
gboolean setup; CoglBool setup;
CoglRenderer *renderer; CoglRenderer *renderer;
CoglOnscreenTemplate *onscreen_template; CoglOnscreenTemplate *onscreen_template;

View File

@ -114,7 +114,7 @@ cogl_display_get_renderer (CoglDisplay *display)
return display->renderer; return display->renderer;
} }
gboolean CoglBool
cogl_display_setup (CoglDisplay *display, cogl_display_setup (CoglDisplay *display,
GError **error) GError **error)
{ {

View File

@ -152,7 +152,7 @@ cogl_display_get_renderer (CoglDisplay *display);
* Since: 1.10 * Since: 1.10
* Stability: unstable * Stability: unstable
*/ */
gboolean CoglBool
cogl_display_setup (CoglDisplay *display, cogl_display_setup (CoglDisplay *display,
GError **error); GError **error);
@ -200,7 +200,7 @@ cogl_wayland_display_set_compositor_display (CoglDisplay *display,
* Since: 1.10 * Since: 1.10
* Stability: unstable * Stability: unstable
*/ */
gboolean CoglBool
cogl_is_display (void *object); cogl_is_display (void *object);
G_END_DECLS G_END_DECLS

View File

@ -30,7 +30,7 @@ typedef struct _CoglDriverVtable CoglDriverVtable;
struct _CoglDriverVtable struct _CoglDriverVtable
{ {
gboolean CoglBool
(* pixel_format_from_gl_internal) (CoglContext *context, (* pixel_format_from_gl_internal) (CoglContext *context,
GLenum gl_int_format, GLenum gl_int_format,
CoglPixelFormat *out_format); CoglPixelFormat *out_format);
@ -42,7 +42,7 @@ struct _CoglDriverVtable
GLenum *out_glformat, GLenum *out_glformat,
GLenum *out_gltype); GLenum *out_gltype);
gboolean CoglBool
(* update_features) (CoglContext *context, (* update_features) (CoglContext *context,
GError **error); GError **error);
}; };

View File

@ -150,8 +150,8 @@ cogl_euler_init_from_matrix (CoglEuler *euler,
euler->roll = R; euler->roll = R;
} }
gboolean CoglBool
cogl_euler_equal (gconstpointer v1, gconstpointer v2) cogl_euler_equal (const void *v1, const void *v2)
{ {
const CoglEuler *a = v1; const CoglEuler *a = v1;
const CoglEuler *b = v2; const CoglEuler *b = v2;

View File

@ -218,8 +218,8 @@ cogl_euler_init_from_quaternion (CoglEuler *euler,
* Returns: %TRUE if @v1 and @v2 are equal else %FALSE. * Returns: %TRUE if @v1 and @v2 are equal else %FALSE.
* Since: 2.0 * Since: 2.0
*/ */
gboolean CoglBool
cogl_euler_equal (gconstpointer v1, gconstpointer v2); cogl_euler_equal (const void *v1, const void *v2);
/** /**
* cogl_euler_copy: * cogl_euler_copy:

View File

@ -32,7 +32,7 @@
#include "cogl-feature-private.h" #include "cogl-feature-private.h"
#include "cogl-renderer-private.h" #include "cogl-renderer-private.h"
gboolean CoglBool
_cogl_feature_check (CoglRenderer *renderer, _cogl_feature_check (CoglRenderer *renderer,
const char *driver_prefix, const char *driver_prefix,
const CoglFeatureData *data, const CoglFeatureData *data,
@ -129,7 +129,7 @@ _cogl_feature_check (CoglRenderer *renderer,
goto error; goto error;
/* Set the function pointer in the context */ /* Set the function pointer in the context */
*(void **) ((guint8 *) function_table + *(void **) ((uint8_t *) function_table +
data->functions[func_num].pointer_offset) = func; data->functions[func_num].pointer_offset) = func;
} }
@ -140,7 +140,7 @@ _cogl_feature_check (CoglRenderer *renderer,
* do feature testing by just looking at the function pointers */ * do feature testing by just looking at the function pointers */
error: error:
for (func_num = 0; data->functions[func_num].name; func_num++) for (func_num = 0; data->functions[func_num].name; func_num++)
*(void **) ((guint8 *) function_table + *(void **) ((uint8_t *) function_table +
data->functions[func_num].pointer_offset) = NULL; data->functions[func_num].pointer_offset) = NULL;
return FALSE; return FALSE;

View File

@ -80,7 +80,7 @@ struct _CoglFeatureData
const CoglFeatureFunction *functions; const CoglFeatureFunction *functions;
}; };
gboolean CoglBool
_cogl_feature_check (CoglRenderer *renderer, _cogl_feature_check (CoglRenderer *renderer,
const char *driver_prefix, const char *driver_prefix,
const CoglFeatureData *data, const CoglFeatureData *data,

View File

@ -188,7 +188,7 @@ static const CoglFixed tan_tbl[] =
* The angles are radians in CoglFixed truncated to 16-bit (they're * The angles are radians in CoglFixed truncated to 16-bit (they're
* all less than one) * all less than one)
*/ */
static const guint16 atan_tbl[] = static const uint16_t atan_tbl[] =
{ {
0x0000, 0x00FF, 0x01FF, 0x02FF, 0x03FF, 0x04FF, 0x05FF, 0x06FF, 0x0000, 0x00FF, 0x01FF, 0x02FF, 0x03FF, 0x04FF, 0x05FF, 0x06FF,
0x07FF, 0x08FF, 0x09FE, 0x0AFE, 0x0BFD, 0x0CFD, 0x0DFC, 0x0EFB, 0x07FF, 0x08FF, 0x09FE, 0x0AFE, 0x0BFD, 0x0CFD, 0x0DFC, 0x0EFB,
@ -557,7 +557,7 @@ cogl_angle_tan (CoglAngle angle)
CoglFixed CoglFixed
cogl_fixed_atan (CoglFixed x) cogl_fixed_atan (CoglFixed x)
{ {
gboolean negative = FALSE; CoglBool negative = FALSE;
CoglFixed angle; CoglFixed angle;
if (x < 0) if (x < 0)
@ -744,13 +744,13 @@ cogl_sqrti (int number)
* elsewhere in clutter is not good enough, and 10.22 is used instead. * elsewhere in clutter is not good enough, and 10.22 is used instead.
*/ */
CoglFixed x; CoglFixed x;
guint32 y_1; /* 10.22 fixed point */ uint32_t y_1; /* 10.22 fixed point */
guint32 f = 0x600000; /* '1.5' as 10.22 fixed */ uint32_t f = 0x600000; /* '1.5' as 10.22 fixed */
union union
{ {
float f; float f;
guint32 i; uint32_t i;
} flt, flt2; } flt, flt2;
flt.f = number; flt.f = number;
@ -824,7 +824,7 @@ cogl_fixed_mul (CoglFixed a,
return (CoglFixed) res_low; return (CoglFixed) res_low;
#else #else
gint64 r = (gint64) a * (gint64) b; int64_t r = (int64_t) a * (int64_t) b;
return (CoglFixed) (r >> COGL_FIXED_Q); return (CoglFixed) (r >> COGL_FIXED_Q);
#endif #endif
@ -834,7 +834,7 @@ CoglFixed
cogl_fixed_div (CoglFixed a, cogl_fixed_div (CoglFixed a,
CoglFixed b) CoglFixed b)
{ {
return (CoglFixed) ((((gint64) a) << COGL_FIXED_Q) / b); return (CoglFixed) ((((int64_t) a) << COGL_FIXED_Q) / b);
} }
CoglFixed CoglFixed
@ -902,8 +902,8 @@ cogl_fixed_pow2 (CoglFixed x)
union union
{ {
float f; float f;
guint32 i; uint32_t i;
} flt; } flt;
CoglFixed magic = 0x56f7; CoglFixed magic = 0x56f7;
@ -999,7 +999,7 @@ cogl_value_lcopy_fixed (const GValue *value,
GTypeCValue *collect_values, GTypeCValue *collect_values,
unsigned int collect_flags) unsigned int collect_flags)
{ {
gint32 *fixed_p = collect_values[0].v_pointer; int32_t *fixed_p = collect_values[0].v_pointer;
if (!fixed_p) if (!fixed_p)
return g_strdup_printf ("value location for '%s' passed as NULL", return g_strdup_printf ("value location for '%s' passed as NULL",

View File

@ -773,7 +773,7 @@ G_INLINE_FUNC CoglFixed
cogl_fixed_div (CoglFixed a, cogl_fixed_div (CoglFixed a,
CoglFixed b) CoglFixed b)
{ {
return (CoglFixed) ((((gint64) a) << COGL_FIXED_Q) / b); return (CoglFixed) ((((int64_t) a) << COGL_FIXED_Q) / b);
} }
#endif #endif

View File

@ -49,9 +49,9 @@ typedef enum _CoglFramebufferType {
typedef struct typedef struct
{ {
CoglSwapChain *swap_chain; CoglSwapChain *swap_chain;
gboolean need_stencil; CoglBool need_stencil;
int samples_per_pixel; int samples_per_pixel;
gboolean swap_throttled; CoglBool swap_throttled;
} CoglFramebufferConfig; } CoglFramebufferConfig;
/* Flags to pass to _cogl_offscreen_new_to_texture_full */ /* Flags to pass to _cogl_offscreen_new_to_texture_full */
@ -117,7 +117,7 @@ struct _CoglFramebuffer
/* Format of the pixels in the framebuffer (including the expected /* Format of the pixels in the framebuffer (including the expected
premult state) */ premult state) */
CoglPixelFormat format; CoglPixelFormat format;
gboolean allocated; CoglBool allocated;
CoglMatrixStack *modelview_stack; CoglMatrixStack *modelview_stack;
CoglMatrixStack *projection_stack; CoglMatrixStack *projection_stack;
@ -128,13 +128,13 @@ struct _CoglFramebuffer
CoglClipState clip_state; CoglClipState clip_state;
gboolean dirty_bitmasks; CoglBool dirty_bitmasks;
int red_bits; int red_bits;
int blue_bits; int blue_bits;
int green_bits; int green_bits;
int alpha_bits; int alpha_bits;
gboolean dither_enabled; CoglBool dither_enabled;
CoglColorMask color_mask; CoglColorMask color_mask;
int samples_per_pixel; int samples_per_pixel;
@ -162,7 +162,7 @@ struct _CoglFramebuffer
int clear_clip_y0; int clear_clip_y0;
int clear_clip_x1; int clear_clip_x1;
int clear_clip_y1; int clear_clip_y1;
gboolean clear_clip_dirty; CoglBool clear_clip_dirty;
}; };
struct _CoglOffscreen struct _CoglOffscreen

View File

@ -146,7 +146,7 @@ cogl_framebuffer_error_quark (void)
return g_quark_from_static_string ("cogl-framebuffer-error-quark"); return g_quark_from_static_string ("cogl-framebuffer-error-quark");
} }
gboolean CoglBool
cogl_is_framebuffer (void *object) cogl_is_framebuffer (void *object)
{ {
CoglObject *obj = object; CoglObject *obj = object;
@ -302,7 +302,7 @@ _cogl_framebuffer_clear_without_flush4f (CoglFramebuffer *framebuffer,
if (!gl_buffers) if (!gl_buffers)
{ {
static gboolean shown = FALSE; static CoglBool shown = FALSE;
if (!shown) if (!shown)
{ {
@ -817,7 +817,7 @@ _cogl_offscreen_free (CoglOffscreen *offscreen)
g_free (offscreen); g_free (offscreen);
} }
static gboolean static CoglBool
try_creating_fbo (CoglOffscreen *offscreen, try_creating_fbo (CoglOffscreen *offscreen,
TryFBOFlags flags) TryFBOFlags flags)
{ {
@ -993,15 +993,15 @@ try_creating_fbo (CoglOffscreen *offscreen,
return TRUE; return TRUE;
} }
static gboolean static CoglBool
_cogl_offscreen_allocate (CoglOffscreen *offscreen, _cogl_offscreen_allocate (CoglOffscreen *offscreen,
GError **error) GError **error)
{ {
CoglFramebuffer *fb = COGL_FRAMEBUFFER (offscreen); CoglFramebuffer *fb = COGL_FRAMEBUFFER (offscreen);
CoglContext *ctx = fb->context; CoglContext *ctx = fb->context;
static TryFBOFlags flags; static TryFBOFlags flags;
static gboolean have_working_flags = FALSE; static CoglBool have_working_flags = FALSE;
gboolean fbo_created; CoglBool fbo_created;
/* XXX: The framebuffer_object spec isn't clear in defining whether attaching /* XXX: The framebuffer_object spec isn't clear in defining whether attaching
* a texture as a renderbuffer with mipmap filtering enabled while the * a texture as a renderbuffer with mipmap filtering enabled while the
@ -1052,7 +1052,7 @@ _cogl_offscreen_allocate (CoglOffscreen *offscreen,
return TRUE; return TRUE;
} }
gboolean CoglBool
cogl_framebuffer_allocate (CoglFramebuffer *framebuffer, cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
GError **error) GError **error)
{ {
@ -1769,7 +1769,7 @@ cogl_framebuffer_set_color_mask (CoglFramebuffer *framebuffer,
COGL_FRAMEBUFFER_STATE_COLOR_MASK; COGL_FRAMEBUFFER_STATE_COLOR_MASK;
} }
gboolean CoglBool
cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer) cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer)
{ {
return framebuffer->dither_enabled; return framebuffer->dither_enabled;
@ -1777,7 +1777,7 @@ cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer)
void void
cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer, cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer,
gboolean dither_enabled) CoglBool dither_enabled)
{ {
if (framebuffer->dither_enabled == dither_enabled) if (framebuffer->dither_enabled == dither_enabled)
return; return;
@ -1868,14 +1868,14 @@ cogl_framebuffer_get_context (CoglFramebuffer *framebuffer)
return framebuffer->context; return framebuffer->context;
} }
static gboolean static CoglBool
_cogl_framebuffer_try_fast_read_pixel (CoglFramebuffer *framebuffer, _cogl_framebuffer_try_fast_read_pixel (CoglFramebuffer *framebuffer,
int x, int x,
int y, int y,
CoglReadPixelsFlags source, CoglReadPixelsFlags source,
CoglBitmap *bitmap) CoglBitmap *bitmap)
{ {
gboolean found_intersection; CoglBool found_intersection;
CoglPixelFormat format; CoglPixelFormat format;
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_FAST_READ_PIXEL))) if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_FAST_READ_PIXEL)))
@ -1916,7 +1916,7 @@ _cogl_framebuffer_try_fast_read_pixel (CoglFramebuffer *framebuffer,
y >= framebuffer->clear_clip_y0 && y >= framebuffer->clear_clip_y0 &&
y < framebuffer->clear_clip_y1) y < framebuffer->clear_clip_y1)
{ {
guint8 *pixel; uint8_t *pixel;
/* we currently only care about cases where the premultiplied or /* we currently only care about cases where the premultiplied or
* unpremultipled colors are equivalent... */ * unpremultipled colors are equivalent... */
@ -1942,7 +1942,7 @@ _cogl_framebuffer_try_fast_read_pixel (CoglFramebuffer *framebuffer,
return FALSE; return FALSE;
} }
static gboolean static CoglBool
_cogl_framebuffer_slow_read_pixels_workaround (CoglFramebuffer *framebuffer, _cogl_framebuffer_slow_read_pixels_workaround (CoglFramebuffer *framebuffer,
int x, int x,
int y, int y,
@ -1954,7 +1954,7 @@ _cogl_framebuffer_slow_read_pixels_workaround (CoglFramebuffer *framebuffer,
CoglBitmap *pbo; CoglBitmap *pbo;
int width; int width;
int height; int height;
gboolean res; CoglBool res;
_COGL_RETURN_VAL_IF_FAIL (source & COGL_READ_PIXELS_COLOR_BUFFER, FALSE); _COGL_RETURN_VAL_IF_FAIL (source & COGL_READ_PIXELS_COLOR_BUFFER, FALSE);
_COGL_RETURN_VAL_IF_FAIL (cogl_is_framebuffer (framebuffer), FALSE); _COGL_RETURN_VAL_IF_FAIL (cogl_is_framebuffer (framebuffer), FALSE);
@ -1980,7 +1980,7 @@ _cogl_framebuffer_slow_read_pixels_workaround (CoglFramebuffer *framebuffer,
if (res) if (res)
{ {
guint8 *dst; uint8_t *dst;
/* Copy the pixels back into application's buffer */ /* Copy the pixels back into application's buffer */
dst = _cogl_bitmap_map (bitmap, dst = _cogl_bitmap_map (bitmap,
@ -1991,7 +1991,7 @@ _cogl_framebuffer_slow_read_pixels_workaround (CoglFramebuffer *framebuffer,
res = FALSE; res = FALSE;
else else
{ {
const guint8 *src; const uint8_t *src;
src = _cogl_bitmap_map (pbo, src = _cogl_bitmap_map (pbo,
COGL_BUFFER_ACCESS_READ, COGL_BUFFER_ACCESS_READ,
@ -2033,7 +2033,7 @@ _cogl_framebuffer_slow_read_pixels_workaround (CoglFramebuffer *framebuffer,
return res; return res;
} }
gboolean CoglBool
cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer, cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
int x, int x,
int y, int y,
@ -2047,7 +2047,7 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
GLenum gl_intformat; GLenum gl_intformat;
GLenum gl_format; GLenum gl_format;
GLenum gl_type; GLenum gl_type;
gboolean pack_invert_set; CoglBool pack_invert_set;
int width; int width;
int height; int height;
@ -2160,7 +2160,7 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
CoglBitmap *tmp_bmp; CoglBitmap *tmp_bmp;
CoglPixelFormat read_format; CoglPixelFormat read_format;
int bpp, rowstride; int bpp, rowstride;
guint8 *tmp_data; uint8_t *tmp_data;
int succeeded; int succeeded;
if (ctx->driver == COGL_DRIVER_GL) if (ctx->driver == COGL_DRIVER_GL)
@ -2209,8 +2209,8 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
CoglBitmap *shared_bmp; CoglBitmap *shared_bmp;
CoglPixelFormat bmp_format; CoglPixelFormat bmp_format;
int bpp, rowstride; int bpp, rowstride;
gboolean succeeded = FALSE; CoglBool succeeded = FALSE;
guint8 *pixels; uint8_t *pixels;
rowstride = cogl_bitmap_get_rowstride (bitmap); rowstride = cogl_bitmap_get_rowstride (bitmap);
@ -2273,9 +2273,9 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
(source & COGL_READ_PIXELS_NO_FLIP) == 0 && (source & COGL_READ_PIXELS_NO_FLIP) == 0 &&
!pack_invert_set) !pack_invert_set)
{ {
guint8 *temprow; uint8_t *temprow;
int rowstride; int rowstride;
guint8 *pixels; uint8_t *pixels;
rowstride = cogl_bitmap_get_rowstride (bitmap); rowstride = cogl_bitmap_get_rowstride (bitmap);
pixels = _cogl_bitmap_map (bitmap, pixels = _cogl_bitmap_map (bitmap,
@ -2286,7 +2286,7 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
if (pixels == NULL) if (pixels == NULL)
return FALSE; return FALSE;
temprow = g_alloca (rowstride * sizeof (guint8)); temprow = g_alloca (rowstride * sizeof (uint8_t));
/* vertically flip the buffer in-place */ /* vertically flip the buffer in-place */
for (y = 0; y < height / 2; y++) for (y = 0; y < height / 2; y++)
@ -2309,18 +2309,18 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
return TRUE; return TRUE;
} }
gboolean CoglBool
cogl_framebuffer_read_pixels (CoglFramebuffer *framebuffer, cogl_framebuffer_read_pixels (CoglFramebuffer *framebuffer,
int x, int x,
int y, int y,
int width, int width,
int height, int height,
CoglPixelFormat format, CoglPixelFormat format,
guint8 *pixels) uint8_t *pixels)
{ {
int bpp = _cogl_pixel_format_get_bytes_per_pixel (format); int bpp = _cogl_pixel_format_get_bytes_per_pixel (format);
CoglBitmap *bitmap; CoglBitmap *bitmap;
gboolean ret; CoglBool ret;
bitmap = cogl_bitmap_new_for_data (framebuffer->context, bitmap = cogl_bitmap_new_for_data (framebuffer->context,
width, height, width, height,
@ -2855,18 +2855,18 @@ get_index (void *indices,
switch (type) switch (type)
{ {
case COGL_INDICES_TYPE_UNSIGNED_BYTE: case COGL_INDICES_TYPE_UNSIGNED_BYTE:
return ((guint8 *)indices)[_index]; return ((uint8_t *)indices)[_index];
case COGL_INDICES_TYPE_UNSIGNED_SHORT: case COGL_INDICES_TYPE_UNSIGNED_SHORT:
return ((guint16 *)indices)[_index]; return ((uint16_t *)indices)[_index];
case COGL_INDICES_TYPE_UNSIGNED_INT: case COGL_INDICES_TYPE_UNSIGNED_INT:
return ((guint32 *)indices)[_index]; return ((uint32_t *)indices)[_index];
} }
g_return_val_if_reached (0); g_return_val_if_reached (0);
} }
static void static void
add_line (guint32 *line_indices, add_line (uint32_t *line_indices,
int base, int base,
void *user_indices, void *user_indices,
CoglIndicesType user_indices_type, CoglIndicesType user_indices_type,
@ -2920,7 +2920,7 @@ get_wire_line_indices (CoglContext *ctx,
int *n_indices) int *n_indices)
{ {
int n_lines; int n_lines;
guint32 *line_indices; uint32_t *line_indices;
CoglIndexBuffer *index_buffer; CoglIndexBuffer *index_buffer;
void *indices; void *indices;
CoglIndicesType indices_type; CoglIndicesType indices_type;
@ -3020,7 +3020,7 @@ get_wire_line_indices (CoglContext *ctx,
return ret; return ret;
} }
static gboolean static CoglBool
remove_layer_cb (CoglPipeline *pipeline, remove_layer_cb (CoglPipeline *pipeline,
int layer_index, int layer_index,
void *user_data) void *user_data)
@ -3247,7 +3247,7 @@ _cogl_framebuffer_draw_indexed_attributes (CoglFramebuffer *framebuffer,
#endif #endif
{ {
CoglBuffer *buffer; CoglBuffer *buffer;
guint8 *base; uint8_t *base;
size_t buffer_offset; size_t buffer_offset;
size_t index_size; size_t index_size;
GLenum indices_gl_type = 0; GLenum indices_gl_type = 0;

View File

@ -110,7 +110,7 @@ typedef struct _CoglFramebuffer CoglFramebuffer;
* Since: 1.8 * Since: 1.8
* Stability: unstable * Stability: unstable
*/ */
gboolean CoglBool
cogl_framebuffer_allocate (CoglFramebuffer *framebuffer, cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
GError **error); GError **error);
@ -697,7 +697,7 @@ cogl_framebuffer_get_alpha_bits (CoglFramebuffer *framebuffer);
* Since: 1.8 * Since: 1.8
* Stability: unstable * Stability: unstable
*/ */
gboolean CoglBool
cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer); cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer);
/** /**
@ -724,7 +724,7 @@ cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer);
*/ */
void void
cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer, cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer,
gboolean dither_enabled); CoglBool dither_enabled);
/** /**
* cogl_framebuffer_get_color_mask: * cogl_framebuffer_get_color_mask:
@ -1570,7 +1570,7 @@ cogl_framebuffer_finish (CoglFramebuffer *framebuffer);
* Since: 1.10 * Since: 1.10
* Stability: unstable * Stability: unstable
*/ */
gboolean CoglBool
cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer, cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
int x, int x,
int y, int y,
@ -1616,14 +1616,14 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
* Since: 1.10 * Since: 1.10
* Stability: unstable * Stability: unstable
*/ */
gboolean CoglBool
cogl_framebuffer_read_pixels (CoglFramebuffer *framebuffer, cogl_framebuffer_read_pixels (CoglFramebuffer *framebuffer,
int x, int x,
int y, int y,
int width, int width,
int height, int height,
CoglPixelFormat format, CoglPixelFormat format,
guint8 *pixels); uint8_t *pixels);
/** /**
* cogl_get_draw_framebuffer: * cogl_get_draw_framebuffer:
@ -1668,7 +1668,7 @@ typedef enum { /*< prefix=COGL_FRAMEBUFFER_ERROR >*/
* Since: 1.10 * Since: 1.10
* Stability: unstable * Stability: unstable
*/ */
gboolean CoglBool
cogl_is_framebuffer (void *object); cogl_is_framebuffer (void *object);
G_END_DECLS G_END_DECLS

View File

@ -36,10 +36,10 @@ typedef struct _CoglGLibSource
GArray *poll_fds; GArray *poll_fds;
gint64 expiration_time; int64_t expiration_time;
} CoglGLibSource; } CoglGLibSource;
static gboolean static CoglBool
cogl_glib_source_poll_fds_changed (CoglGLibSource *cogl_source, cogl_glib_source_poll_fds_changed (CoglGLibSource *cogl_source,
const CoglPollFD *poll_fds, const CoglPollFD *poll_fds,
int n_poll_fds) int n_poll_fds)
@ -57,13 +57,13 @@ cogl_glib_source_poll_fds_changed (CoglGLibSource *cogl_source,
return FALSE; return FALSE;
} }
static gboolean static CoglBool
cogl_glib_source_prepare (GSource *source, int *timeout) cogl_glib_source_prepare (GSource *source, int *timeout)
{ {
CoglGLibSource *cogl_source = (CoglGLibSource *) source; CoglGLibSource *cogl_source = (CoglGLibSource *) source;
CoglPollFD *poll_fds; CoglPollFD *poll_fds;
int n_poll_fds; int n_poll_fds;
gint64 cogl_timeout; int64_t cogl_timeout;
int i; int i;
cogl_poll_get_info (cogl_source->context, cogl_poll_get_info (cogl_source->context,
@ -118,7 +118,7 @@ cogl_glib_source_prepare (GSource *source, int *timeout)
return *timeout == 0; return *timeout == 0;
} }
static gboolean static CoglBool
cogl_glib_source_check (GSource *source) cogl_glib_source_check (GSource *source)
{ {
CoglGLibSource *cogl_source = (CoglGLibSource *) source; CoglGLibSource *cogl_source = (CoglGLibSource *) source;
@ -138,7 +138,7 @@ cogl_glib_source_check (GSource *source)
return FALSE; return FALSE;
} }
static gboolean static CoglBool
cogl_glib_source_dispatch (GSource *source, cogl_glib_source_dispatch (GSource *source,
GSourceFunc callback, GSourceFunc callback,
void *user_data) void *user_data)

View File

@ -31,9 +31,9 @@ typedef struct _CoglGLXCachedConfig
{ {
/* This will be -1 if there is no cached config in this slot */ /* This will be -1 if there is no cached config in this slot */
int depth; int depth;
gboolean found; CoglBool found;
GLXFBConfig fb_config; GLXFBConfig fb_config;
gboolean can_mipmap; CoglBool can_mipmap;
} CoglGLXCachedConfig; } CoglGLXCachedConfig;
#define COGL_GLX_N_CACHED_CONFIGS 3 #define COGL_GLX_N_CACHED_CONFIGS 3
@ -42,15 +42,15 @@ typedef struct _CoglGLXDisplay
{ {
CoglGLXCachedConfig glx_cached_configs[COGL_GLX_N_CACHED_CONFIGS]; CoglGLXCachedConfig glx_cached_configs[COGL_GLX_N_CACHED_CONFIGS];
gboolean found_fbconfig; CoglBool found_fbconfig;
gboolean fbconfig_has_rgba_visual; CoglBool fbconfig_has_rgba_visual;
GLXFBConfig fbconfig; GLXFBConfig fbconfig;
/* Single context for all wins */ /* Single context for all wins */
GLXContext glx_context; GLXContext glx_context;
GLXWindow dummy_glxwin; GLXWindow dummy_glxwin;
Window dummy_xwin; Window dummy_xwin;
gboolean pending_swap_notify; CoglBool pending_swap_notify;
} CoglGLXDisplay; } CoglGLXDisplay;
#endif /* __COGL_DISPLAY_GLX_PRIVATE_H */ #endif /* __COGL_DISPLAY_GLX_PRIVATE_H */

View File

@ -37,7 +37,7 @@ typedef struct _CoglGLXRenderer
int glx_error_base; int glx_error_base;
int glx_event_base; int glx_event_base;
gboolean is_direct; CoglBool is_direct;
/* Vblank stuff */ /* Vblank stuff */
int dri_fd; int dri_fd;

View File

@ -43,25 +43,25 @@ typedef struct
{ {
CoglGpuInfoVendor vendor; CoglGpuInfoVendor vendor;
const char *name; const char *name;
gboolean (* check_function) (const CoglGpuInfoStrings *strings); CoglBool (* check_function) (const CoglGpuInfoStrings *strings);
} CoglGpuInfoVendorDescription; } CoglGpuInfoVendorDescription;
typedef struct typedef struct
{ {
CoglGpuInfoDriverPackage driver_package; CoglGpuInfoDriverPackage driver_package;
const char *name; const char *name;
gboolean (* check_function) (const CoglGpuInfoStrings *strings, CoglBool (* check_function) (const CoglGpuInfoStrings *strings,
int *version_out); int *version_out);
} CoglGpuInfoDriverPackageDescription; } CoglGpuInfoDriverPackageDescription;
static gboolean static CoglBool
_cogl_gpu_info_parse_version_string (const char *version_string, _cogl_gpu_info_parse_version_string (const char *version_string,
int n_components, int n_components,
const char **tail, const char **tail,
int *version_ret) int *version_ret)
{ {
int version = 0; int version = 0;
guint64 part; uint64_t part;
int i; int i;
for (i = 0; ; i++) for (i = 0; ; i++)
@ -93,7 +93,7 @@ _cogl_gpu_info_parse_version_string (const char *version_string,
return TRUE; return TRUE;
} }
static gboolean static CoglBool
check_intel_vendor (const CoglGpuInfoStrings *strings) check_intel_vendor (const CoglGpuInfoStrings *strings)
{ {
const char *intel_part = strstr (strings->renderer_string, "Intel(R)"); const char *intel_part = strstr (strings->renderer_string, "Intel(R)");
@ -110,7 +110,7 @@ check_intel_vendor (const CoglGpuInfoStrings *strings)
return TRUE; return TRUE;
} }
static gboolean static CoglBool
check_unknown_vendor (const CoglGpuInfoStrings *strings) check_unknown_vendor (const CoglGpuInfoStrings *strings)
{ {
/* This is a last resort so it always matches */ /* This is a last resort so it always matches */
@ -133,11 +133,11 @@ _cogl_gpu_info_vendors[] =
} }
}; };
static gboolean static CoglBool
check_mesa_driver_package (const CoglGpuInfoStrings *strings, check_mesa_driver_package (const CoglGpuInfoStrings *strings,
int *version_ret) int *version_ret)
{ {
guint64 micro_part; uint64_t micro_part;
const char *v; const char *v;
/* The version string should always begin a two-part GL version /* The version string should always begin a two-part GL version
@ -184,7 +184,7 @@ check_mesa_driver_package (const CoglGpuInfoStrings *strings,
return TRUE; return TRUE;
} }
static gboolean static CoglBool
check_unknown_driver_package (const CoglGpuInfoStrings *strings, check_unknown_driver_package (const CoglGpuInfoStrings *strings,
int *version_out) int *version_out)
{ {

View File

@ -32,7 +32,7 @@
GType \ GType \
cogl_gtype_ ## underscore_name ## _get_type (void) \ cogl_gtype_ ## underscore_name ## _get_type (void) \
{ \ { \
static volatile gsize type_volatile = 0; \ static volatile size_t type_volatile = 0; \
if (g_once_init_enter (&type_volatile)) \ if (g_once_init_enter (&type_volatile)) \
{ \ { \
GType type = \ GType type = \

View File

@ -42,10 +42,10 @@ COGL_BUFFER_DEFINE (IndexBuffer, index_buffer);
* indices buffer should be able to contain multiple ranges of indices * indices buffer should be able to contain multiple ranges of indices
* which the wiki design doesn't currently consider. */ * which the wiki design doesn't currently consider. */
CoglIndexBuffer * CoglIndexBuffer *
cogl_index_buffer_new (CoglContext *context, gsize bytes) cogl_index_buffer_new (CoglContext *context, size_t bytes)
{ {
CoglIndexBuffer *indices = g_slice_new (CoglIndexBuffer); CoglIndexBuffer *indices = g_slice_new (CoglIndexBuffer);
gboolean use_malloc; CoglBool use_malloc;
if (!(context->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS)) if (!(context->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS))
use_malloc = TRUE; use_malloc = TRUE;
@ -95,7 +95,7 @@ void
cogl_index_buffer_set_data (CoglIndexBuffer *indices, cogl_index_buffer_set_data (CoglIndexBuffer *indices,
CoglIndicesType type, CoglIndicesType type,
int max_index_value, int max_index_value,
gsize write_offset, size_t write_offset,
void *user_indices, void *user_indices,
int n_indices) int n_indices)
{ {

View File

@ -62,7 +62,7 @@ typedef struct _CoglIndexBuffer CoglIndexBuffer;
*/ */
CoglIndexBuffer * CoglIndexBuffer *
cogl_index_buffer_new (CoglContext *context, cogl_index_buffer_new (CoglContext *context,
gsize bytes); size_t bytes);
/** /**
* cogl_is_index_buffer: * cogl_is_index_buffer:
@ -76,7 +76,7 @@ cogl_index_buffer_new (CoglContext *context,
* Since: 1.4 * Since: 1.4
* Stability: Unstable * Stability: Unstable
*/ */
gboolean CoglBool
cogl_is_index_buffer (void *object); cogl_is_index_buffer (void *object);
G_END_DECLS G_END_DECLS

View File

@ -61,7 +61,7 @@ sizeof_indices_type (CoglIndicesType type)
CoglIndices * CoglIndices *
cogl_indices_new_for_buffer (CoglIndicesType type, cogl_indices_new_for_buffer (CoglIndicesType type,
CoglIndexBuffer *buffer, CoglIndexBuffer *buffer,
gsize offset) size_t offset)
{ {
CoglIndices *indices = g_slice_new (CoglIndices); CoglIndices *indices = g_slice_new (CoglIndices);
@ -111,7 +111,7 @@ cogl_indices_get_type (CoglIndices *indices)
return indices->type; return indices->type;
} }
gsize size_t
cogl_indices_get_offset (CoglIndices *indices) cogl_indices_get_offset (CoglIndices *indices)
{ {
_COGL_RETURN_VAL_IF_FAIL (cogl_is_indices (indices), 0); _COGL_RETURN_VAL_IF_FAIL (cogl_is_indices (indices), 0);
@ -122,7 +122,7 @@ cogl_indices_get_offset (CoglIndices *indices)
static void static void
warn_about_midscene_changes (void) warn_about_midscene_changes (void)
{ {
static gboolean seen = FALSE; static CoglBool seen = FALSE;
if (!seen) if (!seen)
{ {
g_warning ("Mid-scene modification of indices has " g_warning ("Mid-scene modification of indices has "
@ -133,7 +133,7 @@ warn_about_midscene_changes (void)
void void
cogl_indices_set_offset (CoglIndices *indices, cogl_indices_set_offset (CoglIndices *indices,
gsize offset) size_t offset)
{ {
_COGL_RETURN_IF_FAIL (cogl_is_indices (indices)); _COGL_RETURN_IF_FAIL (cogl_is_indices (indices));
@ -181,8 +181,8 @@ cogl_get_rectangle_indices (CoglContext *ctx, int n_rectangles)
/* Generate the byte array if we haven't already */ /* Generate the byte array if we haven't already */
if (ctx->rectangle_byte_indices == NULL) if (ctx->rectangle_byte_indices == NULL)
{ {
guint8 *byte_array = g_malloc (256 / 4 * 6 * sizeof (guint8)); uint8_t *byte_array = g_malloc (256 / 4 * 6 * sizeof (uint8_t));
guint8 *p = byte_array; uint8_t *p = byte_array;
int i, vert_num = 0; int i, vert_num = 0;
for (i = 0; i < 256 / 4; i++) for (i = 0; i < 256 / 4; i++)
@ -211,8 +211,8 @@ cogl_get_rectangle_indices (CoglContext *ctx, int n_rectangles)
{ {
if (ctx->rectangle_short_indices_len < n_indices) if (ctx->rectangle_short_indices_len < n_indices)
{ {
guint16 *short_array; uint16_t *short_array;
guint16 *p; uint16_t *p;
int i, vert_num = 0; int i, vert_num = 0;
if (ctx->rectangle_short_indices != NULL) if (ctx->rectangle_short_indices != NULL)
@ -226,7 +226,7 @@ cogl_get_rectangle_indices (CoglContext *ctx, int n_rectangles)
/* Over-allocate to generate a whole number of quads */ /* Over-allocate to generate a whole number of quads */
p = short_array = g_malloc ((ctx->rectangle_short_indices_len p = short_array = g_malloc ((ctx->rectangle_short_indices_len
+ 5) / 6 * 6 + 5) / 6 * 6
* sizeof (guint16)); * sizeof (uint16_t));
/* Fill in the complete quads */ /* Fill in the complete quads */
for (i = 0; i < ctx->rectangle_short_indices_len; i += 6) for (i = 0; i < ctx->rectangle_short_indices_len; i += 6)

View File

@ -108,7 +108,7 @@ cogl_indices_new (CoglContext *context,
CoglIndices * CoglIndices *
cogl_indices_new_for_buffer (CoglIndicesType type, cogl_indices_new_for_buffer (CoglIndicesType type,
CoglIndexBuffer *buffer, CoglIndexBuffer *buffer,
gsize offset); size_t offset);
CoglIndexBuffer * CoglIndexBuffer *
cogl_indices_get_buffer (CoglIndices *indices); cogl_indices_get_buffer (CoglIndices *indices);
@ -116,12 +116,12 @@ cogl_indices_get_buffer (CoglIndices *indices);
CoglIndicesType CoglIndicesType
cogl_indices_get_type (CoglIndices *indices); cogl_indices_get_type (CoglIndices *indices);
gsize size_t
cogl_indices_get_offset (CoglIndices *indices); cogl_indices_get_offset (CoglIndices *indices);
void void
cogl_indices_set_offset (CoglIndices *indices, cogl_indices_set_offset (CoglIndices *indices,
gsize offset); size_t offset);
CoglIndices * CoglIndices *
cogl_get_rectangle_indices (CoglContext *context, int n_rectangles); cogl_get_rectangle_indices (CoglContext *context, int n_rectangles);
@ -137,7 +137,7 @@ cogl_get_rectangle_indices (CoglContext *context, int n_rectangles);
* Since: 1.10 * Since: 1.10
* Stability: unstable * Stability: unstable
*/ */
gboolean CoglBool
cogl_is_indices (void *object); cogl_is_indices (void *object);
G_END_DECLS G_END_DECLS

View File

@ -115,7 +115,7 @@ typedef enum _CoglPipelineEvalFlags
COGL_PIPELINE_EVAL_FLAG_NONE = 0 COGL_PIPELINE_EVAL_FLAG_NONE = 0
} CoglPipelineEvalFlags; } CoglPipelineEvalFlags;
gboolean CoglBool
_cogl_check_extension (const char *name, const char *ext); _cogl_check_extension (const char *name, const char *ext);
GQuark GQuark

View File

@ -94,21 +94,21 @@ _cogl_journal_flush (CoglJournal *journal);
void void
_cogl_journal_discard (CoglJournal *journal); _cogl_journal_discard (CoglJournal *journal);
gboolean CoglBool
_cogl_journal_all_entries_within_bounds (CoglJournal *journal, _cogl_journal_all_entries_within_bounds (CoglJournal *journal,
float clip_x0, float clip_x0,
float clip_y0, float clip_y0,
float clip_x1, float clip_x1,
float clip_y1); float clip_y1);
gboolean CoglBool
_cogl_journal_try_read_pixel (CoglJournal *journal, _cogl_journal_try_read_pixel (CoglJournal *journal,
int x, int x,
int y, int y,
CoglBitmap *bitmap, CoglBitmap *bitmap,
gboolean *found_intersection); CoglBool *found_intersection);
gboolean CoglBool
_cogl_is_journal (void *object); _cogl_is_journal (void *object);
#endif /* __COGL_JOURNAL_PRIVATE_H */ #endif /* __COGL_JOURNAL_PRIVATE_H */

View File

@ -94,29 +94,29 @@
typedef struct _CoglJournalFlushState typedef struct _CoglJournalFlushState
{ {
CoglJournal *journal; CoglJournal *journal;
CoglAttributeBuffer *attribute_buffer; CoglAttributeBuffer *attribute_buffer;
GArray *attributes; GArray *attributes;
int current_attribute; int current_attribute;
gsize stride; size_t stride;
size_t array_offset; size_t array_offset;
GLuint current_vertex; GLuint current_vertex;
CoglIndices *indices; CoglIndices *indices;
gsize indices_type_size; size_t indices_type_size;
CoglMatrixStack *modelview_stack; CoglMatrixStack *modelview_stack;
CoglMatrixStack *projection_stack; CoglMatrixStack *projection_stack;
CoglPipeline *pipeline; CoglPipeline *pipeline;
} CoglJournalFlushState; } CoglJournalFlushState;
typedef void (*CoglJournalBatchCallback) (CoglJournalEntry *start, typedef void (*CoglJournalBatchCallback) (CoglJournalEntry *start,
int n_entries, int n_entries,
void *data); void *data);
typedef gboolean (*CoglJournalBatchTest) (CoglJournalEntry *entry0, typedef CoglBool (*CoglJournalBatchTest) (CoglJournalEntry *entry0,
CoglJournalEntry *entry1); CoglJournalEntry *entry1);
static void _cogl_journal_free (CoglJournal *journal); static void _cogl_journal_free (CoglJournal *journal);
@ -160,9 +160,9 @@ _cogl_journal_new (CoglFramebuffer *framebuffer)
} }
static void static void
_cogl_journal_dump_logged_quad (guint8 *data, int n_layers) _cogl_journal_dump_logged_quad (uint8_t *data, int n_layers)
{ {
gsize stride = GET_JOURNAL_ARRAY_STRIDE_FOR_N_LAYERS (n_layers); size_t stride = GET_JOURNAL_ARRAY_STRIDE_FOR_N_LAYERS (n_layers);
int i; int i;
_COGL_GET_CONTEXT (ctx, NO_RETVAL); _COGL_GET_CONTEXT (ctx, NO_RETVAL);
@ -189,9 +189,9 @@ _cogl_journal_dump_logged_quad (guint8 *data, int n_layers)
} }
static void static void
_cogl_journal_dump_quad_vertices (guint8 *data, int n_layers) _cogl_journal_dump_quad_vertices (uint8_t *data, int n_layers)
{ {
gsize stride = GET_JOURNAL_VB_STRIDE_FOR_N_LAYERS (n_layers); size_t stride = GET_JOURNAL_VB_STRIDE_FOR_N_LAYERS (n_layers);
int i; int i;
_COGL_GET_CONTEXT (ctx, NO_RETVAL); _COGL_GET_CONTEXT (ctx, NO_RETVAL);
@ -204,7 +204,7 @@ _cogl_journal_dump_quad_vertices (guint8 *data, int n_layers)
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
float *v = (float *)data + (i * stride); float *v = (float *)data + (i * stride);
guint8 *c = data + (POS_STRIDE * 4) + (i * stride * 4); uint8_t *c = data + (POS_STRIDE * 4) + (i * stride * 4);
int j; int j;
if (G_UNLIKELY (COGL_DEBUG_ENABLED if (G_UNLIKELY (COGL_DEBUG_ENABLED
@ -224,9 +224,9 @@ _cogl_journal_dump_quad_vertices (guint8 *data, int n_layers)
} }
static void static void
_cogl_journal_dump_quad_batch (guint8 *data, int n_layers, int n_quads) _cogl_journal_dump_quad_batch (uint8_t *data, int n_layers, int n_quads)
{ {
gsize byte_stride = GET_JOURNAL_VB_STRIDE_FOR_N_LAYERS (n_layers) * 4; size_t byte_stride = GET_JOURNAL_VB_STRIDE_FOR_N_LAYERS (n_layers) * 4;
int i; int i;
g_print ("_cogl_journal_dump_quad_batch: n_layers = %d, n_quads = %d\n", g_print ("_cogl_journal_dump_quad_batch: n_layers = %d, n_quads = %d\n",
@ -358,7 +358,7 @@ _cogl_journal_flush_modelview_and_entries (CoglJournalEntry *batch_start,
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_RECTANGLES))) if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_RECTANGLES)))
{ {
static CoglPipeline *outline = NULL; static CoglPipeline *outline = NULL;
guint8 color_intensity; uint8_t color_intensity;
int i; int i;
CoglAttribute *loop_attributes[1]; CoglAttribute *loop_attributes[1];
@ -408,7 +408,7 @@ _cogl_journal_flush_modelview_and_entries (CoglJournalEntry *batch_start,
COGL_TIMER_STOP (_cogl_uprof_context, time_flush_modelview_and_entries); COGL_TIMER_STOP (_cogl_uprof_context, time_flush_modelview_and_entries);
} }
static gboolean static CoglBool
compare_entry_modelviews (CoglJournalEntry *entry0, compare_entry_modelviews (CoglJournalEntry *entry0,
CoglJournalEntry *entry1) CoglJournalEntry *entry1)
{ {
@ -469,7 +469,7 @@ _cogl_journal_flush_pipeline_and_entries (CoglJournalEntry *batch_start,
COGL_TIMER_STOP (_cogl_uprof_context, time_flush_pipeline_entries); COGL_TIMER_STOP (_cogl_uprof_context, time_flush_pipeline_entries);
} }
static gboolean static CoglBool
compare_entry_pipelines (CoglJournalEntry *entry0, CoglJournalEntry *entry1) compare_entry_pipelines (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
{ {
/* batch rectangles using compatible pipelines */ /* batch rectangles using compatible pipelines */
@ -566,7 +566,7 @@ _cogl_journal_flush_texcoord_vbo_offsets_and_entries (
COGL_TIMER_STOP (_cogl_uprof_context, time_flush_texcoord_pipeline_entries); COGL_TIMER_STOP (_cogl_uprof_context, time_flush_texcoord_pipeline_entries);
} }
static gboolean static CoglBool
compare_entry_n_layers (CoglJournalEntry *entry0, CoglJournalEntry *entry1) compare_entry_n_layers (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
{ {
if (entry0->n_layers == entry1->n_layers) if (entry0->n_layers == entry1->n_layers)
@ -582,11 +582,11 @@ _cogl_journal_flush_vbo_offsets_and_entries (CoglJournalEntry *batch_start,
int batch_len, int batch_len,
void *data) void *data)
{ {
CoglJournalFlushState *state = data; CoglJournalFlushState *state = data;
CoglContext *ctx = state->journal->framebuffer->context; CoglContext *ctx = state->journal->framebuffer->context;
gsize stride; size_t stride;
int i; int i;
CoglAttribute **attribute_entry; CoglAttribute **attribute_entry;
COGL_STATIC_TIMER (time_flush_vbo_texcoord_pipeline_entries, COGL_STATIC_TIMER (time_flush_vbo_texcoord_pipeline_entries,
"flush: clip+vbo+texcoords+pipeline+entries", /* parent */ "flush: clip+vbo+texcoords+pipeline+entries", /* parent */
"flush: vbo+texcoords+pipeline+entries", "flush: vbo+texcoords+pipeline+entries",
@ -648,12 +648,12 @@ _cogl_journal_flush_vbo_offsets_and_entries (CoglJournalEntry *batch_start,
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_JOURNAL))) if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_JOURNAL)))
{ {
guint8 *verts; uint8_t *verts;
/* Mapping a buffer for read is probably a really bad thing to /* Mapping a buffer for read is probably a really bad thing to
do but this will only happen during debugging so it probably do but this will only happen during debugging so it probably
doesn't matter */ doesn't matter */
verts = ((guint8 *)cogl_buffer_map (COGL_BUFFER (state->attribute_buffer), verts = ((uint8_t *)cogl_buffer_map (COGL_BUFFER (state->attribute_buffer),
COGL_BUFFER_ACCESS_READ, 0) + COGL_BUFFER_ACCESS_READ, 0) +
state->array_offset); state->array_offset);
@ -679,7 +679,7 @@ _cogl_journal_flush_vbo_offsets_and_entries (CoglJournalEntry *batch_start,
time_flush_vbo_texcoord_pipeline_entries); time_flush_vbo_texcoord_pipeline_entries);
} }
static gboolean static CoglBool
compare_entry_strides (CoglJournalEntry *entry0, CoglJournalEntry *entry1) compare_entry_strides (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
{ {
/* Currently the only thing that affects the stride for our vertex arrays /* Currently the only thing that affects the stride for our vertex arrays
@ -755,7 +755,7 @@ _cogl_journal_flush_clip_stacks_and_entries (CoglJournalEntry *batch_start,
time_flush_clip_stack_pipeline_entries); time_flush_clip_stack_pipeline_entries);
} }
static gboolean static CoglBool
calculate_translation (const CoglMatrix *a, calculate_translation (const CoglMatrix *a,
const CoglMatrix *b, const CoglMatrix *b,
float *tx_p, float *tx_p,
@ -846,7 +846,7 @@ typedef struct
float x_2, y_2; float x_2, y_2;
} ClipBounds; } ClipBounds;
static gboolean static CoglBool
can_software_clip_entry (CoglJournalEntry *journal_entry, can_software_clip_entry (CoglJournalEntry *journal_entry,
CoglJournalEntry *prev_journal_entry, CoglJournalEntry *prev_journal_entry,
CoglClipStack *clip_stack, CoglClipStack *clip_stack,
@ -1119,7 +1119,7 @@ _cogl_journal_maybe_software_clip_entries (CoglJournalEntry *batch_start,
time_check_software_clip); time_check_software_clip);
} }
static gboolean static CoglBool
compare_entry_clip_stacks (CoglJournalEntry *entry0, CoglJournalEntry *entry1) compare_entry_clip_stacks (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
{ {
return entry0->clip_stack == entry1->clip_stack; return entry0->clip_stack == entry1->clip_stack;
@ -1129,7 +1129,7 @@ compare_entry_clip_stacks (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
array so it can be treated as if it was just newly allocated */ array so it can be treated as if it was just newly allocated */
static CoglAttributeBuffer * static CoglAttributeBuffer *
create_attribute_buffer (CoglJournal *journal, create_attribute_buffer (CoglJournal *journal,
gsize n_bytes) size_t n_bytes)
{ {
CoglAttributeBuffer *vbo; CoglAttributeBuffer *vbo;
@ -1163,11 +1163,11 @@ create_attribute_buffer (CoglJournal *journal,
} }
static CoglAttributeBuffer * static CoglAttributeBuffer *
upload_vertices (CoglJournal *journal, upload_vertices (CoglJournal *journal,
const CoglJournalEntry *entries, const CoglJournalEntry *entries,
int n_entries, int n_entries,
size_t needed_vbo_len, size_t needed_vbo_len,
GArray *vertices) GArray *vertices)
{ {
CoglAttributeBuffer *attribute_buffer; CoglAttributeBuffer *attribute_buffer;
CoglBuffer *buffer; CoglBuffer *buffer;
@ -1284,7 +1284,7 @@ _cogl_journal_discard (CoglJournal *journal)
/* Note: A return value of FALSE doesn't mean 'no' it means /* Note: A return value of FALSE doesn't mean 'no' it means
* 'unknown' */ * 'unknown' */
gboolean CoglBool
_cogl_journal_all_entries_within_bounds (CoglJournal *journal, _cogl_journal_all_entries_within_bounds (CoglJournal *journal,
float clip_x0, float clip_x0,
float clip_y0, float clip_y0,
@ -1329,7 +1329,7 @@ _cogl_journal_all_entries_within_bounds (CoglJournal *journal,
*/ */
for (i = 1; i < journal->entries->len; i++) for (i = 1; i < journal->entries->len; i++)
{ {
gboolean found_reference = FALSE; CoglBool found_reference = FALSE;
entry = &g_array_index (journal->entries, CoglJournalEntry, i); entry = &g_array_index (journal->entries, CoglJournalEntry, i);
for (clip_entry = entry->clip_stack; for (clip_entry = entry->clip_stack;
@ -1466,7 +1466,7 @@ _cogl_journal_flush (CoglJournal *journal)
COGL_TIMER_STOP (_cogl_uprof_context, flush_timer); COGL_TIMER_STOP (_cogl_uprof_context, flush_timer);
} }
static gboolean static CoglBool
add_framebuffer_deps_cb (CoglPipelineLayer *layer, void *user_data) add_framebuffer_deps_cb (CoglPipelineLayer *layer, void *user_data)
{ {
CoglFramebuffer *framebuffer = user_data; CoglFramebuffer *framebuffer = user_data;
@ -1492,12 +1492,12 @@ _cogl_journal_log_quad (CoglJournal *journal,
unsigned int tex_coords_len) unsigned int tex_coords_len)
{ {
CoglFramebuffer *framebuffer = journal->framebuffer; CoglFramebuffer *framebuffer = journal->framebuffer;
gsize stride; size_t stride;
int next_vert; int next_vert;
float *v; float *v;
int i; int i;
int next_entry; int next_entry;
guint32 disable_layers; uint32_t disable_layers;
CoglJournalEntry *entry; CoglJournalEntry *entry;
CoglPipeline *final_pipeline; CoglPipeline *final_pipeline;
CoglClipStack *clip_stack; CoglClipStack *clip_stack;
@ -1539,7 +1539,7 @@ _cogl_journal_log_quad (CoglJournal *journal,
/* FIXME: This is a hacky optimization, since it will break if we /* FIXME: This is a hacky optimization, since it will break if we
* change the definition of CoglColor: */ * change the definition of CoglColor: */
_cogl_pipeline_get_colorubv (pipeline, (guint8 *) v); _cogl_pipeline_get_colorubv (pipeline, (uint8_t *) v);
v++; v++;
memcpy (v, position, sizeof (float) * 2); memcpy (v, position, sizeof (float) * 2);
@ -1559,7 +1559,7 @@ _cogl_journal_log_quad (CoglJournal *journal,
{ {
g_print ("Logged new quad:\n"); g_print ("Logged new quad:\n");
v = &g_array_index (journal->vertices, float, next_vert); v = &g_array_index (journal->vertices, float, next_vert);
_cogl_journal_dump_logged_quad ((guint8 *)v, n_layers); _cogl_journal_dump_logged_quad ((uint8_t *)v, n_layers);
} }
next_entry = journal->entries->len; next_entry = journal->entries->len;
@ -1704,16 +1704,16 @@ entry_to_screen_polygon (CoglFramebuffer *framebuffer,
#undef VIEWPORT_TRANSFORM_Y #undef VIEWPORT_TRANSFORM_Y
} }
static gboolean static CoglBool
try_checking_point_hits_entry_after_clipping (CoglFramebuffer *framebuffer, try_checking_point_hits_entry_after_clipping (CoglFramebuffer *framebuffer,
CoglJournalEntry *entry, CoglJournalEntry *entry,
float *vertices, float *vertices,
float x, float x,
float y, float y,
gboolean *hit) CoglBool *hit)
{ {
gboolean can_software_clip = TRUE; CoglBool can_software_clip = TRUE;
gboolean needs_software_clip = FALSE; CoglBool needs_software_clip = FALSE;
CoglClipStack *clip_entry; CoglClipStack *clip_entry;
*hit = TRUE; *hit = TRUE;
@ -1777,12 +1777,12 @@ try_checking_point_hits_entry_after_clipping (CoglFramebuffer *framebuffer,
return TRUE; return TRUE;
} }
gboolean CoglBool
_cogl_journal_try_read_pixel (CoglJournal *journal, _cogl_journal_try_read_pixel (CoglJournal *journal,
int x, int x,
int y, int y,
CoglBitmap *bitmap, CoglBitmap *bitmap,
gboolean *found_intersection) CoglBool *found_intersection)
{ {
CoglPixelFormat format; CoglPixelFormat format;
int i; int i;
@ -1819,12 +1819,12 @@ _cogl_journal_try_read_pixel (CoglJournal *journal,
{ {
CoglJournalEntry *entry = CoglJournalEntry *entry =
&g_array_index (journal->entries, CoglJournalEntry, i); &g_array_index (journal->entries, CoglJournalEntry, i);
guint8 *color = (guint8 *)&g_array_index (journal->vertices, float, uint8_t *color = (uint8_t *)&g_array_index (journal->vertices, float,
entry->array_offset); entry->array_offset);
float *vertices = (float *)color + 1; float *vertices = (float *)color + 1;
float poly[16]; float poly[16];
CoglFramebuffer *framebuffer = journal->framebuffer; CoglFramebuffer *framebuffer = journal->framebuffer;
guint8 *pixel; uint8_t *pixel;
entry_to_screen_polygon (framebuffer, entry, vertices, poly); entry_to_screen_polygon (framebuffer, entry, vertices, poly);
@ -1833,7 +1833,7 @@ _cogl_journal_try_read_pixel (CoglJournal *journal,
if (entry->clip_stack) if (entry->clip_stack)
{ {
gboolean hit; CoglBool hit;
if (!try_checking_point_hits_entry_after_clipping (framebuffer, if (!try_checking_point_hits_entry_after_clipping (framebuffer,
entry, entry,

View File

@ -58,7 +58,7 @@ cogl_material_unref (CoglHandle handle)
cogl_object_unref (handle); cogl_object_unref (handle);
} }
gboolean CoglBool
cogl_is_material (CoglHandle handle) cogl_is_material (CoglHandle handle)
{ {
return cogl_is_pipeline (handle); return cogl_is_pipeline (handle);
@ -73,10 +73,10 @@ cogl_material_set_color (CoglMaterial *material,
void void
cogl_material_set_color4ub (CoglMaterial *material, cogl_material_set_color4ub (CoglMaterial *material,
guint8 red, uint8_t red,
guint8 green, uint8_t green,
guint8 blue, uint8_t blue,
guint8 alpha) uint8_t alpha)
{ {
cogl_pipeline_set_color4ub (COGL_PIPELINE (material), cogl_pipeline_set_color4ub (COGL_PIPELINE (material),
red, green, blue, alpha); red, green, blue, alpha);
@ -189,7 +189,7 @@ cogl_material_set_alpha_test_function (CoglMaterial *material,
alpha_reference); alpha_reference);
} }
gboolean CoglBool
cogl_material_set_blend (CoglMaterial *material, cogl_material_set_blend (CoglMaterial *material,
const char *blend_string, const char *blend_string,
GError **error) GError **error)
@ -248,7 +248,7 @@ cogl_material_remove_layer (CoglMaterial *material,
cogl_pipeline_remove_layer (COGL_PIPELINE (material), layer_index); cogl_pipeline_remove_layer (COGL_PIPELINE (material), layer_index);
} }
gboolean CoglBool
cogl_material_set_layer_combine (CoglMaterial *material, cogl_material_set_layer_combine (CoglMaterial *material,
int layer_index, int layer_index,
const char *blend_string, const char *blend_string,
@ -327,10 +327,10 @@ cogl_material_set_layer_filters (CoglMaterial *material,
mag_filter); mag_filter);
} }
gboolean CoglBool
cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material, cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
int layer_index, int layer_index,
gboolean enable, CoglBool enable,
GError **error) GError **error)
{ {
CoglPipeline *pipeline = COGL_PIPELINE (material); CoglPipeline *pipeline = COGL_PIPELINE (material);
@ -340,7 +340,7 @@ cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
error); error);
} }
gboolean CoglBool
cogl_material_get_layer_point_sprite_coords_enabled (CoglMaterial *material, cogl_material_get_layer_point_sprite_coords_enabled (CoglMaterial *material,
int layer_index) int layer_index)
{ {
@ -436,7 +436,7 @@ cogl_material_foreach_layer (CoglMaterial *material,
(CoglPipelineLayerCallback)callback, user_data); (CoglPipelineLayerCallback)callback, user_data);
} }
gboolean CoglBool
cogl_material_set_depth_state (CoglMaterial *material, cogl_material_set_depth_state (CoglMaterial *material,
const CoglDepthState *state, const CoglDepthState *state,
GError **error) GError **error)

View File

@ -198,7 +198,7 @@ cogl_material_unref (CoglHandle material) G_GNUC_DEPRECATED;
* Return value: %TRUE if the handle references a #CoglMaterial, * Return value: %TRUE if the handle references a #CoglMaterial,
* %FALSE otherwise * %FALSE otherwise
*/ */
gboolean CoglBool
cogl_is_material (CoglHandle handle); cogl_is_material (CoglHandle handle);
/** /**
@ -237,10 +237,10 @@ cogl_material_set_color (CoglMaterial *material,
*/ */
void void
cogl_material_set_color4ub (CoglMaterial *material, cogl_material_set_color4ub (CoglMaterial *material,
guint8 red, uint8_t red,
guint8 green, uint8_t green,
guint8 blue, uint8_t blue,
guint8 alpha); uint8_t alpha);
/** /**
* cogl_material_set_color4f: * cogl_material_set_color4f:
@ -587,7 +587,7 @@ cogl_material_set_alpha_test_function (CoglMaterial *material,
* *
* Since: 1.0 * Since: 1.0
*/ */
gboolean CoglBool
cogl_material_set_blend (CoglMaterial *material, cogl_material_set_blend (CoglMaterial *material,
const char *blend_string, const char *blend_string,
GError **error); GError **error);
@ -832,7 +832,7 @@ cogl_material_remove_layer (CoglMaterial *material,
* *
* Since: 1.0 * Since: 1.0
*/ */
gboolean CoglBool
cogl_material_set_layer_combine (CoglMaterial *material, cogl_material_set_layer_combine (CoglMaterial *material,
int layer_index, int layer_index,
const char *blend_string, const char *blend_string,
@ -1013,10 +1013,10 @@ cogl_material_set_layer_filters (CoglMaterial *material,
* Return value: %TRUE if the function succeeds, %FALSE otherwise. * Return value: %TRUE if the function succeeds, %FALSE otherwise.
* Since: 1.4 * Since: 1.4
*/ */
gboolean CoglBool
cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material, cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
int layer_index, int layer_index,
gboolean enable, CoglBool enable,
GError **error); GError **error);
/** /**
@ -1032,7 +1032,7 @@ cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
* *
* Since: 1.4 * Since: 1.4
*/ */
gboolean CoglBool
cogl_material_get_layer_point_sprite_coords_enabled (CoglMaterial *material, cogl_material_get_layer_point_sprite_coords_enabled (CoglMaterial *material,
int layer_index); int layer_index);
@ -1215,7 +1215,7 @@ cogl_material_layer_get_wrap_mode_p (CoglMaterialLayer *layer);
* Since: 1.8 * Since: 1.8
* Stability: Unstable * Stability: Unstable
*/ */
gboolean CoglBool
cogl_material_set_depth_state (CoglMaterial *material, cogl_material_set_depth_state (CoglMaterial *material,
const CoglDepthState *state, const CoglDepthState *state,
GError **error); GError **error);
@ -1247,7 +1247,7 @@ cogl_material_get_depth_state (CoglMaterial *material,
* Since: 1.4 * Since: 1.4
* Stability: Unstable * Stability: Unstable
*/ */
typedef gboolean (*CoglMaterialLayerCallback) (CoglMaterial *material, typedef CoglBool (*CoglMaterialLayerCallback) (CoglMaterial *material,
int layer_index, int layer_index,
void *user_data); void *user_data);

View File

@ -38,7 +38,7 @@
typedef struct { typedef struct {
CoglMatrix matrix; CoglMatrix matrix;
gboolean is_identity; CoglBool is_identity;
/* count of pushes with no changes; when a change is /* count of pushes with no changes; when a change is
* requested, we create a new state and decrement this * requested, we create a new state and decrement this
*/ */
@ -93,7 +93,7 @@ _cogl_matrix_stack_top (CoglMatrixStack *stack)
*/ */
static CoglMatrixState * static CoglMatrixState *
_cogl_matrix_stack_top_mutable (CoglMatrixStack *stack, _cogl_matrix_stack_top_mutable (CoglMatrixStack *stack,
gboolean initialize) CoglBool initialize)
{ {
CoglMatrixState *state; CoglMatrixState *state;
CoglMatrixState *new_top; CoglMatrixState *new_top;
@ -321,7 +321,7 @@ _cogl_matrix_stack_ortho (CoglMatrixStack *stack,
stack->age++; stack->age++;
} }
gboolean CoglBool
_cogl_matrix_stack_get_inverse (CoglMatrixStack *stack, _cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
CoglMatrix *inverse) CoglMatrix *inverse)
{ {
@ -367,7 +367,7 @@ _cogl_matrix_stack_set (CoglMatrixStack *stack,
static void static void
_cogl_matrix_stack_flush_matrix_to_gl_builtin (CoglContext *ctx, _cogl_matrix_stack_flush_matrix_to_gl_builtin (CoglContext *ctx,
gboolean is_identity, CoglBool is_identity,
CoglMatrix *matrix, CoglMatrix *matrix,
CoglMatrixMode mode) CoglMatrixMode mode)
{ {
@ -409,14 +409,14 @@ void
_cogl_matrix_stack_flush_to_gl_builtins (CoglContext *ctx, _cogl_matrix_stack_flush_to_gl_builtins (CoglContext *ctx,
CoglMatrixStack *stack, CoglMatrixStack *stack,
CoglMatrixMode mode, CoglMatrixMode mode,
gboolean disable_flip) CoglBool disable_flip)
{ {
g_assert (ctx->driver == COGL_DRIVER_GL || g_assert (ctx->driver == COGL_DRIVER_GL ||
ctx->driver == COGL_DRIVER_GLES1); ctx->driver == COGL_DRIVER_GLES1);
#if defined (HAVE_COGL_GL) || defined (HAVE_COGL_GLES) #if defined (HAVE_COGL_GL) || defined (HAVE_COGL_GLES)
{ {
gboolean needs_flip; CoglBool needs_flip;
CoglMatrixState *state; CoglMatrixState *state;
CoglMatrixStackCache *cache; CoglMatrixStackCache *cache;
@ -451,7 +451,7 @@ _cogl_matrix_stack_flush_to_gl_builtins (CoglContext *ctx,
if (!cache || if (!cache ||
_cogl_matrix_stack_check_and_update_cache (stack, cache, needs_flip)) _cogl_matrix_stack_check_and_update_cache (stack, cache, needs_flip))
{ {
gboolean is_identity = state->is_identity && !needs_flip; CoglBool is_identity = state->is_identity && !needs_flip;
if (needs_flip) if (needs_flip)
{ {
@ -485,13 +485,13 @@ _cogl_matrix_stack_get_age (CoglMatrixStack *stack)
return stack->age; return stack->age;
} }
gboolean CoglBool
_cogl_matrix_stack_has_identity_flag (CoglMatrixStack *stack) _cogl_matrix_stack_has_identity_flag (CoglMatrixStack *stack)
{ {
return _cogl_matrix_stack_top (stack)->is_identity; return _cogl_matrix_stack_top (stack)->is_identity;
} }
gboolean CoglBool
_cogl_matrix_stack_equal (CoglMatrixStack *stack0, _cogl_matrix_stack_equal (CoglMatrixStack *stack0,
CoglMatrixStack *stack1) CoglMatrixStack *stack1)
{ {
@ -507,14 +507,14 @@ _cogl_matrix_stack_equal (CoglMatrixStack *stack0,
return cogl_matrix_equal (&state0->matrix, &state1->matrix); return cogl_matrix_equal (&state0->matrix, &state1->matrix);
} }
gboolean CoglBool
_cogl_matrix_stack_check_and_update_cache (CoglMatrixStack *stack, _cogl_matrix_stack_check_and_update_cache (CoglMatrixStack *stack,
CoglMatrixStackCache *cache, CoglMatrixStackCache *cache,
gboolean flip) CoglBool flip)
{ {
gboolean is_identity = CoglBool is_identity =
_cogl_matrix_stack_has_identity_flag (stack) && !flip; _cogl_matrix_stack_has_identity_flag (stack) && !flip;
gboolean is_dirty; CoglBool is_dirty;
if (is_identity && cache->flushed_identity) if (is_identity && cache->flushed_identity)
is_dirty = FALSE; is_dirty = FALSE;

View File

@ -38,8 +38,8 @@ typedef struct
{ {
CoglMatrixStack *stack; CoglMatrixStack *stack;
unsigned int age; unsigned int age;
gboolean flushed_identity; CoglBool flushed_identity;
gboolean flipped; CoglBool flipped;
} CoglMatrixStackCache; } CoglMatrixStackCache;
typedef enum { typedef enum {
@ -49,7 +49,7 @@ typedef enum {
} CoglMatrixMode; } CoglMatrixMode;
typedef void (* CoglMatrixStackFlushFunc) (CoglContext *context, typedef void (* CoglMatrixStackFlushFunc) (CoglContext *context,
gboolean is_identity, CoglBool is_identity,
const CoglMatrix *matrix, const CoglMatrix *matrix,
void *user_data); void *user_data);
@ -106,7 +106,7 @@ _cogl_matrix_stack_ortho (CoglMatrixStack *stack,
float top, float top,
float z_near, float z_near,
float z_far); float z_far);
gboolean CoglBool
_cogl_matrix_stack_get_inverse (CoglMatrixStack *stack, _cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
CoglMatrix *inverse); CoglMatrix *inverse);
void void
@ -120,7 +120,7 @@ void
_cogl_matrix_stack_flush_to_gl_builtins (CoglContext *ctx, _cogl_matrix_stack_flush_to_gl_builtins (CoglContext *ctx,
CoglMatrixStack *stack, CoglMatrixStack *stack,
CoglMatrixMode mode, CoglMatrixMode mode,
gboolean disable_flip); CoglBool disable_flip);
unsigned int unsigned int
_cogl_matrix_stack_get_age (CoglMatrixStack *stack); _cogl_matrix_stack_get_age (CoglMatrixStack *stack);
@ -129,25 +129,25 @@ _cogl_matrix_stack_get_age (CoglMatrixStack *stack);
identity matrix. If it returns FALSE it may or may not be the identity matrix. If it returns FALSE it may or may not be the
identity matrix but no expensive comparison is performed to verify identity matrix but no expensive comparison is performed to verify
it. */ it. */
gboolean CoglBool
_cogl_matrix_stack_has_identity_flag (CoglMatrixStack *stack); _cogl_matrix_stack_has_identity_flag (CoglMatrixStack *stack);
gboolean CoglBool
_cogl_matrix_stack_equal (CoglMatrixStack *stack0, _cogl_matrix_stack_equal (CoglMatrixStack *stack0,
CoglMatrixStack *stack1); CoglMatrixStack *stack1);
void void
_cogl_matrix_stack_init_cache (CoglMatrixStackCache *cache); _cogl_matrix_stack_init_cache (CoglMatrixStackCache *cache);
gboolean CoglBool
_cogl_matrix_stack_check_and_update_cache (CoglMatrixStack *stack, _cogl_matrix_stack_check_and_update_cache (CoglMatrixStack *stack,
CoglMatrixStackCache *cache, CoglMatrixStackCache *cache,
gboolean flip); CoglBool flip);
void void
_cogl_matrix_stack_destroy_cache (CoglMatrixStackCache *cache); _cogl_matrix_stack_destroy_cache (CoglMatrixStackCache *cache);
gboolean CoglBool
_cogl_is_matrix_stack (void *object); _cogl_is_matrix_stack (void *object);
#endif /* __COGL_MATRIX_STACK_H */ #endif /* __COGL_MATRIX_STACK_H */

View File

@ -431,7 +431,7 @@ _cogl_matrix_print (const CoglMatrix *matrix)
* with partial pivoting followed by back/substitution with the loops manually * with partial pivoting followed by back/substitution with the loops manually
* unrolled. * unrolled.
*/ */
static gboolean static CoglBool
invert_matrix_general (CoglMatrix *matrix) invert_matrix_general (CoglMatrix *matrix)
{ {
const float *m = (float *)matrix; const float *m = (float *)matrix;
@ -570,7 +570,7 @@ invert_matrix_general (CoglMatrix *matrix)
* element. Finally deals with the translation part by transforming the * element. Finally deals with the translation part by transforming the
* original translation vector using by the calculated submatrix inverse. * original translation vector using by the calculated submatrix inverse.
*/ */
static gboolean static CoglBool
invert_matrix_3d_general (CoglMatrix *matrix) invert_matrix_3d_general (CoglMatrix *matrix)
{ {
const float *in = (float *)matrix; const float *in = (float *)matrix;
@ -652,7 +652,7 @@ invert_matrix_3d_general (CoglMatrix *matrix)
* the inverse matrix analyzing and inverting each of the scaling, rotation and * the inverse matrix analyzing and inverting each of the scaling, rotation and
* translation parts. * translation parts.
*/ */
static gboolean static CoglBool
invert_matrix_3d (CoglMatrix *matrix) invert_matrix_3d (CoglMatrix *matrix)
{ {
const float *in = (float *)matrix; const float *in = (float *)matrix;
@ -735,7 +735,7 @@ invert_matrix_3d (CoglMatrix *matrix)
* *
* Simply copies identity into CoglMatrix::inv. * Simply copies identity into CoglMatrix::inv.
*/ */
static gboolean static CoglBool
invert_matrix_identity (CoglMatrix *matrix) invert_matrix_identity (CoglMatrix *matrix)
{ {
memcpy (matrix->inv, identity, 16 * sizeof (float)); memcpy (matrix->inv, identity, 16 * sizeof (float));
@ -752,7 +752,7 @@ invert_matrix_identity (CoglMatrix *matrix)
* *
* Calculates the * Calculates the
*/ */
static gboolean static CoglBool
invert_matrix_3d_no_rotation (CoglMatrix *matrix) invert_matrix_3d_no_rotation (CoglMatrix *matrix)
{ {
const float *in = (float *)matrix; const float *in = (float *)matrix;
@ -787,7 +787,7 @@ invert_matrix_3d_no_rotation (CoglMatrix *matrix)
* Calculates the inverse matrix by applying the inverse scaling and * Calculates the inverse matrix by applying the inverse scaling and
* translation to the identity matrix. * translation to the identity matrix.
*/ */
static gboolean static CoglBool
invert_matrix_2d_no_rotation (CoglMatrix *matrix) invert_matrix_2d_no_rotation (CoglMatrix *matrix)
{ {
const float *in = (float *)matrix; const float *in = (float *)matrix;
@ -811,7 +811,7 @@ invert_matrix_2d_no_rotation (CoglMatrix *matrix)
#if 0 #if 0
/* broken */ /* broken */
static gboolean static CoglBool
invert_matrix_perspective (CoglMatrix *matrix) invert_matrix_perspective (CoglMatrix *matrix)
{ {
const float *in = matrix; const float *in = matrix;
@ -841,7 +841,7 @@ invert_matrix_perspective (CoglMatrix *matrix)
/* /*
* Matrix inversion function pointer type. * Matrix inversion function pointer type.
*/ */
typedef gboolean (*inv_mat_func)(CoglMatrix *matrix); typedef CoglBool (*inv_mat_func)(CoglMatrix *matrix);
/* /*
* Table of the matrix inversion functions according to the matrix type. * Table of the matrix inversion functions according to the matrix type.
@ -1099,7 +1099,7 @@ _cogl_matrix_update_type_and_flags (CoglMatrix *matrix)
* given matrix type. In case of failure, updates the MAT_FLAG_SINGULAR flag, * given matrix type. In case of failure, updates the MAT_FLAG_SINGULAR flag,
* and copies the identity matrix into CoglMatrix::inv. * and copies the identity matrix into CoglMatrix::inv.
*/ */
static gboolean static CoglBool
_cogl_matrix_update_inverse (CoglMatrix *matrix) _cogl_matrix_update_inverse (CoglMatrix *matrix)
{ {
if (matrix->flags & MAT_DIRTY_FLAGS || if (matrix->flags & MAT_DIRTY_FLAGS ||
@ -1124,7 +1124,7 @@ _cogl_matrix_update_inverse (CoglMatrix *matrix)
return TRUE; return TRUE;
} }
gboolean CoglBool
cogl_matrix_get_inverse (const CoglMatrix *matrix, CoglMatrix *inverse) cogl_matrix_get_inverse (const CoglMatrix *matrix, CoglMatrix *inverse)
{ {
if (_cogl_matrix_update_inverse ((CoglMatrix *)matrix)) if (_cogl_matrix_update_inverse ((CoglMatrix *)matrix))
@ -1156,7 +1156,7 @@ _cogl_matrix_rotate (CoglMatrix *matrix,
{ {
float xx, yy, zz, xy, yz, zx, xs, ys, zs, one_c, s, c; float xx, yy, zz, xy, yz, zx, xs, ys, zs, one_c, s, c;
float m[16]; float m[16];
gboolean optimized; CoglBool optimized;
s = sinf (angle * DEG2RAD); s = sinf (angle * DEG2RAD);
c = cosf (angle * DEG2RAD); c = cosf (angle * DEG2RAD);
@ -1600,7 +1600,7 @@ cogl_matrix_init_identity (CoglMatrix *matrix)
/* /*
* Test if the given matrix preserves vector lengths. * Test if the given matrix preserves vector lengths.
*/ */
static gboolean static CoglBool
_cogl_matrix_is_length_preserving (const CoglMatrix *m) _cogl_matrix_is_length_preserving (const CoglMatrix *m)
{ {
return TEST_MAT_FLAGS (m, MAT_FLAGS_LENGTH_PRESERVING); return TEST_MAT_FLAGS (m, MAT_FLAGS_LENGTH_PRESERVING);
@ -1610,7 +1610,7 @@ _cogl_matrix_is_length_preserving (const CoglMatrix *m)
* Test if the given matrix does any rotation. * Test if the given matrix does any rotation.
* (or perhaps if the upper-left 3x3 is non-identity) * (or perhaps if the upper-left 3x3 is non-identity)
*/ */
static gboolean static CoglBool
_cogl_matrix_has_rotation (const CoglMatrix *matrix) _cogl_matrix_has_rotation (const CoglMatrix *matrix)
{ {
if (matrix->flags & (MAT_FLAG_GENERAL | if (matrix->flags & (MAT_FLAG_GENERAL |
@ -1622,13 +1622,13 @@ _cogl_matrix_has_rotation (const CoglMatrix *matrix)
return FALSE; return FALSE;
} }
static gboolean static CoglBool
_cogl_matrix_is_general_scale (const CoglMatrix *matrix) _cogl_matrix_is_general_scale (const CoglMatrix *matrix)
{ {
return (matrix->flags & MAT_FLAG_GENERAL_SCALE) ? TRUE : FALSE; return (matrix->flags & MAT_FLAG_GENERAL_SCALE) ? TRUE : FALSE;
} }
static gboolean static CoglBool
_cogl_matrix_is_dirty (const CoglMatrix *matrix) _cogl_matrix_is_dirty (const CoglMatrix *matrix)
{ {
return (matrix->flags & MAT_DIRTY_ALL) ? TRUE : FALSE; return (matrix->flags & MAT_DIRTY_ALL) ? TRUE : FALSE;
@ -1782,8 +1782,8 @@ cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
height_2d); height_2d);
} }
gboolean CoglBool
cogl_matrix_equal (gconstpointer v1, gconstpointer v2) cogl_matrix_equal (const void *v1, const void *v2)
{ {
const CoglMatrix *a = v1; const CoglMatrix *a = v1;
const CoglMatrix *b = v2; const CoglMatrix *b = v2;
@ -1896,8 +1896,8 @@ _cogl_matrix_transform_points_f2 (const CoglMatrix *matrix,
for (i = 0; i < n_points; i++) for (i = 0; i < n_points; i++)
{ {
Point2f p = *(Point2f *)((guint8 *)points_in + i * stride_in); Point2f p = *(Point2f *)((uint8_t *)points_in + i * stride_in);
Point3f *o = (Point3f *)((guint8 *)points_out + i * stride_out); Point3f *o = (Point3f *)((uint8_t *)points_out + i * stride_out);
o->x = matrix->xx * p.x + matrix->xy * p.y + matrix->xw; o->x = matrix->xx * p.x + matrix->xy * p.y + matrix->xw;
o->y = matrix->yx * p.x + matrix->yy * p.y + matrix->yw; o->y = matrix->yx * p.x + matrix->yy * p.y + matrix->yw;
@ -1917,8 +1917,8 @@ _cogl_matrix_project_points_f2 (const CoglMatrix *matrix,
for (i = 0; i < n_points; i++) for (i = 0; i < n_points; i++)
{ {
Point2f p = *(Point2f *)((guint8 *)points_in + i * stride_in); Point2f p = *(Point2f *)((uint8_t *)points_in + i * stride_in);
Point4f *o = (Point4f *)((guint8 *)points_out + i * stride_out); Point4f *o = (Point4f *)((uint8_t *)points_out + i * stride_out);
o->x = matrix->xx * p.x + matrix->xy * p.y + matrix->xw; o->x = matrix->xx * p.x + matrix->xy * p.y + matrix->xw;
o->y = matrix->yx * p.x + matrix->yy * p.y + matrix->yw; o->y = matrix->yx * p.x + matrix->yy * p.y + matrix->yw;
@ -1939,8 +1939,8 @@ _cogl_matrix_transform_points_f3 (const CoglMatrix *matrix,
for (i = 0; i < n_points; i++) for (i = 0; i < n_points; i++)
{ {
Point3f p = *(Point3f *)((guint8 *)points_in + i * stride_in); Point3f p = *(Point3f *)((uint8_t *)points_in + i * stride_in);
Point3f *o = (Point3f *)((guint8 *)points_out + i * stride_out); Point3f *o = (Point3f *)((uint8_t *)points_out + i * stride_out);
o->x = matrix->xx * p.x + matrix->xy * p.y + o->x = matrix->xx * p.x + matrix->xy * p.y +
matrix->xz * p.z + matrix->xw; matrix->xz * p.z + matrix->xw;
@ -1963,8 +1963,8 @@ _cogl_matrix_project_points_f3 (const CoglMatrix *matrix,
for (i = 0; i < n_points; i++) for (i = 0; i < n_points; i++)
{ {
Point3f p = *(Point3f *)((guint8 *)points_in + i * stride_in); Point3f p = *(Point3f *)((uint8_t *)points_in + i * stride_in);
Point4f *o = (Point4f *)((guint8 *)points_out + i * stride_out); Point4f *o = (Point4f *)((uint8_t *)points_out + i * stride_out);
o->x = matrix->xx * p.x + matrix->xy * p.y + o->x = matrix->xx * p.x + matrix->xy * p.y +
matrix->xz * p.z + matrix->xw; matrix->xz * p.z + matrix->xw;
@ -1989,8 +1989,8 @@ _cogl_matrix_project_points_f4 (const CoglMatrix *matrix,
for (i = 0; i < n_points; i++) for (i = 0; i < n_points; i++)
{ {
Point4f p = *(Point4f *)((guint8 *)points_in + i * stride_in); Point4f p = *(Point4f *)((uint8_t *)points_in + i * stride_in);
Point4f *o = (Point4f *)((guint8 *)points_out + i * stride_out); Point4f *o = (Point4f *)((uint8_t *)points_out + i * stride_out);
o->x = matrix->xx * p.x + matrix->xy * p.y + o->x = matrix->xx * p.x + matrix->xy * p.y +
matrix->xz * p.z + matrix->xw * p.w; matrix->xz * p.z + matrix->xw * p.w;
@ -2061,7 +2061,7 @@ cogl_matrix_project_points (const CoglMatrix *matrix,
} }
} }
gboolean CoglBool
cogl_matrix_is_identity (const CoglMatrix *matrix) cogl_matrix_is_identity (const CoglMatrix *matrix)
{ {
if (!(matrix->flags & MAT_DIRTY_TYPE) && if (!(matrix->flags & MAT_DIRTY_TYPE) &&

View File

@ -483,8 +483,8 @@ cogl_matrix_init_from_quaternion (CoglMatrix *matrix,
* *
* Since: 1.4 * Since: 1.4
*/ */
gboolean CoglBool
cogl_matrix_equal (gconstpointer v1, gconstpointer v2); cogl_matrix_equal (const void *v1, const void *v2);
/** /**
* cogl_matrix_copy: * cogl_matrix_copy:
@ -533,7 +533,7 @@ cogl_matrix_free (CoglMatrix *matrix);
* *
* Since: 1.2 * Since: 1.2
*/ */
gboolean CoglBool
cogl_matrix_get_inverse (const CoglMatrix *matrix, cogl_matrix_get_inverse (const CoglMatrix *matrix,
CoglMatrix *inverse); CoglMatrix *inverse);
@ -584,11 +584,11 @@ cogl_matrix_transform_point (const CoglMatrix *matrix,
* |[ * |[
* typedef struct { * typedef struct {
* float x,y; * float x,y;
* guint8 r,g,b,a; * uint8_t r,g,b,a;
* float s,t,p; * float s,t,p;
* } MyInVertex; * } MyInVertex;
* typedef struct { * typedef struct {
* guint8 r,g,b,a; * uint8_t r,g,b,a;
* float x,y,z; * float x,y,z;
* } MyOutVertex; * } MyOutVertex;
* MyInVertex vertices[N_VERTICES]; * MyInVertex vertices[N_VERTICES];
@ -639,11 +639,11 @@ cogl_matrix_transform_points (const CoglMatrix *matrix,
* |[ * |[
* typedef struct { * typedef struct {
* float x,y; * float x,y;
* guint8 r,g,b,a; * uint8_t r,g,b,a;
* float s,t,p; * float s,t,p;
* } MyInVertex; * } MyInVertex;
* typedef struct { * typedef struct {
* guint8 r,g,b,a; * uint8_t r,g,b,a;
* float x,y,z; * float x,y,z;
* } MyOutVertex; * } MyOutVertex;
* MyInVertex vertices[N_VERTICES]; * MyInVertex vertices[N_VERTICES];
@ -684,7 +684,7 @@ cogl_matrix_project_points (const CoglMatrix *matrix,
* Returns: %TRUE if @matrix is an identity matrix else %FALSE * Returns: %TRUE if @matrix is an identity matrix else %FALSE
* Since: 1.8 * Since: 1.8
*/ */
gboolean CoglBool
cogl_matrix_is_identity (const CoglMatrix *matrix); cogl_matrix_is_identity (const CoglMatrix *matrix);
/** /**

View File

@ -223,8 +223,8 @@ typedef struct _ClampData
{ {
float start; float start;
float end; float end;
gboolean s_flipped; CoglBool s_flipped;
gboolean t_flipped; CoglBool t_flipped;
CoglMetaTextureCallback callback; CoglMetaTextureCallback callback;
void *user_data; void *user_data;
} ClampData; } ClampData;
@ -273,7 +273,7 @@ clamp_t_cb (CoglTexture *sub_texture,
clamp_data->user_data); clamp_data->user_data);
} }
static gboolean static CoglBool
foreach_clamped_region (CoglMetaTexture *meta_texture, foreach_clamped_region (CoglMetaTexture *meta_texture,
float *tx_1, float *tx_1,
float *ty_1, float *ty_1,
@ -513,7 +513,7 @@ cogl_meta_texture_foreach_in_region (CoglMetaTexture *meta_texture,
if (wrap_s == COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE || if (wrap_s == COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE ||
wrap_t == COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE) wrap_t == COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE)
{ {
gboolean finished = foreach_clamped_region (meta_texture, CoglBool finished = foreach_clamped_region (meta_texture,
&tx_1, &ty_1, &tx_2, &ty_2, &tx_1, &ty_1, &tx_2, &ty_2,
wrap_s, wrap_t, wrap_s, wrap_t,
callback, callback,

View File

@ -56,7 +56,7 @@ struct _CoglNode
/* TRUE if the node took a strong reference on its parent. Weak /* TRUE if the node took a strong reference on its parent. Weak
* pipelines for instance don't take a reference on their parent. */ * pipelines for instance don't take a reference on their parent. */
gboolean has_parent_reference; CoglBool has_parent_reference;
}; };
#define COGL_NODE(X) ((CoglNode *)(X)) #define COGL_NODE(X) ((CoglNode *)(X))
@ -70,12 +70,12 @@ void
_cogl_pipeline_node_set_parent_real (CoglNode *node, _cogl_pipeline_node_set_parent_real (CoglNode *node,
CoglNode *parent, CoglNode *parent,
CoglNodeUnparentVFunc unparent, CoglNodeUnparentVFunc unparent,
gboolean take_strong_reference); CoglBool take_strong_reference);
void void
_cogl_pipeline_node_unparent_real (CoglNode *node); _cogl_pipeline_node_unparent_real (CoglNode *node);
typedef gboolean (*CoglNodeChildCallback) (CoglNode *child, void *user_data); typedef CoglBool (*CoglNodeChildCallback) (CoglNode *child, void *user_data);
void void
_cogl_pipeline_node_foreach_child (CoglNode *node, _cogl_pipeline_node_foreach_child (CoglNode *node,

View File

@ -43,7 +43,7 @@ void
_cogl_pipeline_node_set_parent_real (CoglNode *node, _cogl_pipeline_node_set_parent_real (CoglNode *node,
CoglNode *parent, CoglNode *parent,
CoglNodeUnparentVFunc unparent, CoglNodeUnparentVFunc unparent,
gboolean take_strong_reference) CoglBool take_strong_reference)
{ {
/* NB: the old parent may indirectly be keeping the new parent alive /* NB: the old parent may indirectly be keeping the new parent alive
* so we have to ref the new parent before unrefing the old. * so we have to ref the new parent before unrefing the old.

View File

@ -182,7 +182,7 @@ _cogl_##type_name##_object_new (Cogl##TypeName *new_obj) \
\ \
COGL_OBJECT_COMMON_DEFINE_WITH_CODE(TypeName, type_name, code) \ COGL_OBJECT_COMMON_DEFINE_WITH_CODE(TypeName, type_name, code) \
\ \
gboolean \ CoglBool \
cogl_is_##type_name (void *object) \ cogl_is_##type_name (void *object) \
{ \ { \
CoglObject *obj = object; \ CoglObject *obj = object; \
@ -197,7 +197,7 @@ cogl_is_##type_name (void *object) \
\ \
COGL_OBJECT_COMMON_DEFINE_WITH_CODE(TypeName, type_name, code) \ COGL_OBJECT_COMMON_DEFINE_WITH_CODE(TypeName, type_name, code) \
\ \
gboolean \ CoglBool \
_cogl_is_##type_name (void *object) \ _cogl_is_##type_name (void *object) \
{ \ { \
CoglObject *obj = object; \ CoglObject *obj = object; \

View File

@ -79,7 +79,7 @@ cogl_offscreen_new_to_texture (CoglTexture *texture);
* Returns: %TRUE if @object is a #CoglOffscreen framebuffer, * Returns: %TRUE if @object is a #CoglOffscreen framebuffer,
* %FALSE otherwise * %FALSE otherwise
*/ */
gboolean CoglBool
cogl_is_offscreen (void *object); cogl_is_offscreen (void *object);
#ifndef COGL_DISABLE_DEPRECATED #ifndef COGL_DISABLE_DEPRECATED

View File

@ -51,7 +51,7 @@ struct _CoglOnscreen
CoglFramebuffer _parent; CoglFramebuffer _parent;
#ifdef COGL_HAS_X11_SUPPORT #ifdef COGL_HAS_X11_SUPPORT
guint32 foreign_xid; uint32_t foreign_xid;
CoglOnscreenX11MaskCallback foreign_update_mask_callback; CoglOnscreenX11MaskCallback foreign_update_mask_callback;
void *foreign_update_mask_data; void *foreign_update_mask_data;
#endif #endif
@ -60,7 +60,7 @@ struct _CoglOnscreen
HWND foreign_hwnd; HWND foreign_hwnd;
#endif #endif
gboolean swap_throttled; CoglBool swap_throttled;
CoglSwapBuffersNotifyList swap_callbacks; CoglSwapBuffersNotifyList swap_callbacks;

View File

@ -83,7 +83,7 @@ cogl_onscreen_template_set_samples_per_pixel (
void void
cogl_onscreen_template_set_swap_throttled ( cogl_onscreen_template_set_swap_throttled (
CoglOnscreenTemplate *onscreen_template, CoglOnscreenTemplate *onscreen_template,
gboolean throttled) CoglBool throttled)
{ {
onscreen_template->config.swap_throttled = throttled; onscreen_template->config.swap_throttled = throttled;
} }

View File

@ -86,7 +86,7 @@ cogl_onscreen_template_set_samples_per_pixel (
void void
cogl_onscreen_template_set_swap_throttled ( cogl_onscreen_template_set_swap_throttled (
CoglOnscreenTemplate *onscreen_template, CoglOnscreenTemplate *onscreen_template,
gboolean throttled); CoglBool throttled);
/** /**
* cogl_is_onscreen_template: * cogl_is_onscreen_template:
@ -99,7 +99,7 @@ cogl_onscreen_template_set_swap_throttled (
* Since: 1.10 * Since: 1.10
* Stability: unstable * Stability: unstable
*/ */
gboolean CoglBool
cogl_is_onscreen_template (void *object); cogl_is_onscreen_template (void *object);
G_END_DECLS G_END_DECLS

View File

@ -176,7 +176,7 @@ cogl_onscreen_swap_region (CoglOnscreen *onscreen,
#ifdef COGL_HAS_X11_SUPPORT #ifdef COGL_HAS_X11_SUPPORT
void void
cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen, cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen,
guint32 xid, uint32_t xid,
CoglOnscreenX11MaskCallback update, CoglOnscreenX11MaskCallback update,
void *user_data) void *user_data)
{ {
@ -189,7 +189,7 @@ cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen,
onscreen->foreign_update_mask_data = user_data; onscreen->foreign_update_mask_data = user_data;
} }
guint32 uint32_t
cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen) cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen)
{ {
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen); CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
@ -207,19 +207,19 @@ cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen)
} }
} }
guint32 uint32_t
cogl_x11_onscreen_get_visual_xid (CoglOnscreen *onscreen) cogl_x11_onscreen_get_visual_xid (CoglOnscreen *onscreen)
{ {
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen); CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
const CoglWinsysVtable *winsys = _cogl_framebuffer_get_winsys (framebuffer); const CoglWinsysVtable *winsys = _cogl_framebuffer_get_winsys (framebuffer);
XVisualInfo *visinfo; XVisualInfo *visinfo;
guint32 id; uint32_t id;
/* This should only be called for xlib based onscreens */ /* This should only be called for xlib based onscreens */
_COGL_RETURN_VAL_IF_FAIL (winsys->xlib_get_visual_info != NULL, 0); _COGL_RETURN_VAL_IF_FAIL (winsys->xlib_get_visual_info != NULL, 0);
visinfo = winsys->xlib_get_visual_info (); visinfo = winsys->xlib_get_visual_info ();
id = (guint32)visinfo->visualid; id = (uint32_t)visinfo->visualid;
XFree (visinfo); XFree (visinfo);
return id; return id;
@ -291,7 +291,7 @@ cogl_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen,
void void
cogl_onscreen_set_swap_throttled (CoglOnscreen *onscreen, cogl_onscreen_set_swap_throttled (CoglOnscreen *onscreen,
gboolean throttled) CoglBool throttled)
{ {
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen); CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
framebuffer->config.swap_throttled = throttled; framebuffer->config.swap_throttled = throttled;

View File

@ -60,7 +60,7 @@ cogl_onscreen_new (CoglContext *context, int width, int height);
#ifdef COGL_HAS_X11 #ifdef COGL_HAS_X11
typedef void (*CoglOnscreenX11MaskCallback) (CoglOnscreen *onscreen, typedef void (*CoglOnscreenX11MaskCallback) (CoglOnscreen *onscreen,
guint32 event_mask, uint32_t event_mask,
void *user_data); void *user_data);
/** /**
@ -88,7 +88,7 @@ typedef void (*CoglOnscreenX11MaskCallback) (CoglOnscreen *onscreen,
* [{ * [{
* static void * static void
* my_update_cogl_x11_event_mask (CoglOnscreen *onscreen, * my_update_cogl_x11_event_mask (CoglOnscreen *onscreen,
* guint32 event_mask, * uint32_t event_mask,
* void *user_data) * void *user_data)
* { * {
* XSetWindowAttributes attrs; * XSetWindowAttributes attrs;
@ -115,7 +115,7 @@ typedef void (*CoglOnscreenX11MaskCallback) (CoglOnscreen *onscreen,
*/ */
void void
cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen, cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen,
guint32 xid, uint32_t xid,
CoglOnscreenX11MaskCallback update, CoglOnscreenX11MaskCallback update,
void *user_data); void *user_data);
@ -136,12 +136,12 @@ cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen,
* Since: 1.10 * Since: 1.10
* Stability: unstable * Stability: unstable
*/ */
guint32 uint32_t
cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen); cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen);
/* XXX: we should maybe remove this, since nothing currently uses /* XXX: we should maybe remove this, since nothing currently uses
* it and the current implementation looks dubious. */ * it and the current implementation looks dubious. */
guint32 uint32_t
cogl_x11_onscreen_get_visual_xid (CoglOnscreen *onscreen); cogl_x11_onscreen_get_visual_xid (CoglOnscreen *onscreen);
#endif /* COGL_HAS_X11 */ #endif /* COGL_HAS_X11 */
@ -237,7 +237,7 @@ cogl_wayland_onscreen_resize (CoglOnscreen *onscreen,
*/ */
void void
cogl_onscreen_set_swap_throttled (CoglOnscreen *onscreen, cogl_onscreen_set_swap_throttled (CoglOnscreen *onscreen,
gboolean throttled); CoglBool throttled);
/** /**
* cogl_onscreen_show: * cogl_onscreen_show:
@ -391,7 +391,7 @@ cogl_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen,
* Since: 1.10 * Since: 1.10
* Stability: unstable * Stability: unstable
*/ */
gboolean CoglBool
cogl_is_onscreen (void *object); cogl_is_onscreen (void *object);
G_END_DECLS G_END_DECLS

View File

@ -45,7 +45,7 @@ G_BEGIN_DECLS
* Return value: %TRUE if the handle references a #CoglPath, * Return value: %TRUE if the handle references a #CoglPath,
* %FALSE otherwise * %FALSE otherwise
*/ */
gboolean CoglBool
cogl_is_path (CoglHandle handle); cogl_is_path (CoglHandle handle);
/** /**

View File

@ -97,13 +97,13 @@ struct _CoglPathData
case and divert to the journal or a rectangle clip. If it is TRUE case and divert to the journal or a rectangle clip. If it is TRUE
then the entire path can be described by calling then the entire path can be described by calling
_cogl_path_get_bounds */ _cogl_path_get_bounds */
gboolean is_rectangle; CoglBool is_rectangle;
}; };
void void
_cogl_add_path_to_stencil_buffer (CoglPath *path, _cogl_add_path_to_stencil_buffer (CoglPath *path,
gboolean merge, CoglBool merge,
gboolean need_clear); CoglBool need_clear);
void void
_cogl_path_get_bounds (CoglPath *path, _cogl_path_get_bounds (CoglPath *path,
@ -112,7 +112,7 @@ _cogl_path_get_bounds (CoglPath *path,
float *max_x, float *max_x,
float *max_y); float *max_y);
gboolean CoglBool
_cogl_path_is_rectangle (CoglPath *path); _cogl_path_is_rectangle (CoglPath *path);
void void

View File

@ -58,7 +58,7 @@ pipeline_fragment_hash (const void *data)
0); 0);
} }
static gboolean static CoglBool
pipeline_fragment_equal (const void *a, const void *b) pipeline_fragment_equal (const void *a, const void *b)
{ {
unsigned int fragment_state; unsigned int fragment_state;
@ -89,7 +89,7 @@ pipeline_vertex_hash (const void *data)
0); 0);
} }
static gboolean static CoglBool
pipeline_vertex_equal (const void *a, const void *b) pipeline_vertex_equal (const void *a, const void *b)
{ {
unsigned long vertex_state = unsigned long vertex_state =
@ -122,7 +122,7 @@ pipeline_combined_hash (const void *data)
0); 0);
} }
static gboolean static CoglBool
pipeline_combined_equal (const void *a, const void *b) pipeline_combined_equal (const void *a, const void *b)
{ {
unsigned int combined_state; unsigned int combined_state;
@ -211,7 +211,7 @@ _cogl_pipeline_cache_get_fragment_template (CoglPipelineCache *cache,
if (G_UNLIKELY (g_hash_table_size (cache->fragment_hash) > 50)) if (G_UNLIKELY (g_hash_table_size (cache->fragment_hash) > 50))
{ {
static gboolean seen = FALSE; static CoglBool seen = FALSE;
if (!seen) if (!seen)
g_warning ("Over 50 separate fragment shaders have been " g_warning ("Over 50 separate fragment shaders have been "
"generated which is very unusual, so something " "generated which is very unusual, so something "
@ -240,7 +240,7 @@ _cogl_pipeline_cache_get_vertex_template (CoglPipelineCache *cache,
if (G_UNLIKELY (g_hash_table_size (cache->vertex_hash) > 50)) if (G_UNLIKELY (g_hash_table_size (cache->vertex_hash) > 50))
{ {
static gboolean seen = FALSE; static CoglBool seen = FALSE;
if (!seen) if (!seen)
g_warning ("Over 50 separate vertex shaders have been " g_warning ("Over 50 separate vertex shaders have been "
"generated which is very unusual, so something " "generated which is very unusual, so something "
@ -269,7 +269,7 @@ _cogl_pipeline_cache_get_combined_template (CoglPipelineCache *cache,
if (G_UNLIKELY (g_hash_table_size (cache->combined_hash) > 50)) if (G_UNLIKELY (g_hash_table_size (cache->combined_hash) > 50))
{ {
static gboolean seen = FALSE; static CoglBool seen = FALSE;
if (!seen) if (!seen)
g_warning ("Over 50 separate programs have been " g_warning ("Over 50 separate programs have been "
"generated which is very unusual, so something " "generated which is very unusual, so something "

View File

@ -44,7 +44,7 @@ typedef struct
int indent; int indent;
} PrintDebugState; } PrintDebugState;
static gboolean static CoglBool
dump_layer_cb (CoglNode *node, void *user_data) dump_layer_cb (CoglNode *node, void *user_data)
{ {
CoglPipelineLayer *layer = COGL_PIPELINE_LAYER (node); CoglPipelineLayer *layer = COGL_PIPELINE_LAYER (node);
@ -52,7 +52,7 @@ dump_layer_cb (CoglNode *node, void *user_data)
int layer_id = *state->node_id_ptr; int layer_id = *state->node_id_ptr;
PrintDebugState state_out; PrintDebugState state_out;
GString *changes_label; GString *changes_label;
gboolean changes = FALSE; CoglBool changes = FALSE;
if (state->parent_id >= 0) if (state->parent_id >= 0)
g_string_append_printf (state->graph, "%*slayer%p -> layer%p;\n", g_string_append_printf (state->graph, "%*slayer%p -> layer%p;\n",
@ -117,7 +117,7 @@ dump_layer_cb (CoglNode *node, void *user_data)
return TRUE; return TRUE;
} }
static gboolean static CoglBool
dump_layer_ref_cb (CoglPipelineLayer *layer, void *data) dump_layer_ref_cb (CoglPipelineLayer *layer, void *data)
{ {
PrintDebugState *state = data; PrintDebugState *state = data;
@ -132,7 +132,7 @@ dump_layer_ref_cb (CoglPipelineLayer *layer, void *data)
return TRUE; return TRUE;
} }
static gboolean static CoglBool
dump_pipeline_cb (CoglNode *node, void *user_data) dump_pipeline_cb (CoglNode *node, void *user_data)
{ {
CoglPipeline *pipeline = COGL_PIPELINE (node); CoglPipeline *pipeline = COGL_PIPELINE (node);
@ -140,8 +140,8 @@ dump_pipeline_cb (CoglNode *node, void *user_data)
int pipeline_id = *state->node_id_ptr; int pipeline_id = *state->node_id_ptr;
PrintDebugState state_out; PrintDebugState state_out;
GString *changes_label; GString *changes_label;
gboolean changes = FALSE; CoglBool changes = FALSE;
gboolean layers = FALSE; CoglBool layers = FALSE;
if (state->parent_id >= 0) if (state->parent_id >= 0)
g_string_append_printf (state->graph, "%*spipeline%d -> pipeline%d;\n", g_string_append_printf (state->graph, "%*spipeline%d -> pipeline%d;\n",

View File

@ -155,7 +155,7 @@ dirty_shader_state (CoglPipeline *pipeline)
NULL); NULL);
} }
static gboolean static CoglBool
_cogl_pipeline_fragend_arbfp_start (CoglPipeline *pipeline, _cogl_pipeline_fragend_arbfp_start (CoglPipeline *pipeline,
int n_layers, int n_layers,
unsigned long pipelines_difference, unsigned long pipelines_difference,
@ -441,7 +441,7 @@ setup_arg (CoglPipeline *pipeline,
if (other_layer == NULL) if (other_layer == NULL)
{ {
static gboolean warning_seen = FALSE; static CoglBool warning_seen = FALSE;
if (!warning_seen) if (!warning_seen)
{ {
g_warning ("The application is trying to use a texture " g_warning ("The application is trying to use a texture "
@ -510,7 +510,7 @@ setup_arg (CoglPipeline *pipeline,
} }
} }
static gboolean static CoglBool
fragend_arbfp_args_equal (CoglPipelineFragendARBfpArg *arg0, fragend_arbfp_args_equal (CoglPipelineFragendARBfpArg *arg0,
CoglPipelineFragendARBfpArg *arg1) CoglPipelineFragendARBfpArg *arg1)
{ {
@ -708,7 +708,7 @@ append_masked_combine (CoglPipeline *arbfp_authority,
n_args); n_args);
} }
static gboolean static CoglBool
_cogl_pipeline_fragend_arbfp_add_layer (CoglPipeline *pipeline, _cogl_pipeline_fragend_arbfp_add_layer (CoglPipeline *pipeline,
CoglPipelineLayer *layer, CoglPipelineLayer *layer,
unsigned long layers_difference) unsigned long layers_difference)
@ -792,7 +792,7 @@ _cogl_pipeline_fragend_arbfp_add_layer (CoglPipeline *pipeline,
return TRUE; return TRUE;
} }
static gboolean static CoglBool
_cogl_pipeline_fragend_arbfp_passthrough (CoglPipeline *pipeline) _cogl_pipeline_fragend_arbfp_passthrough (CoglPipeline *pipeline)
{ {
CoglPipelineShaderState *shader_state = get_shader_state (pipeline); CoglPipelineShaderState *shader_state = get_shader_state (pipeline);
@ -808,11 +808,11 @@ _cogl_pipeline_fragend_arbfp_passthrough (CoglPipeline *pipeline)
typedef struct _UpdateConstantsState typedef struct _UpdateConstantsState
{ {
int unit; int unit;
gboolean update_all; CoglBool update_all;
CoglPipelineShaderState *shader_state; CoglPipelineShaderState *shader_state;
} UpdateConstantsState; } UpdateConstantsState;
static gboolean static CoglBool
update_constants_cb (CoglPipeline *pipeline, update_constants_cb (CoglPipeline *pipeline,
int layer_index, int layer_index,
void *user_data) void *user_data)
@ -838,7 +838,7 @@ update_constants_cb (CoglPipeline *pipeline,
return TRUE; return TRUE;
} }
static gboolean static CoglBool
_cogl_pipeline_fragend_arbfp_end (CoglPipeline *pipeline, _cogl_pipeline_fragend_arbfp_end (CoglPipeline *pipeline,
unsigned long pipelines_difference) unsigned long pipelines_difference)
{ {
@ -917,7 +917,7 @@ _cogl_pipeline_fragend_arbfp_end (CoglPipeline *pipeline,
else else
{ {
CoglProgram *program = shader_state->user_program; CoglProgram *program = shader_state->user_program;
gboolean program_changed; CoglBool program_changed;
/* If the shader has changed since it was last flushed then we /* If the shader has changed since it was last flushed then we
need to update all uniforms */ need to update all uniforms */

View File

@ -89,7 +89,7 @@ get_max_texture_units (void)
return ctx->max_texture_units; return ctx->max_texture_units;
} }
static gboolean static CoglBool
_cogl_pipeline_fragend_fixed_start (CoglPipeline *pipeline, _cogl_pipeline_fragend_fixed_start (CoglPipeline *pipeline,
int n_layers, int n_layers,
unsigned long pipelines_difference, unsigned long pipelines_difference,
@ -161,7 +161,7 @@ translate_sources (CoglPipeline *pipeline,
if (layer == NULL) if (layer == NULL)
{ {
static gboolean warning_seen = FALSE; static CoglBool warning_seen = FALSE;
if (!warning_seen) if (!warning_seen)
{ {
g_warning ("The application is trying to use a texture " g_warning ("The application is trying to use a texture "
@ -177,7 +177,7 @@ translate_sources (CoglPipeline *pipeline,
} }
} }
static gboolean static CoglBool
_cogl_pipeline_fragend_fixed_add_layer (CoglPipeline *pipeline, _cogl_pipeline_fragend_fixed_add_layer (CoglPipeline *pipeline,
CoglPipelineLayer *layer, CoglPipelineLayer *layer,
unsigned long layers_difference) unsigned long layers_difference)
@ -357,7 +357,7 @@ _cogl_pipeline_fragend_fixed_add_layer (CoglPipeline *pipeline,
return TRUE; return TRUE;
} }
static gboolean static CoglBool
get_highest_unit_index_cb (CoglPipelineLayer *layer, get_highest_unit_index_cb (CoglPipelineLayer *layer,
void *user_data) void *user_data)
{ {
@ -369,7 +369,7 @@ get_highest_unit_index_cb (CoglPipelineLayer *layer,
return TRUE; return TRUE;
} }
static gboolean static CoglBool
_cogl_pipeline_fragend_fixed_end (CoglPipeline *pipeline, _cogl_pipeline_fragend_fixed_end (CoglPipeline *pipeline,
unsigned long pipelines_difference) unsigned long pipelines_difference)
{ {

View File

@ -200,7 +200,7 @@ get_layer_fragment_snippets (CoglPipelineLayer *layer)
return &layer->big_state->fragment_snippets; return &layer->big_state->fragment_snippets;
} }
static gboolean static CoglBool
has_replace_hook (CoglPipelineLayer *layer, has_replace_hook (CoglPipelineLayer *layer,
CoglSnippetHook hook) CoglSnippetHook hook)
{ {
@ -213,7 +213,7 @@ has_replace_hook (CoglPipelineLayer *layer,
return FALSE; return FALSE;
} }
static gboolean static CoglBool
_cogl_pipeline_fragend_glsl_start (CoglPipeline *pipeline, _cogl_pipeline_fragend_glsl_start (CoglPipeline *pipeline,
int n_layers, int n_layers,
unsigned long pipelines_difference, unsigned long pipelines_difference,
@ -581,7 +581,7 @@ add_arg (CoglPipelineShaderState *shader_state,
if (other_layer == NULL) if (other_layer == NULL)
{ {
static gboolean warning_seen = FALSE; static CoglBool warning_seen = FALSE;
if (!warning_seen) if (!warning_seen)
{ {
g_warning ("The application is trying to use a texture " g_warning ("The application is trying to use a texture "
@ -905,7 +905,7 @@ ensure_layer_generated (CoglPipeline *pipeline,
g_slice_free (LayerData, layer_data); g_slice_free (LayerData, layer_data);
} }
static gboolean static CoglBool
_cogl_pipeline_fragend_glsl_add_layer (CoglPipeline *pipeline, _cogl_pipeline_fragend_glsl_add_layer (CoglPipeline *pipeline,
CoglPipelineLayer *layer, CoglPipelineLayer *layer,
unsigned long layers_difference) unsigned long layers_difference)
@ -998,7 +998,7 @@ add_alpha_test_snippet (CoglPipeline *pipeline,
#endif /* HAVE_COGL_GLES2 */ #endif /* HAVE_COGL_GLES2 */
static gboolean static CoglBool
_cogl_pipeline_fragend_glsl_end (CoglPipeline *pipeline, _cogl_pipeline_fragend_glsl_end (CoglPipeline *pipeline,
unsigned long pipelines_difference) unsigned long pipelines_difference)
{ {

View File

@ -187,7 +187,7 @@ typedef struct
/* The texture matrix dscribes how to transform texture coordinates */ /* The texture matrix dscribes how to transform texture coordinates */
CoglMatrix matrix; CoglMatrix matrix;
gboolean point_sprite_coords; CoglBool point_sprite_coords;
CoglPipelineSnippetList vertex_snippets; CoglPipelineSnippetList vertex_snippets;
CoglPipelineSnippetList fragment_snippets; CoglPipelineSnippetList fragment_snippets;
@ -262,7 +262,7 @@ struct _CoglPipelineLayer
}; };
typedef gboolean typedef CoglBool
(*CoglPipelineLayerStateComparitor) (CoglPipelineLayer *authority0, (*CoglPipelineLayerStateComparitor) (CoglPipelineLayer *authority0,
CoglPipelineLayer *authority1); CoglPipelineLayer *authority1);
@ -286,7 +286,7 @@ _cogl_pipeline_layer_resolve_authorities (CoglPipelineLayer *layer,
unsigned long differences, unsigned long differences,
CoglPipelineLayer **authorities); CoglPipelineLayer **authorities);
gboolean CoglBool
_cogl_pipeline_layer_equal (CoglPipelineLayer *layer0, _cogl_pipeline_layer_equal (CoglPipelineLayer *layer0,
CoglPipelineLayer *layer1, CoglPipelineLayer *layer1,
unsigned long differences_mask, unsigned long differences_mask,
@ -300,10 +300,10 @@ _cogl_pipeline_layer_pre_change_notify (CoglPipeline *required_owner,
void void
_cogl_pipeline_layer_prune_redundant_ancestry (CoglPipelineLayer *layer); _cogl_pipeline_layer_prune_redundant_ancestry (CoglPipelineLayer *layer);
gboolean CoglBool
_cogl_pipeline_layer_has_alpha (CoglPipelineLayer *layer); _cogl_pipeline_layer_has_alpha (CoglPipelineLayer *layer);
gboolean CoglBool
_cogl_pipeline_layer_has_user_matrix (CoglPipeline *pipeline, _cogl_pipeline_layer_has_user_matrix (CoglPipeline *pipeline,
int layer_index); int layer_index);
@ -380,7 +380,7 @@ _cogl_pipeline_layer_get_texture (CoglPipelineLayer *layer);
int int
_cogl_pipeline_layer_get_unit_index (CoglPipelineLayer *layer); _cogl_pipeline_layer_get_unit_index (CoglPipelineLayer *layer);
gboolean CoglBool
_cogl_pipeline_layer_needs_combine_separate _cogl_pipeline_layer_needs_combine_separate
(CoglPipelineLayer *combine_authority); (CoglPipelineLayer *combine_authority);

View File

@ -44,41 +44,41 @@ CoglPipelineFilter
_cogl_pipeline_get_layer_mag_filter (CoglPipeline *pipeline, _cogl_pipeline_get_layer_mag_filter (CoglPipeline *pipeline,
int layer_index); int layer_index);
gboolean CoglBool
_cogl_pipeline_layer_texture_type_equal (CoglPipelineLayer *authority0, _cogl_pipeline_layer_texture_type_equal (CoglPipelineLayer *authority0,
CoglPipelineLayer *authority1, CoglPipelineLayer *authority1,
CoglPipelineEvalFlags flags); CoglPipelineEvalFlags flags);
gboolean CoglBool
_cogl_pipeline_layer_texture_data_equal (CoglPipelineLayer *authority0, _cogl_pipeline_layer_texture_data_equal (CoglPipelineLayer *authority0,
CoglPipelineLayer *authority1, CoglPipelineLayer *authority1,
CoglPipelineEvalFlags flags); CoglPipelineEvalFlags flags);
gboolean CoglBool
_cogl_pipeline_layer_combine_state_equal (CoglPipelineLayer *authority0, _cogl_pipeline_layer_combine_state_equal (CoglPipelineLayer *authority0,
CoglPipelineLayer *authority1); CoglPipelineLayer *authority1);
gboolean CoglBool
_cogl_pipeline_layer_combine_constant_equal (CoglPipelineLayer *authority0, _cogl_pipeline_layer_combine_constant_equal (CoglPipelineLayer *authority0,
CoglPipelineLayer *authority1); CoglPipelineLayer *authority1);
gboolean CoglBool
_cogl_pipeline_layer_sampler_equal (CoglPipelineLayer *authority0, _cogl_pipeline_layer_sampler_equal (CoglPipelineLayer *authority0,
CoglPipelineLayer *authority1); CoglPipelineLayer *authority1);
gboolean CoglBool
_cogl_pipeline_layer_user_matrix_equal (CoglPipelineLayer *authority0, _cogl_pipeline_layer_user_matrix_equal (CoglPipelineLayer *authority0,
CoglPipelineLayer *authority1); CoglPipelineLayer *authority1);
gboolean CoglBool
_cogl_pipeline_layer_point_sprite_coords_equal (CoglPipelineLayer *authority0, _cogl_pipeline_layer_point_sprite_coords_equal (CoglPipelineLayer *authority0,
CoglPipelineLayer *authority1); CoglPipelineLayer *authority1);
gboolean CoglBool
_cogl_pipeline_layer_vertex_snippets_equal (CoglPipelineLayer *authority0, _cogl_pipeline_layer_vertex_snippets_equal (CoglPipelineLayer *authority0,
CoglPipelineLayer *authority1); CoglPipelineLayer *authority1);
gboolean CoglBool
_cogl_pipeline_layer_fragment_snippets_equal (CoglPipelineLayer *authority0, _cogl_pipeline_layer_fragment_snippets_equal (CoglPipelineLayer *authority0,
CoglPipelineLayer *authority1); CoglPipelineLayer *authority1);

Some files were not shown because too many files have changed in this diff Show More