mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
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:
parent
09642a83b5
commit
54735dec84
@ -44,7 +44,7 @@ typedef struct _CoglPangoDisplayListRectangle CoglPangoDisplayListRectangle;
|
||||
|
||||
struct _CoglPangoDisplayList
|
||||
{
|
||||
gboolean color_override;
|
||||
CoglBool color_override;
|
||||
CoglColor color;
|
||||
GSList *nodes;
|
||||
GSList *last_node;
|
||||
@ -62,7 +62,7 @@ struct _CoglPangoDisplayListNode
|
||||
{
|
||||
CoglPangoDisplayListNodeType type;
|
||||
|
||||
gboolean color_override;
|
||||
CoglBool color_override;
|
||||
CoglColor color;
|
||||
|
||||
CoglPipeline *pipeline;
|
||||
@ -261,7 +261,7 @@ emit_vertex_buffer_geometry (CoglPangoDisplayListNode *node)
|
||||
CoglAttributeBuffer *buffer;
|
||||
CoglVertexP2T2 *verts, *v;
|
||||
int n_verts;
|
||||
gboolean allocated = FALSE;
|
||||
CoglBool allocated = FALSE;
|
||||
CoglAttribute *attributes[2];
|
||||
CoglPrimitive *prim;
|
||||
int i;
|
||||
|
@ -167,7 +167,7 @@ cogl_pango_font_map_clear_glyph_cache (CoglPangoFontMap *fm)
|
||||
*/
|
||||
void
|
||||
cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *fm,
|
||||
gboolean value)
|
||||
CoglBool value)
|
||||
{
|
||||
CoglPangoRenderer *renderer;
|
||||
|
||||
@ -187,7 +187,7 @@ cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *fm,
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *fm)
|
||||
{
|
||||
CoglPangoRenderer *renderer;
|
||||
|
@ -49,16 +49,16 @@ struct _CoglPangoGlyphCache
|
||||
/* 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
|
||||
global atlas reorganizations */
|
||||
gboolean using_global_atlas;
|
||||
CoglBool using_global_atlas;
|
||||
|
||||
/* True if some of the glyphs are dirty. This is used as an
|
||||
optimization in _cogl_pango_glyph_cache_set_dirty_glyphs to avoid
|
||||
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
|
||||
affects whether we decide to put the glyph in the global atlas */
|
||||
gboolean use_mipmapping;
|
||||
CoglBool use_mipmapping;
|
||||
};
|
||||
|
||||
struct _CoglPangoGlyphCacheKey
|
||||
@ -82,8 +82,8 @@ cogl_pango_glyph_cache_key_free (CoglPangoGlyphCacheKey *key)
|
||||
g_slice_free (CoglPangoGlyphCacheKey, key);
|
||||
}
|
||||
|
||||
static guint
|
||||
cogl_pango_glyph_cache_hash_func (gconstpointer key)
|
||||
static unsigned int
|
||||
cogl_pango_glyph_cache_hash_func (const void *key)
|
||||
{
|
||||
const CoglPangoGlyphCacheKey *cache_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;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
cogl_pango_glyph_cache_equal_func (gconstpointer a,
|
||||
gconstpointer b)
|
||||
static CoglBool
|
||||
cogl_pango_glyph_cache_equal_func (const void *a, const void *b)
|
||||
{
|
||||
const CoglPangoGlyphCacheKey *key_a
|
||||
= (const CoglPangoGlyphCacheKey *) a;
|
||||
@ -112,7 +111,7 @@ cogl_pango_glyph_cache_equal_func (gconstpointer a,
|
||||
}
|
||||
|
||||
CoglPangoGlyphCache *
|
||||
cogl_pango_glyph_cache_new (gboolean use_mipmapping)
|
||||
cogl_pango_glyph_cache_new (CoglBool use_mipmapping)
|
||||
{
|
||||
CoglPangoGlyphCache *cache;
|
||||
|
||||
@ -198,7 +197,7 @@ cogl_pango_glyph_cache_update_position_cb (void *user_data,
|
||||
value->dirty = TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
cogl_pango_glyph_cache_add_to_global_atlas (CoglPangoGlyphCache *cache,
|
||||
PangoFont *font,
|
||||
PangoGlyph glyph,
|
||||
@ -244,7 +243,7 @@ cogl_pango_glyph_cache_add_to_global_atlas (CoglPangoGlyphCache *cache,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
cogl_pango_glyph_cache_add_to_local_atlas (CoglPangoGlyphCache *cache,
|
||||
PangoFont *font,
|
||||
PangoGlyph glyph,
|
||||
@ -294,7 +293,7 @@ cogl_pango_glyph_cache_add_to_local_atlas (CoglPangoGlyphCache *cache,
|
||||
|
||||
CoglPangoGlyphCacheValue *
|
||||
cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
|
||||
gboolean create,
|
||||
CoglBool create,
|
||||
PangoFont *font,
|
||||
PangoGlyph glyph)
|
||||
{
|
||||
@ -358,9 +357,9 @@ cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
|
||||
}
|
||||
|
||||
static void
|
||||
_cogl_pango_glyph_cache_set_dirty_glyphs_cb (gpointer key_ptr,
|
||||
gpointer value_ptr,
|
||||
gpointer user_data)
|
||||
_cogl_pango_glyph_cache_set_dirty_glyphs_cb (void *key_ptr,
|
||||
void *value_ptr,
|
||||
void *user_data)
|
||||
{
|
||||
CoglPangoGlyphCacheKey *key = key_ptr;
|
||||
CoglPangoGlyphCacheValue *value = value_ptr;
|
||||
|
@ -52,7 +52,7 @@ struct _CoglPangoGlyphCacheValue
|
||||
|
||||
/* This will be set to TRUE when the glyph atlas is reorganized
|
||||
which means the glyph will need to be redrawn */
|
||||
gboolean dirty;
|
||||
CoglBool dirty;
|
||||
};
|
||||
|
||||
typedef void (* CoglPangoGlyphCacheDirtyFunc) (PangoFont *font,
|
||||
@ -60,14 +60,14 @@ typedef void (* CoglPangoGlyphCacheDirtyFunc) (PangoFont *font,
|
||||
CoglPangoGlyphCacheValue *value);
|
||||
|
||||
CoglPangoGlyphCache *
|
||||
cogl_pango_glyph_cache_new (gboolean use_mipmapping);
|
||||
cogl_pango_glyph_cache_new (CoglBool use_mipmapping);
|
||||
|
||||
void
|
||||
cogl_pango_glyph_cache_free (CoglPangoGlyphCache *cache);
|
||||
|
||||
CoglPangoGlyphCacheValue *
|
||||
cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
|
||||
gboolean create,
|
||||
CoglBool create,
|
||||
PangoFont *font,
|
||||
PangoGlyph glyph);
|
||||
|
||||
|
@ -44,7 +44,7 @@ struct _CoglPangoPipelineCache
|
||||
CoglPipeline *base_texture_alpha_pipeline;
|
||||
CoglPipeline *base_texture_rgba_pipeline;
|
||||
|
||||
gboolean use_mipmapping;
|
||||
CoglBool use_mipmapping;
|
||||
};
|
||||
|
||||
struct _CoglPangoPipelineCacheEntry
|
||||
@ -58,14 +58,14 @@ struct _CoglPangoPipelineCacheEntry
|
||||
};
|
||||
|
||||
static void
|
||||
_cogl_pango_pipeline_cache_key_destroy (gpointer data)
|
||||
_cogl_pango_pipeline_cache_key_destroy (void *data)
|
||||
{
|
||||
if (data)
|
||||
cogl_object_unref (data);
|
||||
}
|
||||
|
||||
static void
|
||||
_cogl_pango_pipeline_cache_value_destroy (gpointer data)
|
||||
_cogl_pango_pipeline_cache_value_destroy (void *data)
|
||||
{
|
||||
CoglPangoPipelineCacheEntry *cache_entry = data;
|
||||
|
||||
@ -79,7 +79,7 @@ _cogl_pango_pipeline_cache_value_destroy (gpointer data)
|
||||
}
|
||||
|
||||
CoglPangoPipelineCache *
|
||||
_cogl_pango_pipeline_cache_new (gboolean use_mipmapping)
|
||||
_cogl_pango_pipeline_cache_new (CoglBool use_mipmapping)
|
||||
{
|
||||
CoglPangoPipelineCache *cache = g_new (CoglPangoPipelineCache, 1);
|
||||
|
||||
|
@ -36,7 +36,7 @@ G_BEGIN_DECLS
|
||||
typedef struct _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
|
||||
texture. The pipeline has a new reference so it is up to the caller
|
||||
|
@ -30,8 +30,8 @@ G_BEGIN_DECLS
|
||||
|
||||
void _cogl_pango_renderer_clear_glyph_cache (CoglPangoRenderer *renderer);
|
||||
void _cogl_pango_renderer_set_use_mipmapping (CoglPangoRenderer *renderer,
|
||||
gboolean value);
|
||||
gboolean _cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer);
|
||||
CoglBool value);
|
||||
CoglBool _cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -56,7 +56,7 @@ struct _CoglPangoRenderer
|
||||
CoglPangoRendererCaches no_mipmap_caches;
|
||||
CoglPangoRendererCaches mipmap_caches;
|
||||
|
||||
gboolean use_mipmapping;
|
||||
CoglBool use_mipmapping;
|
||||
|
||||
/* The current display list that is being built */
|
||||
CoglPangoDisplayList *display_list;
|
||||
@ -82,7 +82,7 @@ struct _CoglPangoRendererQdata
|
||||
/* Whether mipmapping was previously used to render this layout. We
|
||||
need to regenerate the display list if the mipmapping value is
|
||||
changed because it will be using a different set of textures */
|
||||
gboolean mipmapping_used;
|
||||
CoglBool mipmapping_used;
|
||||
};
|
||||
|
||||
static void
|
||||
@ -446,12 +446,12 @@ _cogl_pango_renderer_clear_glyph_cache (CoglPangoRenderer *renderer)
|
||||
|
||||
void
|
||||
_cogl_pango_renderer_set_use_mipmapping (CoglPangoRenderer *renderer,
|
||||
gboolean value)
|
||||
CoglBool value)
|
||||
{
|
||||
renderer->use_mipmapping = value;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer)
|
||||
{
|
||||
return renderer->use_mipmapping;
|
||||
@ -459,7 +459,7 @@ _cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer)
|
||||
|
||||
static CoglPangoGlyphCacheValue *
|
||||
cogl_pango_renderer_get_cached_glyph (PangoRenderer *renderer,
|
||||
gboolean create,
|
||||
CoglBool create,
|
||||
PangoFont *font,
|
||||
PangoGlyph glyph)
|
||||
{
|
||||
|
@ -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_ensure_glyph_cache_for_layout (PangoLayout *layout);
|
||||
void cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *fm,
|
||||
gboolean value);
|
||||
gboolean cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *fm);
|
||||
CoglBool value);
|
||||
CoglBool cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *fm);
|
||||
PangoRenderer *cogl_pango_font_map_get_renderer (CoglPangoFontMap *fm);
|
||||
|
||||
#define COGL_PANGO_TYPE_RENDERER (cogl_pango_renderer_get_type ())
|
||||
|
@ -76,7 +76,7 @@ void
|
||||
_cogl_atlas_texture_remove_reorganize_callback (GHookFunc callback,
|
||||
void *user_data);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_is_atlas_texture (void *object);
|
||||
|
||||
#endif /* __COGL_ATLAS_TEXTURE_H */
|
||||
|
@ -69,7 +69,7 @@ _cogl_atlas_texture_create_sub_texture (CoglTexture *full_texture,
|
||||
}
|
||||
|
||||
static void
|
||||
_cogl_atlas_texture_update_position_cb (gpointer user_data,
|
||||
_cogl_atlas_texture_update_position_cb (void *user_data,
|
||||
CoglTexture *new_texture,
|
||||
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);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_atlas_texture_is_sliced (CoglTexture *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);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_atlas_texture_can_hardware_repeat (CoglTexture *tex)
|
||||
{
|
||||
CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex);
|
||||
@ -334,7 +334,7 @@ _cogl_atlas_texture_transform_quad_coords_to_gl (CoglTexture *tex,
|
||||
coords);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_atlas_texture_get_gl_texture (CoglTexture *tex,
|
||||
GLuint *out_gl_handle,
|
||||
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);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_atlas_texture_set_region_with_border (CoglAtlasTexture *atlas_tex,
|
||||
int src_x,
|
||||
int src_y,
|
||||
@ -540,7 +540,7 @@ _cogl_atlas_texture_prepare_for_upload (CoglAtlasTexture *atlas_tex,
|
||||
return override_bmp;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_atlas_texture_set_region (CoglTexture *tex,
|
||||
int src_x,
|
||||
int src_y,
|
||||
@ -556,7 +556,7 @@ _cogl_atlas_texture_set_region (CoglTexture *tex,
|
||||
pixels to the border */
|
||||
if (atlas_tex->atlas)
|
||||
{
|
||||
gboolean ret;
|
||||
CoglBool ret;
|
||||
|
||||
bmp = _cogl_atlas_texture_prepare_for_upload (atlas_tex,
|
||||
bmp);
|
||||
@ -619,7 +619,7 @@ _cogl_atlas_texture_get_height (CoglTexture *tex)
|
||||
return cogl_texture_get_height (atlas_tex->sub_texture);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_atlas_texture_can_use_format (CoglPixelFormat format)
|
||||
{
|
||||
/* We don't care about the ordering or the premult status and we can
|
||||
|
@ -280,7 +280,7 @@ _cogl_atlas_create_texture (CoglAtlas *atlas,
|
||||
|
||||
if ((atlas->flags & COGL_ATLAS_CLEAR_TEXTURE))
|
||||
{
|
||||
guint8 *clear_data;
|
||||
uint8_t *clear_data;
|
||||
CoglBitmap *clear_bmp;
|
||||
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);
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_atlas_reserve_space (CoglAtlas *atlas,
|
||||
unsigned int width,
|
||||
unsigned int height,
|
||||
@ -347,7 +347,7 @@ _cogl_atlas_reserve_space (CoglAtlas *atlas,
|
||||
CoglRectangleMap *new_map;
|
||||
CoglTexture2D *new_tex;
|
||||
unsigned int map_width, map_height;
|
||||
gboolean ret;
|
||||
CoglBool ret;
|
||||
CoglRectangleMapEntry new_position;
|
||||
|
||||
/* Check if we can fit the rectangle into the existing map */
|
||||
|
@ -64,7 +64,7 @@ _cogl_atlas_new (CoglPixelFormat texture_format,
|
||||
CoglAtlasFlags flags,
|
||||
CoglAtlasUpdatePositionCallback update_position_cb);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_atlas_reserve_space (CoglAtlas *atlas,
|
||||
unsigned int width,
|
||||
unsigned int height,
|
||||
@ -95,7 +95,7 @@ _cogl_atlas_remove_reorganize_callback (CoglAtlas *atlas,
|
||||
GHookFunc post_callback,
|
||||
void *user_data);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_is_atlas (void *object);
|
||||
|
||||
#endif /* __COGL_ATLAS_H */
|
||||
|
@ -40,11 +40,11 @@ COGL_BUFFER_DEFINE (AttributeBuffer, attribute_buffer);
|
||||
|
||||
CoglAttributeBuffer *
|
||||
cogl_attribute_buffer_new (CoglContext *context,
|
||||
gsize bytes,
|
||||
size_t bytes,
|
||||
const void *data)
|
||||
{
|
||||
CoglAttributeBuffer *array = g_slice_new (CoglAttributeBuffer);
|
||||
gboolean use_malloc;
|
||||
CoglBool use_malloc;
|
||||
|
||||
if (!(context->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS))
|
||||
use_malloc = TRUE;
|
||||
|
@ -68,7 +68,7 @@ G_BEGIN_DECLS
|
||||
*/
|
||||
CoglAttributeBuffer *
|
||||
cogl_attribute_buffer_new (CoglContext *context,
|
||||
gsize bytes,
|
||||
size_t bytes,
|
||||
const void *data);
|
||||
|
||||
/**
|
||||
@ -83,7 +83,7 @@ cogl_attribute_buffer_new (CoglContext *context,
|
||||
* Since: 1.4
|
||||
* Stability: Unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_attribute_buffer (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -46,7 +46,7 @@ typedef struct _CoglAttributeNameState
|
||||
char *name;
|
||||
CoglAttributeNameID name_id;
|
||||
int name_index;
|
||||
gboolean normalized_default;
|
||||
CoglBool normalized_default;
|
||||
int texture_unit;
|
||||
} CoglAttributeNameState;
|
||||
|
||||
@ -56,11 +56,11 @@ struct _CoglAttribute
|
||||
|
||||
CoglAttributeBuffer *attribute_buffer;
|
||||
const CoglAttributeNameState *name_state;
|
||||
gsize stride;
|
||||
gsize offset;
|
||||
size_t stride;
|
||||
size_t offset;
|
||||
int n_components;
|
||||
CoglAttributeType type;
|
||||
gboolean normalized;
|
||||
CoglBool normalized;
|
||||
|
||||
int immutable_ref;
|
||||
};
|
||||
|
@ -59,11 +59,11 @@ static void _cogl_attribute_free (CoglAttribute *attribute);
|
||||
|
||||
COGL_OBJECT_DEFINE (Attribute, attribute);
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
validate_cogl_attribute_name (const char *name,
|
||||
char **real_attribute_name,
|
||||
CoglAttributeNameID *name_id,
|
||||
gboolean *normalized,
|
||||
CoglBool *normalized,
|
||||
int *texture_unit)
|
||||
{
|
||||
name = name + 5; /* skip "cogl_" */
|
||||
@ -161,8 +161,8 @@ error:
|
||||
CoglAttribute *
|
||||
cogl_attribute_new (CoglAttributeBuffer *attribute_buffer,
|
||||
const char *name,
|
||||
gsize stride,
|
||||
gsize offset,
|
||||
size_t stride,
|
||||
size_t offset,
|
||||
int n_components,
|
||||
CoglAttributeType type)
|
||||
{
|
||||
@ -236,7 +236,7 @@ error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_attribute_get_normalized (CoglAttribute *attribute)
|
||||
{
|
||||
_COGL_RETURN_VAL_IF_FAIL (cogl_is_attribute (attribute), FALSE);
|
||||
@ -247,7 +247,7 @@ cogl_attribute_get_normalized (CoglAttribute *attribute)
|
||||
static void
|
||||
warn_about_midscene_changes (void)
|
||||
{
|
||||
static gboolean seen = FALSE;
|
||||
static CoglBool seen = FALSE;
|
||||
if (!seen)
|
||||
{
|
||||
g_warning ("Mid-scene modification of attributes has "
|
||||
@ -258,7 +258,7 @@ warn_about_midscene_changes (void)
|
||||
|
||||
void
|
||||
cogl_attribute_set_normalized (CoglAttribute *attribute,
|
||||
gboolean normalized)
|
||||
CoglBool normalized)
|
||||
{
|
||||
_COGL_RETURN_IF_FAIL (cogl_is_attribute (attribute));
|
||||
|
||||
@ -323,10 +323,10 @@ typedef struct
|
||||
{
|
||||
int unit;
|
||||
CoglPipelineFlushOptions options;
|
||||
guint32 fallback_layers;
|
||||
uint32_t fallback_layers;
|
||||
} ValidateLayerState;
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
validate_layer_cb (CoglPipeline *pipeline,
|
||||
int layer_index,
|
||||
void *user_data)
|
||||
@ -334,7 +334,7 @@ validate_layer_cb (CoglPipeline *pipeline,
|
||||
CoglTexture *texture =
|
||||
cogl_pipeline_get_layer_texture (pipeline, layer_index);
|
||||
ValidateLayerState *state = user_data;
|
||||
gboolean status = TRUE;
|
||||
CoglBool status = TRUE;
|
||||
|
||||
/* invalid textures will be handled correctly in
|
||||
* _cogl_pipeline_flush_layers_gl_state */
|
||||
@ -389,7 +389,7 @@ typedef struct _ForeachChangedBitState
|
||||
CoglPipeline *pipeline;
|
||||
} ForeachChangedBitState;
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
toggle_builtin_attribute_enabled_cb (int bit_num, void *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)
|
||||
{
|
||||
gboolean enabled = _cogl_bitmask_get (state->new_bits, bit_num);
|
||||
CoglBool enabled = _cogl_bitmask_get (state->new_bits, bit_num);
|
||||
GLenum cap;
|
||||
|
||||
switch (bit_num)
|
||||
@ -426,7 +426,7 @@ toggle_builtin_attribute_enabled_cb (int bit_num, void *user_data)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
toggle_texcood_attribute_enabled_cb (int bit_num, void *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)
|
||||
{
|
||||
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) );
|
||||
|
||||
@ -452,11 +452,11 @@ toggle_texcood_attribute_enabled_cb (int bit_num, void *user_data)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
toggle_custom_attribute_enabled_cb (int bit_num, void *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;
|
||||
|
||||
if (enabled)
|
||||
@ -496,7 +496,7 @@ static void
|
||||
setup_generic_attribute (CoglContext *context,
|
||||
CoglPipeline *pipeline,
|
||||
CoglAttribute *attribute,
|
||||
guint8 *base)
|
||||
uint8_t *base)
|
||||
{
|
||||
int name_index = attribute->name_state->name_index;
|
||||
int attrib_location =
|
||||
@ -555,7 +555,7 @@ _cogl_flush_attributes_state (CoglFramebuffer *framebuffer,
|
||||
int n_attributes)
|
||||
{
|
||||
int i;
|
||||
gboolean skip_gl_color = FALSE;
|
||||
CoglBool skip_gl_color = FALSE;
|
||||
CoglPipeline *copy = NULL;
|
||||
int n_tex_coord_attribs = 0;
|
||||
ValidateLayerState layers_state;
|
||||
@ -689,7 +689,7 @@ _cogl_flush_attributes_state (CoglFramebuffer *framebuffer,
|
||||
CoglAttribute *attribute = attributes[i];
|
||||
CoglAttributeBuffer *attribute_buffer;
|
||||
CoglBuffer *buffer;
|
||||
guint8 *base;
|
||||
uint8_t *base;
|
||||
|
||||
attribute_buffer = cogl_attribute_get_buffer (attribute);
|
||||
buffer = COGL_BUFFER (attribute_buffer);
|
||||
|
@ -137,8 +137,8 @@ G_BEGIN_DECLS
|
||||
CoglAttribute *
|
||||
cogl_attribute_new (CoglAttributeBuffer *attribute_buffer,
|
||||
const char *name,
|
||||
gsize stride,
|
||||
gsize offset,
|
||||
size_t stride,
|
||||
size_t offset,
|
||||
int components,
|
||||
CoglAttributeType type);
|
||||
|
||||
@ -162,7 +162,7 @@ cogl_attribute_new (CoglAttributeBuffer *attribute_buffer,
|
||||
*/
|
||||
void
|
||||
cogl_attribute_set_normalized (CoglAttribute *attribute,
|
||||
gboolean normalized);
|
||||
CoglBool normalized);
|
||||
|
||||
/**
|
||||
* cogl_attribute_get_normalized:
|
||||
@ -174,7 +174,7 @@ cogl_attribute_set_normalized (CoglAttribute *attribute,
|
||||
* Stability: unstable
|
||||
* Since: 1.10
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
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,
|
||||
* %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_attribute (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define component_type guint8
|
||||
#define component_type uint8_t
|
||||
/* 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
|
||||
example if we are just doing a swizzle conversion then the inner
|
||||
@ -43,7 +43,7 @@
|
||||
#undef UNPACK_BYTE
|
||||
#undef component_type
|
||||
|
||||
#define component_type guint16
|
||||
#define component_type uint16_t
|
||||
#define UNPACK_BYTE(b) (((b) * 65535 + 127) / 255)
|
||||
#define PACK_BYTE(b) (((b) * 255 + 32767) / 65535)
|
||||
#include "cogl-bitmap-packing.h"
|
||||
@ -54,7 +54,7 @@
|
||||
/* (Un)Premultiplication */
|
||||
|
||||
inline static void
|
||||
_cogl_unpremult_alpha_0 (guint8 *dst)
|
||||
_cogl_unpremult_alpha_0 (uint8_t *dst)
|
||||
{
|
||||
dst[0] = 0;
|
||||
dst[1] = 0;
|
||||
@ -63,9 +63,9 @@ _cogl_unpremult_alpha_0 (guint8 *dst)
|
||||
}
|
||||
|
||||
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[1] = (dst[1] * 255) / alpha;
|
||||
@ -73,9 +73,9 @@ _cogl_unpremult_alpha_last (guint8 *dst)
|
||||
}
|
||||
|
||||
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[2] = (dst[2] * 255) / alpha;
|
||||
@ -93,9 +93,9 @@ _cogl_unpremult_alpha_first (guint8 *dst)
|
||||
} G_STMT_END
|
||||
|
||||
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
|
||||
* code generation with GCC in the past; it shouldn't do any worse in
|
||||
* any case.
|
||||
@ -107,9 +107,9 @@ _cogl_premult_alpha_last (guint8 *dst)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
MULT(dst[1], alpha, t1);
|
||||
@ -130,13 +130,13 @@ _cogl_premult_alpha_first (guint8 *dst)
|
||||
#ifdef COGL_USE_PREMULT_SSE2
|
||||
|
||||
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 */
|
||||
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 };
|
||||
/* 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 };
|
||||
/* 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 */
|
||||
|
||||
static void
|
||||
_cogl_bitmap_premult_unpacked_span_guint8 (guint8 *data,
|
||||
_cogl_bitmap_premult_unpacked_span_uint8_t (uint8_t *data,
|
||||
int width)
|
||||
{
|
||||
#ifdef COGL_USE_PREMULT_SSE2
|
||||
@ -231,7 +231,7 @@ _cogl_bitmap_premult_unpacked_span_guint8 (guint8 *data,
|
||||
}
|
||||
|
||||
static void
|
||||
_cogl_bitmap_unpremult_unpacked_span_guint8 (guint8 *data,
|
||||
_cogl_bitmap_unpremult_unpacked_span_uint8_t (uint8_t *data,
|
||||
int width)
|
||||
{
|
||||
int x;
|
||||
@ -247,15 +247,15 @@ _cogl_bitmap_unpremult_unpacked_span_guint8 (guint8 *data,
|
||||
}
|
||||
|
||||
static void
|
||||
_cogl_bitmap_unpremult_unpacked_span_guint16 (guint16 *data,
|
||||
_cogl_bitmap_unpremult_unpacked_span_uint16_t (uint16_t *data,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint16 alpha = data[3];
|
||||
uint16_t alpha = data[3];
|
||||
|
||||
if (alpha == 0)
|
||||
memset (data, 0, sizeof (guint16) * 3);
|
||||
memset (data, 0, sizeof (uint16_t) * 3);
|
||||
else
|
||||
{
|
||||
data[0] = (data[0] * 65535) / alpha;
|
||||
@ -266,12 +266,12 @@ _cogl_bitmap_unpremult_unpacked_span_guint16 (guint16 *data,
|
||||
}
|
||||
|
||||
static void
|
||||
_cogl_bitmap_premult_unpacked_span_guint16 (guint16 *data,
|
||||
_cogl_bitmap_premult_unpacked_span_uint16_t (uint16_t *data,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint16 alpha = data[3];
|
||||
uint16_t alpha = data[3];
|
||||
|
||||
data[0] = (data[0] * 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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
/* 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 ();
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
|
||||
CoglBitmap *dst_bmp)
|
||||
{
|
||||
guint8 *src_data;
|
||||
guint8 *dst_data;
|
||||
guint8 *src;
|
||||
guint8 *dst;
|
||||
void *tmp_row;
|
||||
int src_rowstride;
|
||||
int dst_rowstride;
|
||||
int y;
|
||||
int width, height;
|
||||
CoglPixelFormat src_format;
|
||||
CoglPixelFormat dst_format;
|
||||
gboolean use_16;
|
||||
gboolean need_premult;
|
||||
uint8_t *src_data;
|
||||
uint8_t *dst_data;
|
||||
uint8_t *src;
|
||||
uint8_t *dst;
|
||||
void *tmp_row;
|
||||
int src_rowstride;
|
||||
int dst_rowstride;
|
||||
int y;
|
||||
int width, height;
|
||||
CoglPixelFormat src_format;
|
||||
CoglPixelFormat dst_format;
|
||||
CoglBool use_16;
|
||||
CoglBool need_premult;
|
||||
|
||||
src_format = cogl_bitmap_get_format (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 */
|
||||
tmp_row = g_malloc (width *
|
||||
(use_16 ? sizeof (guint16) : sizeof (guint8)) * 4);
|
||||
(use_16 ? sizeof (uint16_t) : sizeof (uint8_t)) * 4);
|
||||
|
||||
/* FIXME: Optimize */
|
||||
for (y = 0; y < height; y++)
|
||||
@ -430,9 +430,9 @@ _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
|
||||
dst = dst_data + y * dst_rowstride;
|
||||
|
||||
if (use_16)
|
||||
_cogl_unpack_guint16 (src_format, src, tmp_row, width);
|
||||
_cogl_unpack_uint16_t (src_format, src, tmp_row, width);
|
||||
else
|
||||
_cogl_unpack_guint8 (src_format, src, tmp_row, width);
|
||||
_cogl_unpack_uint8_t (src_format, src, tmp_row, width);
|
||||
|
||||
/* Handle premultiplication */
|
||||
if (need_premult)
|
||||
@ -440,23 +440,23 @@ _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
|
||||
if (dst_format & COGL_PREMULT_BIT)
|
||||
{
|
||||
if (use_16)
|
||||
_cogl_bitmap_premult_unpacked_span_guint16 (tmp_row, width);
|
||||
_cogl_bitmap_premult_unpacked_span_uint16_t (tmp_row, width);
|
||||
else
|
||||
_cogl_bitmap_premult_unpacked_span_guint8 (tmp_row, width);
|
||||
_cogl_bitmap_premult_unpacked_span_uint8_t (tmp_row, width);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (use_16)
|
||||
_cogl_bitmap_unpremult_unpacked_span_guint16 (tmp_row, width);
|
||||
_cogl_bitmap_unpremult_unpacked_span_uint16_t (tmp_row, width);
|
||||
else
|
||||
_cogl_bitmap_unpremult_unpacked_span_guint8 (tmp_row, width);
|
||||
_cogl_bitmap_unpremult_unpacked_span_uint8_t (tmp_row, width);
|
||||
}
|
||||
}
|
||||
|
||||
if (use_16)
|
||||
_cogl_pack_guint16 (dst_format, tmp_row, dst, width);
|
||||
_cogl_pack_uint16_t (dst_format, tmp_row, dst, width);
|
||||
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);
|
||||
@ -492,15 +492,15 @@ _cogl_bitmap_convert (CoglBitmap *src_bmp,
|
||||
return dst_bmp;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmap_unpremult (CoglBitmap *bmp)
|
||||
{
|
||||
guint8 *p, *data;
|
||||
guint16 *tmp_row;
|
||||
int x,y;
|
||||
CoglPixelFormat format;
|
||||
int width, height;
|
||||
int rowstride;
|
||||
uint8_t *p, *data;
|
||||
uint16_t *tmp_row;
|
||||
int x,y;
|
||||
CoglPixelFormat format;
|
||||
int width, height;
|
||||
int rowstride;
|
||||
|
||||
format = cogl_bitmap_get_format (bmp);
|
||||
width = cogl_bitmap_get_width (bmp);
|
||||
@ -519,17 +519,17 @@ _cogl_bitmap_unpremult (CoglBitmap *bmp)
|
||||
if (_cogl_bitmap_can_fast_premult (format))
|
||||
tmp_row = NULL;
|
||||
else
|
||||
tmp_row = g_malloc (sizeof (guint16) * 4 * width);
|
||||
tmp_row = g_malloc (sizeof (uint16_t) * 4 * width);
|
||||
|
||||
for (y = 0; y < height; y++)
|
||||
{
|
||||
p = (guint8*) data + y * rowstride;
|
||||
p = (uint8_t*) data + y * rowstride;
|
||||
|
||||
if (tmp_row)
|
||||
{
|
||||
_cogl_unpack_guint16 (format, p, tmp_row, width);
|
||||
_cogl_bitmap_unpremult_unpacked_span_guint16 (tmp_row, width);
|
||||
_cogl_pack_guint16 (format, tmp_row, p, width);
|
||||
_cogl_unpack_uint16_t (format, p, tmp_row, width);
|
||||
_cogl_bitmap_unpremult_unpacked_span_uint16_t (tmp_row, width);
|
||||
_cogl_pack_uint16_t (format, tmp_row, p, width);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -545,7 +545,7 @@ _cogl_bitmap_unpremult (CoglBitmap *bmp)
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmap_premult (CoglBitmap *bmp)
|
||||
{
|
||||
guint8 *p, *data;
|
||||
guint16 *tmp_row;
|
||||
int x,y;
|
||||
CoglPixelFormat format;
|
||||
int width, height;
|
||||
int rowstride;
|
||||
uint8_t *p, *data;
|
||||
uint16_t *tmp_row;
|
||||
int x,y;
|
||||
CoglPixelFormat format;
|
||||
int width, height;
|
||||
int rowstride;
|
||||
|
||||
format = cogl_bitmap_get_format (bmp);
|
||||
width = cogl_bitmap_get_width (bmp);
|
||||
@ -584,17 +584,17 @@ _cogl_bitmap_premult (CoglBitmap *bmp)
|
||||
if (_cogl_bitmap_can_fast_premult (format))
|
||||
tmp_row = NULL;
|
||||
else
|
||||
tmp_row = g_malloc (sizeof (guint16) * 4 * width);
|
||||
tmp_row = g_malloc (sizeof (uint16_t) * 4 * width);
|
||||
|
||||
for (y = 0; y < height; y++)
|
||||
{
|
||||
p = (guint8*) data + y * rowstride;
|
||||
p = (uint8_t*) data + y * rowstride;
|
||||
|
||||
if (tmp_row)
|
||||
{
|
||||
_cogl_unpack_guint16 (format, p, tmp_row, width);
|
||||
_cogl_bitmap_premult_unpacked_span_guint16 (tmp_row, width);
|
||||
_cogl_pack_guint16 (format, tmp_row, p, width);
|
||||
_cogl_unpack_uint16_t (format, p, tmp_row, width);
|
||||
_cogl_bitmap_premult_unpacked_span_uint16_t (tmp_row, width);
|
||||
_cogl_pack_uint16_t (format, tmp_row, p, width);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -607,7 +607,7 @@ _cogl_bitmap_premult (CoglBitmap *bmp)
|
||||
}
|
||||
}
|
||||
else
|
||||
_cogl_bitmap_premult_unpacked_span_guint8 (p, width);
|
||||
_cogl_bitmap_premult_unpacked_span_uint8_t (p, width);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
|
||||
/* 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
|
||||
16-bit path when one of the types in the conversion is > 8 bits per
|
||||
component. */
|
||||
@ -42,7 +42,7 @@
|
||||
511) / 1023)
|
||||
|
||||
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,
|
||||
int width)
|
||||
{
|
||||
@ -58,7 +58,7 @@ G_PASTE (_cogl_unpack_a_8_, component_type) (const guint8 *src,
|
||||
}
|
||||
|
||||
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,
|
||||
int width)
|
||||
{
|
||||
@ -79,7 +79,7 @@ G_PASTE (_cogl_unpack_g_8_, component_type) (const guint8 *src,
|
||||
}
|
||||
|
||||
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,
|
||||
int width)
|
||||
{
|
||||
@ -95,7 +95,7 @@ G_PASTE (_cogl_unpack_rgb_888_, component_type) (const guint8 *src,
|
||||
}
|
||||
|
||||
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,
|
||||
int width)
|
||||
{
|
||||
@ -111,7 +111,7 @@ G_PASTE (_cogl_unpack_bgr_888_, component_type) (const guint8 *src,
|
||||
}
|
||||
|
||||
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,
|
||||
int width)
|
||||
{
|
||||
@ -127,7 +127,7 @@ G_PASTE (_cogl_unpack_bgra_8888_, component_type) (const guint8 *src,
|
||||
}
|
||||
|
||||
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,
|
||||
int width)
|
||||
{
|
||||
@ -143,7 +143,7 @@ G_PASTE (_cogl_unpack_argb_8888_, component_type) (const guint8 *src,
|
||||
}
|
||||
|
||||
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,
|
||||
int width)
|
||||
{
|
||||
@ -159,7 +159,7 @@ G_PASTE (_cogl_unpack_abgr_8888_, component_type) (const guint8 *src,
|
||||
}
|
||||
|
||||
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,
|
||||
int width)
|
||||
{
|
||||
@ -175,13 +175,13 @@ G_PASTE (_cogl_unpack_rgba_8888_, component_type) (const guint8 *src,
|
||||
}
|
||||
|
||||
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,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint16 v = *(const guint16 *) src;
|
||||
uint16_t v = *(const uint16_t *) src;
|
||||
|
||||
dst[0] = UNPACK_5 (v >> 11);
|
||||
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
|
||||
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,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint16 v = *(const guint16 *) src;
|
||||
uint16_t v = *(const uint16_t *) src;
|
||||
|
||||
dst[0] = UNPACK_4 (v >> 12);
|
||||
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
|
||||
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,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint16 v = *(const guint16 *) src;
|
||||
uint16_t v = *(const uint16_t *) src;
|
||||
|
||||
dst[0] = UNPACK_5 (v >> 11);
|
||||
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
|
||||
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,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint32 v = *(const guint32 *) src;
|
||||
uint32_t v = *(const uint32_t *) src;
|
||||
|
||||
dst[0] = UNPACK_10 (v >> 22);
|
||||
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
|
||||
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,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint32 v = *(const guint32 *) src;
|
||||
uint32_t v = *(const uint32_t *) src;
|
||||
|
||||
dst[2] = UNPACK_10 (v >> 22);
|
||||
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
|
||||
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,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint32 v = *(const guint32 *) src;
|
||||
uint32_t v = *(const uint32_t *) src;
|
||||
|
||||
dst[3] = UNPACK_2 (v >> 30);
|
||||
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
|
||||
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,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint32 v = *(const guint32 *) src;
|
||||
uint32_t v = *(const uint32_t *) src;
|
||||
|
||||
dst[3] = UNPACK_2 (v >> 30);
|
||||
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
|
||||
G_PASTE (_cogl_unpack_, component_type) (CoglPixelFormat format,
|
||||
const guint8 *src,
|
||||
const uint8_t *src,
|
||||
component_type *dst,
|
||||
int width)
|
||||
{
|
||||
@ -392,7 +392,7 @@ G_PASTE (_cogl_unpack_, component_type) (CoglPixelFormat format,
|
||||
|
||||
inline static void
|
||||
G_PASTE (_cogl_pack_a_8_, component_type) (const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
@ -405,7 +405,7 @@ G_PASTE (_cogl_pack_a_8_, component_type) (const component_type *src,
|
||||
|
||||
inline static void
|
||||
G_PASTE (_cogl_pack_g_8_, component_type) (const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
/* 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
|
||||
G_PASTE (_cogl_pack_rgb_888_, component_type) (const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
@ -438,7 +438,7 @@ G_PASTE (_cogl_pack_rgb_888_, component_type) (const component_type *src,
|
||||
|
||||
inline static void
|
||||
G_PASTE (_cogl_pack_bgr_888_, component_type) (const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
@ -453,7 +453,7 @@ G_PASTE (_cogl_pack_bgr_888_, component_type) (const component_type *src,
|
||||
|
||||
inline static void
|
||||
G_PASTE (_cogl_pack_bgra_8888_, component_type) (const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
@ -469,7 +469,7 @@ G_PASTE (_cogl_pack_bgra_8888_, component_type) (const component_type *src,
|
||||
|
||||
inline static void
|
||||
G_PASTE (_cogl_pack_argb_8888_, component_type) (const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
@ -485,7 +485,7 @@ G_PASTE (_cogl_pack_argb_8888_, component_type) (const component_type *src,
|
||||
|
||||
inline static void
|
||||
G_PASTE (_cogl_pack_abgr_8888_, component_type) (const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
@ -501,7 +501,7 @@ G_PASTE (_cogl_pack_abgr_8888_, component_type) (const component_type *src,
|
||||
|
||||
inline static void
|
||||
G_PASTE (_cogl_pack_rgba_8888_, component_type) (const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
@ -517,12 +517,12 @@ G_PASTE (_cogl_pack_rgba_8888_, component_type) (const component_type *src,
|
||||
|
||||
inline static void
|
||||
G_PASTE (_cogl_pack_rgb_565_, component_type) (const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint16 *v = (guint16 *) dst;
|
||||
uint16_t *v = (uint16_t *) dst;
|
||||
|
||||
*v = ((PACK_5 (src[0]) << 11) |
|
||||
(PACK_6 (src[1]) << 5) |
|
||||
@ -534,12 +534,12 @@ G_PASTE (_cogl_pack_rgb_565_, component_type) (const component_type *src,
|
||||
|
||||
inline static void
|
||||
G_PASTE (_cogl_pack_rgba_4444_, component_type) (const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint16 *v = (guint16 *) dst;
|
||||
uint16_t *v = (uint16_t *) dst;
|
||||
|
||||
*v = ((PACK_4 (src[0]) << 12) |
|
||||
(PACK_4 (src[1]) << 8) |
|
||||
@ -552,12 +552,12 @@ G_PASTE (_cogl_pack_rgba_4444_, component_type) (const component_type *src,
|
||||
|
||||
inline static void
|
||||
G_PASTE (_cogl_pack_rgba_5551_, component_type) (const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint16 *v = (guint16 *) dst;
|
||||
uint16_t *v = (uint16_t *) dst;
|
||||
|
||||
*v = ((PACK_5 (src[0]) << 11) |
|
||||
(PACK_5 (src[1]) << 6) |
|
||||
@ -570,12 +570,12 @@ G_PASTE (_cogl_pack_rgba_5551_, component_type) (const component_type *src,
|
||||
|
||||
inline static void
|
||||
G_PASTE (_cogl_pack_rgba_1010102_, component_type) (const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint32 *v = (guint32 *) dst;
|
||||
uint32_t *v = (uint32_t *) dst;
|
||||
|
||||
*v = ((PACK_10 (src[0]) << 22) |
|
||||
(PACK_10 (src[1]) << 12) |
|
||||
@ -588,12 +588,12 @@ G_PASTE (_cogl_pack_rgba_1010102_, component_type) (const component_type *src,
|
||||
|
||||
inline static void
|
||||
G_PASTE (_cogl_pack_bgra_1010102_, component_type) (const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint32 *v = (guint32 *) dst;
|
||||
uint32_t *v = (uint32_t *) dst;
|
||||
|
||||
*v = ((PACK_10 (src[2]) << 22) |
|
||||
(PACK_10 (src[1]) << 12) |
|
||||
@ -606,12 +606,12 @@ G_PASTE (_cogl_pack_bgra_1010102_, component_type) (const component_type *src,
|
||||
|
||||
inline static void
|
||||
G_PASTE (_cogl_pack_argb_2101010_, component_type) (const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint32 *v = (guint32 *) dst;
|
||||
uint32_t *v = (uint32_t *) dst;
|
||||
|
||||
*v = ((PACK_2 (src[3]) << 30) |
|
||||
(PACK_10 (src[0]) << 20) |
|
||||
@ -624,12 +624,12 @@ G_PASTE (_cogl_pack_argb_2101010_, component_type) (const component_type *src,
|
||||
|
||||
inline static void
|
||||
G_PASTE (_cogl_pack_abgr_2101010_, component_type) (const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
while (width-- > 0)
|
||||
{
|
||||
guint32 *v = (guint32 *) dst;
|
||||
uint32_t *v = (uint32_t *) dst;
|
||||
|
||||
*v = ((PACK_2 (src[3]) << 30) |
|
||||
(PACK_10 (src[2]) << 20) |
|
||||
@ -651,7 +651,7 @@ G_PASTE (_cogl_pack_abgr_2101010_, component_type) (const component_type *src,
|
||||
inline static void
|
||||
G_PASTE (_cogl_pack_, component_type) (CoglPixelFormat format,
|
||||
const component_type *src,
|
||||
guint8 *dst,
|
||||
uint8_t *dst,
|
||||
int width)
|
||||
{
|
||||
switch (format)
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
#ifdef USE_QUARTZ
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmap_get_size_from_file (const char *filename,
|
||||
int *width,
|
||||
int *height)
|
||||
@ -64,8 +64,8 @@ _cogl_bitmap_from_file (const char *filename,
|
||||
CGImageRef image;
|
||||
int save_errno;
|
||||
CFStringRef type;
|
||||
gsize width, height, rowstride;
|
||||
guint8 *out_data;
|
||||
size_t width, height, rowstride;
|
||||
uint8_t *out_data;
|
||||
CGColorSpaceRef color_space;
|
||||
CGContextRef bitmap_context;
|
||||
CoglBitmap *bmp;
|
||||
@ -159,7 +159,7 @@ _cogl_bitmap_from_file (const char *filename,
|
||||
|
||||
#elif defined(USE_GDKPIXBUF)
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmap_get_size_from_file (const char *filename,
|
||||
int *width,
|
||||
int *height)
|
||||
@ -178,7 +178,7 @@ _cogl_bitmap_from_file (const char *filename,
|
||||
{
|
||||
static CoglUserDataKey pixbuf_key;
|
||||
GdkPixbuf *pixbuf;
|
||||
gboolean has_alpha;
|
||||
CoglBool has_alpha;
|
||||
GdkColorspace color_space;
|
||||
CoglPixelFormat pixel_format;
|
||||
int width;
|
||||
@ -255,7 +255,7 @@ _cogl_bitmap_from_file (const char *filename,
|
||||
|
||||
#include "stb_image.c"
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmap_get_size_from_file (const char *filename,
|
||||
int *width,
|
||||
int *height)
|
||||
@ -278,7 +278,7 @@ _cogl_bitmap_from_file (const char *filename,
|
||||
int stb_pixel_format;
|
||||
int width;
|
||||
int height;
|
||||
guint8 *pixels;
|
||||
uint8_t *pixels;
|
||||
|
||||
_COGL_GET_CONTEXT (ctx, NULL);
|
||||
|
||||
|
@ -71,7 +71,7 @@ CoglBitmap *
|
||||
_cogl_bitmap_convert (CoglBitmap *bmp,
|
||||
CoglPixelFormat dst_format);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
|
||||
CoglBitmap *dst_bmp);
|
||||
|
||||
@ -79,17 +79,17 @@ CoglBitmap *
|
||||
_cogl_bitmap_from_file (const char *filename,
|
||||
GError **error);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmap_unpremult (CoglBitmap *dst_bmp);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmap_premult (CoglBitmap *dst_bmp);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmap_convert_premult_status (CoglBitmap *bmp,
|
||||
CoglPixelFormat dst_format);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmap_copy_subregion (CoglBitmap *src,
|
||||
CoglBitmap *dst,
|
||||
int src_x,
|
||||
@ -103,7 +103,7 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
|
||||
CoglBitmap *
|
||||
_cogl_bitmap_copy (CoglBitmap *src_bmp);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmap_get_size_from_file (const char *filename,
|
||||
int *width,
|
||||
int *height);
|
||||
@ -120,7 +120,7 @@ _cogl_bitmap_set_format (CoglBitmap *bitmap,
|
||||
uploads data using gdk_pixbuf_new_subpixbuf with a sub region
|
||||
containing the last row of the pixbuf because in that case the
|
||||
rowstride can be much larger than the width of the image */
|
||||
guint8 *
|
||||
uint8_t *
|
||||
_cogl_bitmap_map (CoglBitmap *bitmap,
|
||||
CoglBufferAccess access,
|
||||
CoglBufferMapHint hints);
|
||||
@ -134,7 +134,7 @@ _cogl_bitmap_unmap (CoglBitmap *bitmap);
|
||||
was created with new_from_buffer but it will however be good to
|
||||
pass to glTexImage2D for example. The access should be READ for
|
||||
unpacking and WRITE for packing. It can not be both */
|
||||
guint8 *
|
||||
uint8_t *
|
||||
_cogl_bitmap_bind (CoglBitmap *bitmap,
|
||||
CoglBufferAccess access,
|
||||
CoglBufferMapHint hints);
|
||||
|
@ -37,28 +37,28 @@
|
||||
|
||||
struct _CoglBitmap
|
||||
{
|
||||
CoglObject _parent;
|
||||
CoglObject _parent;
|
||||
|
||||
/* Pointer back to the context that this bitmap was created with */
|
||||
CoglContext *context;
|
||||
CoglContext *context;
|
||||
|
||||
CoglPixelFormat format;
|
||||
int width;
|
||||
int height;
|
||||
int rowstride;
|
||||
CoglPixelFormat format;
|
||||
int width;
|
||||
int height;
|
||||
int rowstride;
|
||||
|
||||
guint8 *data;
|
||||
uint8_t *data;
|
||||
|
||||
gboolean mapped;
|
||||
gboolean bound;
|
||||
CoglBool mapped;
|
||||
CoglBool bound;
|
||||
|
||||
/* If this is non-null then 'data' is ignored and instead it is
|
||||
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
|
||||
buffer and map will divert to mapping the buffer */
|
||||
CoglBuffer *buffer;
|
||||
CoglBuffer *buffer;
|
||||
};
|
||||
|
||||
static void _cogl_bitmap_free (CoglBitmap *bmp);
|
||||
@ -83,7 +83,7 @@ _cogl_bitmap_free (CoglBitmap *bmp)
|
||||
g_slice_free (CoglBitmap, bmp);
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmap_convert_premult_status (CoglBitmap *bmp,
|
||||
CoglPixelFormat dst_format)
|
||||
{
|
||||
@ -125,7 +125,7 @@ _cogl_bitmap_copy (CoglBitmap *src_bmp)
|
||||
return dst_bmp;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmap_copy_subregion (CoglBitmap *src,
|
||||
CoglBitmap *dst,
|
||||
int src_x,
|
||||
@ -135,11 +135,11 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
guint8 *srcdata;
|
||||
guint8 *dstdata;
|
||||
int bpp;
|
||||
int line;
|
||||
gboolean succeeded = FALSE;
|
||||
uint8_t *srcdata;
|
||||
uint8_t *dstdata;
|
||||
int bpp;
|
||||
int line;
|
||||
CoglBool succeeded = FALSE;
|
||||
|
||||
/* Intended only for fast copies when format is equal! */
|
||||
g_assert ((src->format & ~COGL_PREMULT_BIT) ==
|
||||
@ -172,7 +172,7 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
|
||||
return succeeded;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_bitmap_get_size_from_file (const char *filename,
|
||||
int *width,
|
||||
int *height)
|
||||
@ -186,7 +186,7 @@ cogl_bitmap_new_for_data (CoglContext *context,
|
||||
int height,
|
||||
CoglPixelFormat format,
|
||||
int rowstride,
|
||||
guint8 *data)
|
||||
uint8_t *data)
|
||||
{
|
||||
CoglBitmap *bmp;
|
||||
|
||||
@ -216,7 +216,7 @@ _cogl_bitmap_new_with_malloc_buffer (CoglContext *context,
|
||||
static CoglUserDataKey bitmap_free_key;
|
||||
int bpp = _cogl_pixel_format_get_bytes_per_pixel (format);
|
||||
int rowstride = ((width * bpp) + 3) & ~3;
|
||||
guint8 *data = g_malloc (rowstride * height);
|
||||
uint8_t *data = g_malloc (rowstride * height);
|
||||
CoglBitmap *bitmap;
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
guint8 *
|
||||
uint8_t *
|
||||
_cogl_bitmap_map (CoglBitmap *bitmap,
|
||||
CoglBufferAccess access,
|
||||
CoglBufferMapHint hints)
|
||||
@ -378,7 +378,7 @@ _cogl_bitmap_map (CoglBitmap *bitmap,
|
||||
|
||||
if (bitmap->buffer)
|
||||
{
|
||||
guint8 *data = cogl_buffer_map (bitmap->buffer,
|
||||
uint8_t *data = cogl_buffer_map (bitmap->buffer,
|
||||
access,
|
||||
hints);
|
||||
|
||||
@ -420,12 +420,12 @@ _cogl_bitmap_unmap (CoglBitmap *bitmap)
|
||||
cogl_buffer_unmap (bitmap->buffer);
|
||||
}
|
||||
|
||||
guint8 *
|
||||
uint8_t *
|
||||
_cogl_bitmap_bind (CoglBitmap *bitmap,
|
||||
CoglBufferAccess access,
|
||||
CoglBufferMapHint hints)
|
||||
{
|
||||
guint8 *ptr;
|
||||
uint8_t *ptr;
|
||||
|
||||
/* Divert to another bitmap if this data is shared */
|
||||
if (bitmap->shared_bmp)
|
||||
@ -437,7 +437,7 @@ _cogl_bitmap_bind (CoglBitmap *bitmap,
|
||||
implementation of bind is the same as map */
|
||||
if (bitmap->buffer == NULL)
|
||||
{
|
||||
guint8 *data = _cogl_bitmap_map (bitmap, access, hints);
|
||||
uint8_t *data = _cogl_bitmap_map (bitmap, access, hints);
|
||||
if (data)
|
||||
bitmap->bound = TRUE;
|
||||
return data;
|
||||
|
@ -155,7 +155,7 @@ cogl_bitmap_new_for_data (CoglContext *context,
|
||||
int height,
|
||||
CoglPixelFormat format,
|
||||
int rowstride,
|
||||
guint8 *data);
|
||||
uint8_t *data);
|
||||
|
||||
/**
|
||||
* cogl_bitmap_get_format:
|
||||
@ -232,7 +232,7 @@ cogl_bitmap_get_buffer (CoglBitmap *bitmap);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_bitmap_get_size_from_file (const char *filename,
|
||||
int *width,
|
||||
int *height);
|
||||
@ -248,7 +248,7 @@ cogl_bitmap_get_size_from_file (const char *filename,
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_bitmap (void *object);
|
||||
|
||||
/**
|
||||
|
@ -49,7 +49,7 @@ _COGL_STATIC_ASSERT (sizeof (unsigned long) <= sizeof (void *),
|
||||
#define BIT_MASK(bit_num) \
|
||||
(1UL << BIT_INDEX (bit_num))
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmask_get_from_array (const CoglBitmask *bitmask,
|
||||
unsigned int bit_num)
|
||||
{
|
||||
@ -83,7 +83,7 @@ _cogl_bitmask_convert_to_array (CoglBitmask *bitmask)
|
||||
void
|
||||
_cogl_bitmask_set_in_array (CoglBitmask *bitmask,
|
||||
unsigned int bit_num,
|
||||
gboolean value)
|
||||
CoglBool value)
|
||||
{
|
||||
GArray *array;
|
||||
unsigned int array_index;
|
||||
@ -147,7 +147,7 @@ _cogl_bitmask_set_bits (CoglBitmask *dst,
|
||||
void
|
||||
_cogl_bitmask_set_range_in_array (CoglBitmask *bitmask,
|
||||
unsigned int n_bits,
|
||||
gboolean value)
|
||||
CoglBool value)
|
||||
{
|
||||
GArray *array;
|
||||
unsigned int array_index, bit_index;
|
||||
|
@ -85,19 +85,19 @@ typedef struct _CoglBitmaskImaginaryType *CoglBitmask;
|
||||
#define _cogl_bitmask_init(bitmask) \
|
||||
G_STMT_START { *(bitmask) = _cogl_bitmask_from_bits (0); } G_STMT_END
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_bitmask_get_from_array (const CoglBitmask *bitmask,
|
||||
unsigned int bit_num);
|
||||
|
||||
void
|
||||
_cogl_bitmask_set_in_array (CoglBitmask *bitmask,
|
||||
unsigned int bit_num,
|
||||
gboolean value);
|
||||
CoglBool value);
|
||||
|
||||
void
|
||||
_cogl_bitmask_set_range_in_array (CoglBitmask *bitmask,
|
||||
unsigned int n_bits,
|
||||
gboolean value);
|
||||
CoglBool value);
|
||||
|
||||
void
|
||||
_cogl_bitmask_clear_all_in_array (CoglBitmask *bitmask);
|
||||
@ -138,7 +138,7 @@ _cogl_bitmask_xor_bits (CoglBitmask *dst,
|
||||
const CoglBitmask *src);
|
||||
|
||||
/* 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:
|
||||
@ -160,7 +160,7 @@ _cogl_bitmask_foreach (const CoglBitmask *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)
|
||||
{
|
||||
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.
|
||||
*/
|
||||
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) ||
|
||||
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
|
||||
_cogl_bitmask_set_range (CoglBitmask *bitmask,
|
||||
unsigned int n_bits,
|
||||
gboolean value)
|
||||
CoglBool value)
|
||||
{
|
||||
if (_cogl_bitmask_has_array (bitmask) ||
|
||||
n_bits > COGL_BITMASK_MAX_DIRECT_BITS)
|
||||
|
@ -158,7 +158,7 @@ _cogl_blend_string_split_rgba_statement (CoglBlendStringStatement *statement,
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
validate_tex_combine_statements (CoglBlendStringStatement *statements,
|
||||
int n_statements,
|
||||
GError **error)
|
||||
@ -204,7 +204,7 @@ error:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
validate_blend_statements (CoglBlendStringStatement *statements,
|
||||
int n_statements,
|
||||
GError **error)
|
||||
@ -283,7 +283,7 @@ error:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
validate_statements_for_context (CoglBlendStringStatement *statements,
|
||||
int n_statements,
|
||||
CoglBlendStringContext context,
|
||||
@ -392,9 +392,9 @@ get_function_info (const char *mark,
|
||||
const char *p,
|
||||
CoglBlendStringContext context)
|
||||
{
|
||||
gsize len = p - mark;
|
||||
size_t len = p - mark;
|
||||
CoglBlendStringFunctionInfo *functions;
|
||||
gsize array_len;
|
||||
size_t array_len;
|
||||
int i;
|
||||
|
||||
if (context == COGL_BLEND_STRING_CONTEXT_BLENDING)
|
||||
@ -422,9 +422,9 @@ get_color_src_info (const char *mark,
|
||||
const char *p,
|
||||
CoglBlendStringContext context)
|
||||
{
|
||||
gsize len = p - mark;
|
||||
size_t len = p - mark;
|
||||
CoglBlendStringColorSourceInfo *sources;
|
||||
gsize array_len;
|
||||
size_t array_len;
|
||||
int i;
|
||||
|
||||
if (context == COGL_BLEND_STRING_CONTEXT_BLENDING)
|
||||
@ -455,19 +455,19 @@ get_color_src_info (const char *mark,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
is_symbol_char (const char c)
|
||||
{
|
||||
return (g_ascii_isalpha (c) || c == '_') ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
is_alphanum_char (const char c)
|
||||
{
|
||||
return (g_ascii_isalnum (c) || c == '_') ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
parse_argument (const char *string, /* original user string */
|
||||
const char **ret_p, /* start of argument IN:OUT */
|
||||
const CoglBlendStringStatement *statement,
|
||||
@ -480,8 +480,8 @@ parse_argument (const char *string, /* original user string */
|
||||
const char *mark = NULL;
|
||||
const char *error_string = NULL;
|
||||
ParserArgState state = PARSER_ARG_STATE_START;
|
||||
gboolean parsing_factor = FALSE;
|
||||
gboolean implicit_factor_brace;
|
||||
CoglBool parsing_factor = FALSE;
|
||||
CoglBool implicit_factor_brace;
|
||||
|
||||
arg->source.is_zero = FALSE;
|
||||
arg->source.info = NULL;
|
||||
@ -597,7 +597,7 @@ parse_argument (const char *string, /* original user string */
|
||||
case PARSER_ARG_STATE_SCRAPING_MASK:
|
||||
if (*p == ']')
|
||||
{
|
||||
gsize len = p - mark;
|
||||
size_t len = p - mark;
|
||||
CoglBlendStringColorSource *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:
|
||||
if (!is_symbol_char (*p))
|
||||
{
|
||||
gsize len = p - mark;
|
||||
size_t len = p - mark;
|
||||
if (len >= strlen ("SRC_ALPHA_SATURATE") &&
|
||||
strncmp (mark, "SRC_ALPHA_SATURATE", len) == 0)
|
||||
{
|
||||
|
@ -65,23 +65,23 @@ typedef struct _CoglBlendStringColorSourceInfo
|
||||
{
|
||||
CoglBlendStringColorSourceType type;
|
||||
const char *name;
|
||||
gsize name_len;
|
||||
size_t name_len;
|
||||
} CoglBlendStringColorSourceInfo;
|
||||
|
||||
typedef struct _CoglBlendStringColorSource
|
||||
{
|
||||
gboolean is_zero;
|
||||
CoglBool is_zero;
|
||||
const CoglBlendStringColorSourceInfo *info;
|
||||
int texture; /* for the TEXTURE_N color source */
|
||||
gboolean one_minus;
|
||||
CoglBool one_minus;
|
||||
CoglBlendStringChannelMask mask;
|
||||
} CoglBlendStringColorSource;
|
||||
|
||||
typedef struct _CoglBlendStringFactor
|
||||
{
|
||||
gboolean is_one;
|
||||
gboolean is_src_alpha_saturate;
|
||||
gboolean is_color;
|
||||
CoglBool is_one;
|
||||
CoglBool is_src_alpha_saturate;
|
||||
CoglBool is_color;
|
||||
CoglBlendStringColorSource source;
|
||||
} CoglBlendStringFactor;
|
||||
|
||||
@ -110,7 +110,7 @@ typedef struct _CoglBlendStringFunctionInfo
|
||||
{
|
||||
enum _CoglBlendStringFunctionType type;
|
||||
const char *name;
|
||||
gsize name_len;
|
||||
size_t name_len;
|
||||
int argc;
|
||||
} CoglBlendStringFunctionInfo;
|
||||
|
||||
@ -122,7 +122,7 @@ typedef struct _CoglBlendStringStatement
|
||||
} CoglBlendStringStatement;
|
||||
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_blend_string_compile (const char *string,
|
||||
CoglBlendStringContext context,
|
||||
CoglBlendStringStatement *statements,
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
static const CoglBlitMode *_cogl_blit_default_mode = NULL;
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_blit_texture_render_begin (CoglBlitData *data)
|
||||
{
|
||||
CoglOffscreen *offscreen;
|
||||
@ -142,7 +142,7 @@ _cogl_blit_texture_render_end (CoglBlitData *data)
|
||||
data->dst_tex);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_blit_framebuffer_begin (CoglBlitData *data)
|
||||
{
|
||||
CoglOffscreen *dst_offscreen = NULL, *src_offscreen = NULL;
|
||||
@ -212,7 +212,7 @@ _cogl_blit_framebuffer_end (CoglBlitData *data)
|
||||
cogl_pop_framebuffer ();
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_blit_copy_tex_sub_image_begin (CoglBlitData *data)
|
||||
{
|
||||
CoglOffscreen *offscreen;
|
||||
@ -264,7 +264,7 @@ _cogl_blit_copy_tex_sub_image_end (CoglBlitData *data)
|
||||
cogl_pop_framebuffer ();
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_blit_get_tex_data_begin (CoglBlitData *data)
|
||||
{
|
||||
data->format = cogl_texture_get_format (data->src_tex);
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
typedef struct _CoglBlitData CoglBlitData;
|
||||
|
||||
typedef gboolean (* CoglBlitBeginFunc) (CoglBlitData *data);
|
||||
typedef CoglBool (* CoglBlitBeginFunc) (CoglBlitData *data);
|
||||
typedef void (* CoglBlitEndFunc) (CoglBlitData *data);
|
||||
|
||||
typedef void (* CoglBlitFunc) (CoglBlitData *data,
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "cogl-boxed-value.h"
|
||||
#include "cogl-context-private.h"
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_boxed_value_equal (const CoglBoxedValue *bva,
|
||||
const CoglBoxedValue *bvb)
|
||||
{
|
||||
@ -109,9 +109,9 @@ _cogl_boxed_value_set_x (CoglBoxedValue *bv,
|
||||
int size,
|
||||
int count,
|
||||
CoglBoxedType type,
|
||||
gsize value_size,
|
||||
gconstpointer value,
|
||||
gboolean transpose)
|
||||
size_t value_size,
|
||||
const void *value,
|
||||
CoglBool transpose)
|
||||
{
|
||||
if (count == 1)
|
||||
{
|
||||
@ -190,7 +190,7 @@ void
|
||||
_cogl_boxed_value_set_matrix (CoglBoxedValue *bv,
|
||||
int dimensions,
|
||||
int count,
|
||||
gboolean transpose,
|
||||
CoglBool transpose,
|
||||
const float *value)
|
||||
{
|
||||
_cogl_boxed_value_set_x (bv,
|
||||
|
@ -39,7 +39,7 @@ typedef struct _CoglBoxedValue
|
||||
{
|
||||
CoglBoxedType type;
|
||||
int size, count;
|
||||
gboolean transpose;
|
||||
CoglBool transpose;
|
||||
|
||||
union {
|
||||
float float_value[4];
|
||||
@ -58,7 +58,7 @@ typedef struct _CoglBoxedValue
|
||||
_bv->count = 1; \
|
||||
} G_STMT_END
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_boxed_value_equal (const CoglBoxedValue *bva,
|
||||
const CoglBoxedValue *bvb);
|
||||
|
||||
@ -86,7 +86,7 @@ void
|
||||
_cogl_boxed_value_set_matrix (CoglBoxedValue *bv,
|
||||
int dimensions,
|
||||
int count,
|
||||
gboolean transpose,
|
||||
CoglBool transpose,
|
||||
const float *value);
|
||||
|
||||
/*
|
||||
|
@ -47,7 +47,7 @@ struct _CoglBufferVtable
|
||||
|
||||
void (* unmap) (CoglBuffer *buffer);
|
||||
|
||||
gboolean (* set_data) (CoglBuffer *buffer,
|
||||
CoglBool (* set_data) (CoglBuffer *buffer,
|
||||
unsigned int offset,
|
||||
const void *data,
|
||||
unsigned int size);
|
||||
@ -78,29 +78,28 @@ typedef enum {
|
||||
|
||||
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 */
|
||||
unsigned int size; /* size of the buffer, in bytes */
|
||||
CoglBufferUsageHint usage_hint;
|
||||
CoglBufferUpdateHint update_hint;
|
||||
GLuint gl_handle; /* OpenGL handle */
|
||||
unsigned int size; /* size of the buffer, in bytes */
|
||||
CoglBufferUsageHint usage_hint;
|
||||
CoglBufferUpdateHint update_hint;
|
||||
|
||||
guint8 *data; /* points to the mapped memory when
|
||||
* the CoglBuffer is a VBO, PBO, ... or
|
||||
* points to allocated memory in the
|
||||
* fallback paths */
|
||||
/* points to the mapped memory when the CoglBuffer is a VBO, PBO,
|
||||
* ... or points to allocated memory in the fallback paths */
|
||||
uint8_t *data;
|
||||
|
||||
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
|
||||
@ -117,7 +116,7 @@ void
|
||||
_cogl_buffer_initialize (CoglBuffer *buffer,
|
||||
CoglContext *context,
|
||||
unsigned int size,
|
||||
gboolean use_malloc,
|
||||
CoglBool use_malloc,
|
||||
CoglBufferBindTarget default_target,
|
||||
CoglBufferUsageHint usage_hint,
|
||||
CoglBufferUpdateHint update_hint);
|
||||
|
@ -84,7 +84,7 @@ _cogl_buffer_register_buffer_type (const CoglObjectClass *klass)
|
||||
_cogl_buffer_types = g_slist_prepend (_cogl_buffer_types, (void *) klass);
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_buffer (void *object)
|
||||
{
|
||||
const CoglObject *obj = object;
|
||||
@ -188,7 +188,7 @@ bo_map (CoglBuffer *buffer,
|
||||
CoglBufferAccess access,
|
||||
CoglBufferMapHint hints)
|
||||
{
|
||||
guint8 *data;
|
||||
uint8_t *data;
|
||||
CoglBufferBindTarget target;
|
||||
GLenum gl_target;
|
||||
CoglContext *ctx = buffer->context;
|
||||
@ -235,7 +235,7 @@ bo_unmap (CoglBuffer *buffer)
|
||||
_cogl_buffer_unbind (buffer);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
bo_set_data (CoglBuffer *buffer,
|
||||
unsigned int offset,
|
||||
const void *data,
|
||||
@ -276,7 +276,7 @@ malloc_unmap (CoglBuffer *buffer)
|
||||
buffer->flags &= ~COGL_BUFFER_FLAG_MAPPED;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
malloc_set_data (CoglBuffer *buffer,
|
||||
unsigned int offset,
|
||||
const void *data,
|
||||
@ -290,7 +290,7 @@ void
|
||||
_cogl_buffer_initialize (CoglBuffer *buffer,
|
||||
CoglContext *context,
|
||||
unsigned int size,
|
||||
gboolean use_malloc,
|
||||
CoglBool use_malloc,
|
||||
CoglBufferBindTarget default_target,
|
||||
CoglBufferUsageHint usage_hint,
|
||||
CoglBufferUpdateHint update_hint)
|
||||
@ -419,7 +419,7 @@ cogl_buffer_get_update_hint (CoglBuffer *buffer)
|
||||
static void
|
||||
warn_about_midscene_changes (void)
|
||||
{
|
||||
static gboolean seen = FALSE;
|
||||
static CoglBool seen = FALSE;
|
||||
if (!seen)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
gboolean
|
||||
cogl_buffer_set_data (CoglBuffer *buffer,
|
||||
gsize offset,
|
||||
const void *data,
|
||||
gsize size)
|
||||
CoglBool
|
||||
cogl_buffer_set_data (CoglBuffer *buffer,
|
||||
size_t offset,
|
||||
const void *data,
|
||||
size_t size)
|
||||
{
|
||||
_COGL_RETURN_VAL_IF_FAIL (cogl_is_buffer (buffer), FALSE);
|
||||
_COGL_RETURN_VAL_IF_FAIL ((offset + size) <= buffer->size, FALSE);
|
||||
|
@ -74,7 +74,7 @@ typedef struct _CoglBuffer CoglBuffer;
|
||||
* Since: 1.2
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_buffer (void *object);
|
||||
|
||||
/**
|
||||
@ -231,11 +231,11 @@ cogl_buffer_unmap (CoglBuffer *buffer);
|
||||
* Since: 1.2
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
cogl_buffer_set_data (CoglBuffer *buffer,
|
||||
gsize offset,
|
||||
const void *data,
|
||||
gsize size);
|
||||
CoglBool
|
||||
cogl_buffer_set_data (CoglBuffer *buffer,
|
||||
size_t offset,
|
||||
const void *data,
|
||||
size_t size);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -211,7 +211,7 @@ add_stencil_clip_rectangle (CoglFramebuffer *framebuffer,
|
||||
float y_1,
|
||||
float x_2,
|
||||
float y_2,
|
||||
gboolean first)
|
||||
CoglBool first)
|
||||
{
|
||||
CoglMatrixStack *modelview_stack =
|
||||
_cogl_framebuffer_get_modelview_stack (framebuffer);
|
||||
@ -287,8 +287,8 @@ add_stencil_clip_silhouette (CoglFramebuffer *framebuffer,
|
||||
float bounds_y1,
|
||||
float bounds_x2,
|
||||
float bounds_y2,
|
||||
gboolean merge,
|
||||
gboolean need_clear,
|
||||
CoglBool merge,
|
||||
CoglBool need_clear,
|
||||
void *user_data)
|
||||
{
|
||||
CoglMatrixStack *modelview_stack =
|
||||
@ -395,8 +395,8 @@ paint_path_silhouette (void *user_data)
|
||||
static void
|
||||
add_stencil_clip_path (CoglFramebuffer *framebuffer,
|
||||
CoglPath *path,
|
||||
gboolean merge,
|
||||
gboolean need_clear)
|
||||
CoglBool merge,
|
||||
CoglBool need_clear)
|
||||
{
|
||||
CoglPathData *data = path->data;
|
||||
add_stencil_clip_silhouette (framebuffer,
|
||||
@ -429,8 +429,8 @@ add_stencil_clip_primitive (CoglFramebuffer *framebuffer,
|
||||
float bounds_y1,
|
||||
float bounds_x2,
|
||||
float bounds_y2,
|
||||
gboolean merge,
|
||||
gboolean need_clear)
|
||||
CoglBool merge,
|
||||
CoglBool need_clear)
|
||||
{
|
||||
add_stencil_clip_silhouette (framebuffer,
|
||||
paint_primitive_silhouette,
|
||||
@ -473,7 +473,7 @@ disable_clip_planes (void)
|
||||
GE( ctx, glDisable (GL_CLIP_PLANE0) );
|
||||
}
|
||||
|
||||
static gpointer
|
||||
static void *
|
||||
_cogl_clip_stack_push_entry (CoglClipStack *clip_stack,
|
||||
size_t size,
|
||||
CoglClipStackType type)
|
||||
@ -797,8 +797,8 @@ _cogl_clip_stack_flush (CoglClipStack *stack,
|
||||
CoglFramebuffer *framebuffer)
|
||||
{
|
||||
int has_clip_planes;
|
||||
gboolean using_clip_planes = FALSE;
|
||||
gboolean using_stencil_buffer = FALSE;
|
||||
CoglBool using_clip_planes = FALSE;
|
||||
CoglBool using_stencil_buffer = FALSE;
|
||||
int scissor_x0;
|
||||
int scissor_y0;
|
||||
int scissor_x1;
|
||||
|
@ -128,7 +128,7 @@ struct _CoglClipStackRect
|
||||
modelview matrix is that same as when a rectangle is added to the
|
||||
journal. In that case we can use the original clip coordinates
|
||||
and modify the rectangle instead. */
|
||||
gboolean can_be_scissor;
|
||||
CoglBool can_be_scissor;
|
||||
|
||||
/* The matrix that was current when the clip was set */
|
||||
CoglMatrix matrix;
|
||||
|
@ -43,13 +43,13 @@
|
||||
#endif
|
||||
#include "cogl-clutter.h"
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_clutter_check_extension (const char *name, const char *ext)
|
||||
{
|
||||
return _cogl_check_extension (name, ext);
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_clutter_winsys_has_feature (CoglWinsysFeature feature)
|
||||
{
|
||||
return _cogl_winsys_has_feature (feature);
|
||||
|
@ -31,11 +31,11 @@
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define cogl_clutter_check_extension cogl_clutter_check_extension_CLUTTER
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_clutter_check_extension (const char *name, const char *ext);
|
||||
|
||||
#define cogl_clutter_winsys_has_feature cogl_clutter_winsys_has_feature_CLUTTER
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_clutter_winsys_has_feature (CoglWinsysFeature feature);
|
||||
|
||||
#define cogl_onscreen_clutter_backend_set_size cogl_onscreen_clutter_backend_set_size_CLUTTER
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
void
|
||||
_cogl_color_get_rgba_4ubv (const CoglColor *color,
|
||||
guint8 *dest);
|
||||
uint8_t *dest);
|
||||
|
||||
#endif /* __COGL_COLOR_PRIVATE_PRIVATE_H */
|
||||
|
||||
|
@ -56,10 +56,10 @@ cogl_color_free (CoglColor *color)
|
||||
|
||||
void
|
||||
cogl_color_init_from_4ub (CoglColor *color,
|
||||
guint8 red,
|
||||
guint8 green,
|
||||
guint8 blue,
|
||||
guint8 alpha)
|
||||
uint8_t red,
|
||||
uint8_t green,
|
||||
uint8_t blue,
|
||||
uint8_t alpha)
|
||||
{
|
||||
_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 */
|
||||
void
|
||||
cogl_color_set_from_4ub (CoglColor *dest,
|
||||
guint8 red,
|
||||
guint8 green,
|
||||
guint8 blue,
|
||||
guint8 alpha)
|
||||
uint8_t red,
|
||||
uint8_t green,
|
||||
uint8_t blue,
|
||||
uint8_t alpha)
|
||||
{
|
||||
cogl_color_init_from_4ub (dest, red, green, blue, alpha);
|
||||
}
|
||||
|
||||
void
|
||||
cogl_color_init_from_4f (CoglColor *color,
|
||||
float red,
|
||||
float green,
|
||||
float blue,
|
||||
float alpha)
|
||||
float red,
|
||||
float green,
|
||||
float blue,
|
||||
float alpha)
|
||||
{
|
||||
_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 */
|
||||
void
|
||||
cogl_color_set_from_4f (CoglColor *color,
|
||||
float red,
|
||||
float green,
|
||||
float blue,
|
||||
float alpha)
|
||||
float red,
|
||||
float green,
|
||||
float blue,
|
||||
float alpha)
|
||||
{
|
||||
cogl_color_init_from_4f (color, red, green, blue, alpha);
|
||||
}
|
||||
@ -220,41 +220,41 @@ cogl_color_set_green_byte (CoglColor *color,
|
||||
|
||||
void
|
||||
cogl_color_set_green_float (CoglColor *color,
|
||||
float green)
|
||||
float green)
|
||||
{
|
||||
color->green = green * 255.0;
|
||||
}
|
||||
|
||||
void
|
||||
cogl_color_set_green (CoglColor *color,
|
||||
float green)
|
||||
float green)
|
||||
{
|
||||
color->green = green * 255.0;
|
||||
}
|
||||
|
||||
void
|
||||
cogl_color_set_blue_byte (CoglColor *color,
|
||||
unsigned char blue)
|
||||
cogl_color_set_blue_byte (CoglColor *color,
|
||||
unsigned char blue)
|
||||
{
|
||||
color->blue = blue;
|
||||
}
|
||||
|
||||
void
|
||||
cogl_color_set_blue_float (CoglColor *color,
|
||||
float blue)
|
||||
float blue)
|
||||
{
|
||||
color->blue = blue * 255.0;
|
||||
}
|
||||
|
||||
void
|
||||
cogl_color_set_blue (CoglColor *color,
|
||||
float blue)
|
||||
float blue)
|
||||
{
|
||||
color->blue = blue * 255.0;
|
||||
}
|
||||
|
||||
void
|
||||
cogl_color_set_alpha_byte (CoglColor *color,
|
||||
cogl_color_set_alpha_byte (CoglColor *color,
|
||||
unsigned char alpha)
|
||||
{
|
||||
color->alpha = alpha;
|
||||
@ -262,14 +262,14 @@ cogl_color_set_alpha_byte (CoglColor *color,
|
||||
|
||||
void
|
||||
cogl_color_set_alpha_float (CoglColor *color,
|
||||
float alpha)
|
||||
float alpha)
|
||||
{
|
||||
color->alpha = alpha * 255.0;
|
||||
}
|
||||
|
||||
void
|
||||
cogl_color_set_alpha (CoglColor *color,
|
||||
float alpha)
|
||||
float alpha)
|
||||
{
|
||||
color->alpha = alpha * 255.0;
|
||||
}
|
||||
@ -293,10 +293,10 @@ cogl_color_unpremultiply (CoglColor *color)
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
cogl_color_equal (gconstpointer v1, gconstpointer v2)
|
||||
CoglBool
|
||||
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 (v2 != NULL, FALSE);
|
||||
@ -307,7 +307,7 @@ cogl_color_equal (gconstpointer v1, gconstpointer v2)
|
||||
|
||||
void
|
||||
_cogl_color_get_rgba_4ubv (const CoglColor *color,
|
||||
guint8 *dest)
|
||||
uint8_t *dest)
|
||||
{
|
||||
memcpy (dest, color, 4);
|
||||
}
|
||||
|
@ -94,10 +94,10 @@ cogl_color_free (CoglColor *color);
|
||||
*/
|
||||
void
|
||||
cogl_color_init_from_4ub (CoglColor *color,
|
||||
guint8 red,
|
||||
guint8 green,
|
||||
guint8 blue,
|
||||
guint8 alpha);
|
||||
uint8_t red,
|
||||
uint8_t green,
|
||||
uint8_t blue,
|
||||
uint8_t alpha);
|
||||
|
||||
/**
|
||||
* cogl_color_set_from_4ub:
|
||||
@ -114,10 +114,10 @@ cogl_color_init_from_4ub (CoglColor *color,
|
||||
*/
|
||||
void
|
||||
cogl_color_set_from_4ub (CoglColor *color,
|
||||
guint8 red,
|
||||
guint8 green,
|
||||
guint8 blue,
|
||||
guint8 alpha);
|
||||
uint8_t red,
|
||||
uint8_t green,
|
||||
uint8_t blue,
|
||||
uint8_t alpha);
|
||||
|
||||
/**
|
||||
* cogl_color_init_from_4f:
|
||||
@ -467,7 +467,7 @@ cogl_color_set_red (CoglColor *color,
|
||||
*/
|
||||
void
|
||||
cogl_color_set_green (CoglColor *color,
|
||||
float green);
|
||||
float green);
|
||||
|
||||
/**
|
||||
* cogl_color_set_blue:
|
||||
@ -480,7 +480,7 @@ cogl_color_set_green (CoglColor *color,
|
||||
*/
|
||||
void
|
||||
cogl_color_set_blue (CoglColor *color,
|
||||
float blue);
|
||||
float blue);
|
||||
|
||||
/**
|
||||
* cogl_color_set_alpha:
|
||||
@ -493,7 +493,7 @@ cogl_color_set_blue (CoglColor *color,
|
||||
*/
|
||||
void
|
||||
cogl_color_set_alpha (CoglColor *color,
|
||||
float alpha);
|
||||
float alpha);
|
||||
|
||||
/**
|
||||
* cogl_color_premultiply:
|
||||
@ -535,9 +535,8 @@ cogl_color_unpremultiply (CoglColor *color);
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
gboolean
|
||||
cogl_color_equal (gconstpointer v1,
|
||||
gconstpointer v2);
|
||||
CoglBool
|
||||
cogl_color_equal (const void *v1, const void *v2);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -84,7 +84,7 @@ _cogl_config_read (void)
|
||||
GKeyFile *key_file = g_key_file_new ();
|
||||
const char * const *system_dirs = g_get_system_config_dirs ();
|
||||
char *filename;
|
||||
gboolean status = FALSE;
|
||||
CoglBool status = FALSE;
|
||||
int i;
|
||||
|
||||
for (i = 0; system_dirs[i]; i++)
|
||||
|
@ -100,7 +100,7 @@ struct _CoglContext
|
||||
CoglBitmask enable_custom_attributes_tmp;
|
||||
CoglBitmask changed_bits_tmp;
|
||||
|
||||
gboolean legacy_backface_culling_enabled;
|
||||
CoglBool legacy_backface_culling_enabled;
|
||||
|
||||
/* A few handy matrix constants */
|
||||
CoglMatrix identity_matrix;
|
||||
@ -154,18 +154,18 @@ struct _CoglContext
|
||||
/* Some simple caching, to minimize state changes... */
|
||||
CoglPipeline *current_pipeline;
|
||||
unsigned long current_pipeline_changes_since_flush;
|
||||
gboolean current_pipeline_skip_gl_color;
|
||||
CoglBool current_pipeline_skip_gl_color;
|
||||
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;
|
||||
gboolean depth_writing_enabled_cache;
|
||||
CoglBool depth_writing_enabled_cache;
|
||||
float depth_range_near_cache;
|
||||
float depth_range_far_cache;
|
||||
|
||||
gboolean legacy_depth_test_enabled;
|
||||
CoglBool legacy_depth_test_enabled;
|
||||
|
||||
CoglBuffer *current_buffer[COGL_BUFFER_BIND_TARGET_COUNT];
|
||||
|
||||
@ -191,7 +191,7 @@ struct _CoglContext
|
||||
CoglIndices *rectangle_short_indices;
|
||||
int rectangle_short_indices_len;
|
||||
|
||||
gboolean in_begin_gl_block;
|
||||
CoglBool in_begin_gl_block;
|
||||
|
||||
CoglPipeline *texture_download_pipeline;
|
||||
CoglPipeline *blit_texture_pipeline;
|
||||
@ -203,7 +203,7 @@ struct _CoglContext
|
||||
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
|
||||
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
|
||||
glGetInteger too often */
|
||||
@ -218,7 +218,7 @@ struct _CoglContext
|
||||
CoglPipelineProgramType current_vertex_program_type;
|
||||
GLuint current_gl_program;
|
||||
|
||||
gboolean current_gl_dither_enabled;
|
||||
CoglBool current_gl_dither_enabled;
|
||||
CoglColorMask current_gl_color_mask;
|
||||
|
||||
/* 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
|
||||
current_clip_stack to mark a dirty state because NULL is a valid
|
||||
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
|
||||
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
|
||||
@ -249,13 +249,13 @@ struct _CoglContext
|
||||
state. If TRUE then any further use of the stencil buffer (such
|
||||
as for drawing paths) would need to be merged with the existing
|
||||
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
|
||||
cogl_buffer_map fails and we only want to map to fill it with new
|
||||
data */
|
||||
GByteArray *buffer_map_fallback_array;
|
||||
gboolean buffer_map_fallback_in_use;
|
||||
CoglBool buffer_map_fallback_in_use;
|
||||
|
||||
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
|
||||
* check whether the GL context is supported by Cogl. If not it should
|
||||
* return FALSE and set @error */
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_context_update_features (CoglContext *context,
|
||||
GError **error);
|
||||
|
||||
|
@ -589,7 +589,7 @@ cogl_egl_context_get_egl_display (CoglContext *context)
|
||||
}
|
||||
#endif
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_context_update_features (CoglContext *context,
|
||||
GError **error)
|
||||
{
|
||||
|
@ -153,7 +153,7 @@ cogl_android_set_native_window (ANativeWindow *window);
|
||||
* Since: 1.10
|
||||
* Stability: Unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_context (void *object);
|
||||
|
||||
#endif /* COGL_ENABLE_EXPERIMENTAL_2_0_API */
|
||||
@ -256,7 +256,7 @@ typedef enum _CoglFeatureID
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_has_feature (CoglContext *context, CoglFeatureID feature);
|
||||
|
||||
/**
|
||||
@ -276,7 +276,7 @@ cogl_has_feature (CoglContext *context, CoglFeatureID feature);
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_has_features (CoglContext *context, ...);
|
||||
|
||||
/**
|
||||
|
@ -89,16 +89,16 @@ GHashTable *_cogl_debug_instances;
|
||||
|
||||
static void
|
||||
_cogl_parse_debug_string_for_keys (const char *value,
|
||||
gboolean enable,
|
||||
CoglBool enable,
|
||||
const GDebugKey *keys,
|
||||
unsigned int nkeys)
|
||||
{
|
||||
int long_num, key_num;
|
||||
|
||||
/* 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
|
||||
longs so we need to build a separate array for each possible
|
||||
guint */
|
||||
mask in an unsigned int but the flags are stored in an array of
|
||||
multiple longs so we need to build a separate array for each
|
||||
possible unsigned int */
|
||||
|
||||
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
|
||||
_cogl_parse_debug_string (const char *value,
|
||||
gboolean enable,
|
||||
gboolean ignore_help)
|
||||
CoglBool enable,
|
||||
CoglBool ignore_help)
|
||||
{
|
||||
if (ignore_help && strcmp (value, "help") == 0)
|
||||
return;
|
||||
@ -197,10 +197,10 @@ _cogl_parse_debug_string (const char *value,
|
||||
}
|
||||
|
||||
#ifdef COGL_ENABLE_DEBUG
|
||||
static gboolean
|
||||
static CoglBool
|
||||
cogl_arg_debug_cb (const char *key,
|
||||
const char *value,
|
||||
gpointer user_data)
|
||||
void *user_data)
|
||||
{
|
||||
_cogl_parse_debug_string (value,
|
||||
TRUE /* enable the flags */,
|
||||
@ -208,10 +208,10 @@ cogl_arg_debug_cb (const char *key,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
cogl_arg_no_debug_cb (const char *key,
|
||||
const char *value,
|
||||
gpointer user_data)
|
||||
void *user_data)
|
||||
{
|
||||
_cogl_parse_debug_string (value,
|
||||
FALSE, /* disable the flags */
|
||||
@ -254,11 +254,11 @@ _cogl_debug_check_environment (void)
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pre_parse_hook (GOptionContext *context,
|
||||
GOptionGroup *group,
|
||||
gpointer data,
|
||||
GError **error)
|
||||
static CoglBool
|
||||
pre_parse_hook (GOptionContext *context,
|
||||
GOptionGroup *group,
|
||||
void *data,
|
||||
GError **error)
|
||||
{
|
||||
_cogl_init ();
|
||||
|
||||
|
@ -126,8 +126,8 @@ _cogl_debug_check_environment (void);
|
||||
|
||||
void
|
||||
_cogl_parse_debug_string (const char *value,
|
||||
gboolean enable,
|
||||
gboolean ignore_help);
|
||||
CoglBool enable,
|
||||
CoglBool ignore_help);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -46,13 +46,13 @@ cogl_depth_state_init (CoglDepthState *state)
|
||||
|
||||
void
|
||||
cogl_depth_state_set_test_enabled (CoglDepthState *state,
|
||||
gboolean enabled)
|
||||
CoglBool enabled)
|
||||
{
|
||||
_COGL_RETURN_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC);
|
||||
state->test_enabled = enabled;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_depth_state_get_test_enabled (CoglDepthState *state)
|
||||
{
|
||||
_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
|
||||
cogl_depth_state_set_write_enabled (CoglDepthState *state,
|
||||
gboolean enabled)
|
||||
CoglBool enabled)
|
||||
{
|
||||
_COGL_RETURN_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC);
|
||||
state->write_enabled = enabled;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_depth_state_get_write_enabled (CoglDepthState *state)
|
||||
{
|
||||
_COGL_RETURN_VAL_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC, FALSE);
|
||||
|
@ -41,24 +41,24 @@ G_BEGIN_DECLS
|
||||
|
||||
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);
|
||||
gboolean COGL_PRIVATE (write_enabled);
|
||||
CoglBool COGL_PRIVATE (write_enabled);
|
||||
float COGL_PRIVATE (range_near);
|
||||
float COGL_PRIVATE (range_far);
|
||||
|
||||
guint32 COGL_PRIVATE (padding0);
|
||||
guint32 COGL_PRIVATE (padding1);
|
||||
guint32 COGL_PRIVATE (padding2);
|
||||
guint32 COGL_PRIVATE (padding3);
|
||||
guint32 COGL_PRIVATE (padding4);
|
||||
guint32 COGL_PRIVATE (padding5);
|
||||
guint32 COGL_PRIVATE (padding6);
|
||||
guint32 COGL_PRIVATE (padding7);
|
||||
guint32 COGL_PRIVATE (padding8);
|
||||
guint32 COGL_PRIVATE (padding9);
|
||||
uint32_t COGL_PRIVATE (padding0);
|
||||
uint32_t COGL_PRIVATE (padding1);
|
||||
uint32_t COGL_PRIVATE (padding2);
|
||||
uint32_t COGL_PRIVATE (padding3);
|
||||
uint32_t COGL_PRIVATE (padding4);
|
||||
uint32_t COGL_PRIVATE (padding5);
|
||||
uint32_t COGL_PRIVATE (padding6);
|
||||
uint32_t COGL_PRIVATE (padding7);
|
||||
uint32_t COGL_PRIVATE (padding8);
|
||||
uint32_t COGL_PRIVATE (padding9);
|
||||
|
||||
} CoglDepthState;
|
||||
|
||||
@ -104,7 +104,7 @@ cogl_depth_state_init (CoglDepthState *state);
|
||||
*/
|
||||
void
|
||||
cogl_depth_state_set_test_enabled (CoglDepthState *state,
|
||||
gboolean enable);
|
||||
CoglBool enable);
|
||||
|
||||
/**
|
||||
* cogl_depth_state_get_test_enabled:
|
||||
@ -117,7 +117,7 @@ cogl_depth_state_set_test_enabled (CoglDepthState *state,
|
||||
* Since: 2.0
|
||||
* Stability: Unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_depth_state_get_test_enabled (CoglDepthState *state);
|
||||
|
||||
/**
|
||||
@ -142,7 +142,7 @@ cogl_depth_state_get_test_enabled (CoglDepthState *state);
|
||||
*/
|
||||
void
|
||||
cogl_depth_state_set_write_enabled (CoglDepthState *state,
|
||||
gboolean enable);
|
||||
CoglBool enable);
|
||||
|
||||
/**
|
||||
* cogl_depth_state_get_write_enabled:
|
||||
@ -155,7 +155,7 @@ cogl_depth_state_set_write_enabled (CoglDepthState *state,
|
||||
* Since: 2.0
|
||||
* Stability: Unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_depth_state_get_write_enabled (CoglDepthState *state);
|
||||
|
||||
/**
|
||||
|
@ -38,7 +38,7 @@ struct _CoglDisplay
|
||||
{
|
||||
CoglObject _parent;
|
||||
|
||||
gboolean setup;
|
||||
CoglBool setup;
|
||||
CoglRenderer *renderer;
|
||||
CoglOnscreenTemplate *onscreen_template;
|
||||
|
||||
|
@ -114,7 +114,7 @@ cogl_display_get_renderer (CoglDisplay *display)
|
||||
return display->renderer;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_display_setup (CoglDisplay *display,
|
||||
GError **error)
|
||||
{
|
||||
|
@ -152,7 +152,7 @@ cogl_display_get_renderer (CoglDisplay *display);
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_display_setup (CoglDisplay *display,
|
||||
GError **error);
|
||||
|
||||
@ -200,7 +200,7 @@ cogl_wayland_display_set_compositor_display (CoglDisplay *display,
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_display (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -30,7 +30,7 @@ typedef struct _CoglDriverVtable CoglDriverVtable;
|
||||
|
||||
struct _CoglDriverVtable
|
||||
{
|
||||
gboolean
|
||||
CoglBool
|
||||
(* pixel_format_from_gl_internal) (CoglContext *context,
|
||||
GLenum gl_int_format,
|
||||
CoglPixelFormat *out_format);
|
||||
@ -42,7 +42,7 @@ struct _CoglDriverVtable
|
||||
GLenum *out_glformat,
|
||||
GLenum *out_gltype);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
(* update_features) (CoglContext *context,
|
||||
GError **error);
|
||||
};
|
||||
|
@ -150,8 +150,8 @@ cogl_euler_init_from_matrix (CoglEuler *euler,
|
||||
euler->roll = R;
|
||||
}
|
||||
|
||||
gboolean
|
||||
cogl_euler_equal (gconstpointer v1, gconstpointer v2)
|
||||
CoglBool
|
||||
cogl_euler_equal (const void *v1, const void *v2)
|
||||
{
|
||||
const CoglEuler *a = v1;
|
||||
const CoglEuler *b = v2;
|
||||
|
@ -218,8 +218,8 @@ cogl_euler_init_from_quaternion (CoglEuler *euler,
|
||||
* Returns: %TRUE if @v1 and @v2 are equal else %FALSE.
|
||||
* Since: 2.0
|
||||
*/
|
||||
gboolean
|
||||
cogl_euler_equal (gconstpointer v1, gconstpointer v2);
|
||||
CoglBool
|
||||
cogl_euler_equal (const void *v1, const void *v2);
|
||||
|
||||
/**
|
||||
* cogl_euler_copy:
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "cogl-feature-private.h"
|
||||
#include "cogl-renderer-private.h"
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_feature_check (CoglRenderer *renderer,
|
||||
const char *driver_prefix,
|
||||
const CoglFeatureData *data,
|
||||
@ -129,7 +129,7 @@ _cogl_feature_check (CoglRenderer *renderer,
|
||||
goto error;
|
||||
|
||||
/* Set the function pointer in the context */
|
||||
*(void **) ((guint8 *) function_table +
|
||||
*(void **) ((uint8_t *) function_table +
|
||||
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 */
|
||||
error:
|
||||
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;
|
||||
|
||||
return FALSE;
|
||||
|
@ -80,7 +80,7 @@ struct _CoglFeatureData
|
||||
const CoglFeatureFunction *functions;
|
||||
};
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_feature_check (CoglRenderer *renderer,
|
||||
const char *driver_prefix,
|
||||
const CoglFeatureData *data,
|
||||
|
@ -188,7 +188,7 @@ static const CoglFixed tan_tbl[] =
|
||||
* The angles are radians in CoglFixed truncated to 16-bit (they're
|
||||
* all less than one)
|
||||
*/
|
||||
static const guint16 atan_tbl[] =
|
||||
static const uint16_t atan_tbl[] =
|
||||
{
|
||||
0x0000, 0x00FF, 0x01FF, 0x02FF, 0x03FF, 0x04FF, 0x05FF, 0x06FF,
|
||||
0x07FF, 0x08FF, 0x09FE, 0x0AFE, 0x0BFD, 0x0CFD, 0x0DFC, 0x0EFB,
|
||||
@ -557,7 +557,7 @@ cogl_angle_tan (CoglAngle angle)
|
||||
CoglFixed
|
||||
cogl_fixed_atan (CoglFixed x)
|
||||
{
|
||||
gboolean negative = FALSE;
|
||||
CoglBool negative = FALSE;
|
||||
CoglFixed angle;
|
||||
|
||||
if (x < 0)
|
||||
@ -744,13 +744,13 @@ cogl_sqrti (int number)
|
||||
* elsewhere in clutter is not good enough, and 10.22 is used instead.
|
||||
*/
|
||||
CoglFixed x;
|
||||
guint32 y_1; /* 10.22 fixed point */
|
||||
guint32 f = 0x600000; /* '1.5' as 10.22 fixed */
|
||||
uint32_t y_1; /* 10.22 fixed point */
|
||||
uint32_t f = 0x600000; /* '1.5' as 10.22 fixed */
|
||||
|
||||
union
|
||||
{
|
||||
float f;
|
||||
guint32 i;
|
||||
uint32_t i;
|
||||
} flt, flt2;
|
||||
|
||||
flt.f = number;
|
||||
@ -824,7 +824,7 @@ cogl_fixed_mul (CoglFixed a,
|
||||
|
||||
return (CoglFixed) res_low;
|
||||
#else
|
||||
gint64 r = (gint64) a * (gint64) b;
|
||||
int64_t r = (int64_t) a * (int64_t) b;
|
||||
|
||||
return (CoglFixed) (r >> COGL_FIXED_Q);
|
||||
#endif
|
||||
@ -834,7 +834,7 @@ CoglFixed
|
||||
cogl_fixed_div (CoglFixed a,
|
||||
CoglFixed b)
|
||||
{
|
||||
return (CoglFixed) ((((gint64) a) << COGL_FIXED_Q) / b);
|
||||
return (CoglFixed) ((((int64_t) a) << COGL_FIXED_Q) / b);
|
||||
}
|
||||
|
||||
CoglFixed
|
||||
@ -902,8 +902,8 @@ cogl_fixed_pow2 (CoglFixed x)
|
||||
|
||||
union
|
||||
{
|
||||
float f;
|
||||
guint32 i;
|
||||
float f;
|
||||
uint32_t i;
|
||||
} flt;
|
||||
|
||||
CoglFixed magic = 0x56f7;
|
||||
@ -999,7 +999,7 @@ cogl_value_lcopy_fixed (const GValue *value,
|
||||
GTypeCValue *collect_values,
|
||||
unsigned int collect_flags)
|
||||
{
|
||||
gint32 *fixed_p = collect_values[0].v_pointer;
|
||||
int32_t *fixed_p = collect_values[0].v_pointer;
|
||||
|
||||
if (!fixed_p)
|
||||
return g_strdup_printf ("value location for '%s' passed as NULL",
|
||||
|
@ -773,7 +773,7 @@ G_INLINE_FUNC CoglFixed
|
||||
cogl_fixed_div (CoglFixed a,
|
||||
CoglFixed b)
|
||||
{
|
||||
return (CoglFixed) ((((gint64) a) << COGL_FIXED_Q) / b);
|
||||
return (CoglFixed) ((((int64_t) a) << COGL_FIXED_Q) / b);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -49,9 +49,9 @@ typedef enum _CoglFramebufferType {
|
||||
typedef struct
|
||||
{
|
||||
CoglSwapChain *swap_chain;
|
||||
gboolean need_stencil;
|
||||
CoglBool need_stencil;
|
||||
int samples_per_pixel;
|
||||
gboolean swap_throttled;
|
||||
CoglBool swap_throttled;
|
||||
} CoglFramebufferConfig;
|
||||
|
||||
/* 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
|
||||
premult state) */
|
||||
CoglPixelFormat format;
|
||||
gboolean allocated;
|
||||
CoglBool allocated;
|
||||
|
||||
CoglMatrixStack *modelview_stack;
|
||||
CoglMatrixStack *projection_stack;
|
||||
@ -128,13 +128,13 @@ struct _CoglFramebuffer
|
||||
|
||||
CoglClipState clip_state;
|
||||
|
||||
gboolean dirty_bitmasks;
|
||||
CoglBool dirty_bitmasks;
|
||||
int red_bits;
|
||||
int blue_bits;
|
||||
int green_bits;
|
||||
int alpha_bits;
|
||||
|
||||
gboolean dither_enabled;
|
||||
CoglBool dither_enabled;
|
||||
CoglColorMask color_mask;
|
||||
|
||||
int samples_per_pixel;
|
||||
@ -162,7 +162,7 @@ struct _CoglFramebuffer
|
||||
int clear_clip_y0;
|
||||
int clear_clip_x1;
|
||||
int clear_clip_y1;
|
||||
gboolean clear_clip_dirty;
|
||||
CoglBool clear_clip_dirty;
|
||||
};
|
||||
|
||||
struct _CoglOffscreen
|
||||
|
@ -146,7 +146,7 @@ cogl_framebuffer_error_quark (void)
|
||||
return g_quark_from_static_string ("cogl-framebuffer-error-quark");
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_framebuffer (void *object)
|
||||
{
|
||||
CoglObject *obj = object;
|
||||
@ -302,7 +302,7 @@ _cogl_framebuffer_clear_without_flush4f (CoglFramebuffer *framebuffer,
|
||||
|
||||
if (!gl_buffers)
|
||||
{
|
||||
static gboolean shown = FALSE;
|
||||
static CoglBool shown = FALSE;
|
||||
|
||||
if (!shown)
|
||||
{
|
||||
@ -817,7 +817,7 @@ _cogl_offscreen_free (CoglOffscreen *offscreen)
|
||||
g_free (offscreen);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
try_creating_fbo (CoglOffscreen *offscreen,
|
||||
TryFBOFlags flags)
|
||||
{
|
||||
@ -993,15 +993,15 @@ try_creating_fbo (CoglOffscreen *offscreen,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_offscreen_allocate (CoglOffscreen *offscreen,
|
||||
GError **error)
|
||||
{
|
||||
CoglFramebuffer *fb = COGL_FRAMEBUFFER (offscreen);
|
||||
CoglContext *ctx = fb->context;
|
||||
static TryFBOFlags flags;
|
||||
static gboolean have_working_flags = FALSE;
|
||||
gboolean fbo_created;
|
||||
static CoglBool have_working_flags = FALSE;
|
||||
CoglBool fbo_created;
|
||||
|
||||
/* XXX: The framebuffer_object spec isn't clear in defining whether attaching
|
||||
* a texture as a renderbuffer with mipmap filtering enabled while the
|
||||
@ -1052,7 +1052,7 @@ _cogl_offscreen_allocate (CoglOffscreen *offscreen,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
|
||||
GError **error)
|
||||
{
|
||||
@ -1769,7 +1769,7 @@ cogl_framebuffer_set_color_mask (CoglFramebuffer *framebuffer,
|
||||
COGL_FRAMEBUFFER_STATE_COLOR_MASK;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer)
|
||||
{
|
||||
return framebuffer->dither_enabled;
|
||||
@ -1777,7 +1777,7 @@ cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer)
|
||||
|
||||
void
|
||||
cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer,
|
||||
gboolean dither_enabled)
|
||||
CoglBool dither_enabled)
|
||||
{
|
||||
if (framebuffer->dither_enabled == dither_enabled)
|
||||
return;
|
||||
@ -1868,14 +1868,14 @@ cogl_framebuffer_get_context (CoglFramebuffer *framebuffer)
|
||||
return framebuffer->context;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_framebuffer_try_fast_read_pixel (CoglFramebuffer *framebuffer,
|
||||
int x,
|
||||
int y,
|
||||
CoglReadPixelsFlags source,
|
||||
CoglBitmap *bitmap)
|
||||
{
|
||||
gboolean found_intersection;
|
||||
CoglBool found_intersection;
|
||||
CoglPixelFormat format;
|
||||
|
||||
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_y1)
|
||||
{
|
||||
guint8 *pixel;
|
||||
uint8_t *pixel;
|
||||
|
||||
/* we currently only care about cases where the premultiplied or
|
||||
* unpremultipled colors are equivalent... */
|
||||
@ -1942,7 +1942,7 @@ _cogl_framebuffer_try_fast_read_pixel (CoglFramebuffer *framebuffer,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_framebuffer_slow_read_pixels_workaround (CoglFramebuffer *framebuffer,
|
||||
int x,
|
||||
int y,
|
||||
@ -1954,7 +1954,7 @@ _cogl_framebuffer_slow_read_pixels_workaround (CoglFramebuffer *framebuffer,
|
||||
CoglBitmap *pbo;
|
||||
int width;
|
||||
int height;
|
||||
gboolean res;
|
||||
CoglBool res;
|
||||
|
||||
_COGL_RETURN_VAL_IF_FAIL (source & COGL_READ_PIXELS_COLOR_BUFFER, 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)
|
||||
{
|
||||
guint8 *dst;
|
||||
uint8_t *dst;
|
||||
|
||||
/* Copy the pixels back into application's buffer */
|
||||
dst = _cogl_bitmap_map (bitmap,
|
||||
@ -1991,7 +1991,7 @@ _cogl_framebuffer_slow_read_pixels_workaround (CoglFramebuffer *framebuffer,
|
||||
res = FALSE;
|
||||
else
|
||||
{
|
||||
const guint8 *src;
|
||||
const uint8_t *src;
|
||||
|
||||
src = _cogl_bitmap_map (pbo,
|
||||
COGL_BUFFER_ACCESS_READ,
|
||||
@ -2033,7 +2033,7 @@ _cogl_framebuffer_slow_read_pixels_workaround (CoglFramebuffer *framebuffer,
|
||||
return res;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
|
||||
int x,
|
||||
int y,
|
||||
@ -2047,7 +2047,7 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
|
||||
GLenum gl_intformat;
|
||||
GLenum gl_format;
|
||||
GLenum gl_type;
|
||||
gboolean pack_invert_set;
|
||||
CoglBool pack_invert_set;
|
||||
int width;
|
||||
int height;
|
||||
|
||||
@ -2160,7 +2160,7 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
|
||||
CoglBitmap *tmp_bmp;
|
||||
CoglPixelFormat read_format;
|
||||
int bpp, rowstride;
|
||||
guint8 *tmp_data;
|
||||
uint8_t *tmp_data;
|
||||
int succeeded;
|
||||
|
||||
if (ctx->driver == COGL_DRIVER_GL)
|
||||
@ -2209,8 +2209,8 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
|
||||
CoglBitmap *shared_bmp;
|
||||
CoglPixelFormat bmp_format;
|
||||
int bpp, rowstride;
|
||||
gboolean succeeded = FALSE;
|
||||
guint8 *pixels;
|
||||
CoglBool succeeded = FALSE;
|
||||
uint8_t *pixels;
|
||||
|
||||
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 &&
|
||||
!pack_invert_set)
|
||||
{
|
||||
guint8 *temprow;
|
||||
uint8_t *temprow;
|
||||
int rowstride;
|
||||
guint8 *pixels;
|
||||
uint8_t *pixels;
|
||||
|
||||
rowstride = cogl_bitmap_get_rowstride (bitmap);
|
||||
pixels = _cogl_bitmap_map (bitmap,
|
||||
@ -2286,7 +2286,7 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
|
||||
if (pixels == NULL)
|
||||
return FALSE;
|
||||
|
||||
temprow = g_alloca (rowstride * sizeof (guint8));
|
||||
temprow = g_alloca (rowstride * sizeof (uint8_t));
|
||||
|
||||
/* vertically flip the buffer in-place */
|
||||
for (y = 0; y < height / 2; y++)
|
||||
@ -2309,18 +2309,18 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_framebuffer_read_pixels (CoglFramebuffer *framebuffer,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
CoglPixelFormat format,
|
||||
guint8 *pixels)
|
||||
uint8_t *pixels)
|
||||
{
|
||||
int bpp = _cogl_pixel_format_get_bytes_per_pixel (format);
|
||||
CoglBitmap *bitmap;
|
||||
gboolean ret;
|
||||
CoglBool ret;
|
||||
|
||||
bitmap = cogl_bitmap_new_for_data (framebuffer->context,
|
||||
width, height,
|
||||
@ -2855,18 +2855,18 @@ get_index (void *indices,
|
||||
switch (type)
|
||||
{
|
||||
case COGL_INDICES_TYPE_UNSIGNED_BYTE:
|
||||
return ((guint8 *)indices)[_index];
|
||||
return ((uint8_t *)indices)[_index];
|
||||
case COGL_INDICES_TYPE_UNSIGNED_SHORT:
|
||||
return ((guint16 *)indices)[_index];
|
||||
return ((uint16_t *)indices)[_index];
|
||||
case COGL_INDICES_TYPE_UNSIGNED_INT:
|
||||
return ((guint32 *)indices)[_index];
|
||||
return ((uint32_t *)indices)[_index];
|
||||
}
|
||||
|
||||
g_return_val_if_reached (0);
|
||||
}
|
||||
|
||||
static void
|
||||
add_line (guint32 *line_indices,
|
||||
add_line (uint32_t *line_indices,
|
||||
int base,
|
||||
void *user_indices,
|
||||
CoglIndicesType user_indices_type,
|
||||
@ -2920,7 +2920,7 @@ get_wire_line_indices (CoglContext *ctx,
|
||||
int *n_indices)
|
||||
{
|
||||
int n_lines;
|
||||
guint32 *line_indices;
|
||||
uint32_t *line_indices;
|
||||
CoglIndexBuffer *index_buffer;
|
||||
void *indices;
|
||||
CoglIndicesType indices_type;
|
||||
@ -3020,7 +3020,7 @@ get_wire_line_indices (CoglContext *ctx,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
remove_layer_cb (CoglPipeline *pipeline,
|
||||
int layer_index,
|
||||
void *user_data)
|
||||
@ -3247,7 +3247,7 @@ _cogl_framebuffer_draw_indexed_attributes (CoglFramebuffer *framebuffer,
|
||||
#endif
|
||||
{
|
||||
CoglBuffer *buffer;
|
||||
guint8 *base;
|
||||
uint8_t *base;
|
||||
size_t buffer_offset;
|
||||
size_t index_size;
|
||||
GLenum indices_gl_type = 0;
|
||||
|
@ -110,7 +110,7 @@ typedef struct _CoglFramebuffer CoglFramebuffer;
|
||||
* Since: 1.8
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
|
||||
GError **error);
|
||||
|
||||
@ -697,7 +697,7 @@ cogl_framebuffer_get_alpha_bits (CoglFramebuffer *framebuffer);
|
||||
* Since: 1.8
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer);
|
||||
|
||||
/**
|
||||
@ -724,7 +724,7 @@ cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer);
|
||||
*/
|
||||
void
|
||||
cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer,
|
||||
gboolean dither_enabled);
|
||||
CoglBool dither_enabled);
|
||||
|
||||
/**
|
||||
* cogl_framebuffer_get_color_mask:
|
||||
@ -1570,7 +1570,7 @@ cogl_framebuffer_finish (CoglFramebuffer *framebuffer);
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
|
||||
int x,
|
||||
int y,
|
||||
@ -1616,14 +1616,14 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_framebuffer_read_pixels (CoglFramebuffer *framebuffer,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
CoglPixelFormat format,
|
||||
guint8 *pixels);
|
||||
uint8_t *pixels);
|
||||
|
||||
/**
|
||||
* cogl_get_draw_framebuffer:
|
||||
@ -1668,7 +1668,7 @@ typedef enum { /*< prefix=COGL_FRAMEBUFFER_ERROR >*/
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_framebuffer (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -36,10 +36,10 @@ typedef struct _CoglGLibSource
|
||||
|
||||
GArray *poll_fds;
|
||||
|
||||
gint64 expiration_time;
|
||||
int64_t expiration_time;
|
||||
} CoglGLibSource;
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
cogl_glib_source_poll_fds_changed (CoglGLibSource *cogl_source,
|
||||
const CoglPollFD *poll_fds,
|
||||
int n_poll_fds)
|
||||
@ -57,13 +57,13 @@ cogl_glib_source_poll_fds_changed (CoglGLibSource *cogl_source,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
cogl_glib_source_prepare (GSource *source, int *timeout)
|
||||
{
|
||||
CoglGLibSource *cogl_source = (CoglGLibSource *) source;
|
||||
CoglPollFD *poll_fds;
|
||||
int n_poll_fds;
|
||||
gint64 cogl_timeout;
|
||||
int64_t cogl_timeout;
|
||||
int i;
|
||||
|
||||
cogl_poll_get_info (cogl_source->context,
|
||||
@ -118,7 +118,7 @@ cogl_glib_source_prepare (GSource *source, int *timeout)
|
||||
return *timeout == 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
cogl_glib_source_check (GSource *source)
|
||||
{
|
||||
CoglGLibSource *cogl_source = (CoglGLibSource *) source;
|
||||
@ -138,7 +138,7 @@ cogl_glib_source_check (GSource *source)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
cogl_glib_source_dispatch (GSource *source,
|
||||
GSourceFunc callback,
|
||||
void *user_data)
|
||||
|
@ -31,9 +31,9 @@ typedef struct _CoglGLXCachedConfig
|
||||
{
|
||||
/* This will be -1 if there is no cached config in this slot */
|
||||
int depth;
|
||||
gboolean found;
|
||||
CoglBool found;
|
||||
GLXFBConfig fb_config;
|
||||
gboolean can_mipmap;
|
||||
CoglBool can_mipmap;
|
||||
} CoglGLXCachedConfig;
|
||||
|
||||
#define COGL_GLX_N_CACHED_CONFIGS 3
|
||||
@ -42,15 +42,15 @@ typedef struct _CoglGLXDisplay
|
||||
{
|
||||
CoglGLXCachedConfig glx_cached_configs[COGL_GLX_N_CACHED_CONFIGS];
|
||||
|
||||
gboolean found_fbconfig;
|
||||
gboolean fbconfig_has_rgba_visual;
|
||||
CoglBool found_fbconfig;
|
||||
CoglBool fbconfig_has_rgba_visual;
|
||||
GLXFBConfig fbconfig;
|
||||
|
||||
/* Single context for all wins */
|
||||
GLXContext glx_context;
|
||||
GLXWindow dummy_glxwin;
|
||||
Window dummy_xwin;
|
||||
gboolean pending_swap_notify;
|
||||
CoglBool pending_swap_notify;
|
||||
} CoglGLXDisplay;
|
||||
|
||||
#endif /* __COGL_DISPLAY_GLX_PRIVATE_H */
|
||||
|
@ -37,7 +37,7 @@ typedef struct _CoglGLXRenderer
|
||||
int glx_error_base;
|
||||
int glx_event_base;
|
||||
|
||||
gboolean is_direct;
|
||||
CoglBool is_direct;
|
||||
|
||||
/* Vblank stuff */
|
||||
int dri_fd;
|
||||
|
@ -43,25 +43,25 @@ typedef struct
|
||||
{
|
||||
CoglGpuInfoVendor vendor;
|
||||
const char *name;
|
||||
gboolean (* check_function) (const CoglGpuInfoStrings *strings);
|
||||
CoglBool (* check_function) (const CoglGpuInfoStrings *strings);
|
||||
} CoglGpuInfoVendorDescription;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CoglGpuInfoDriverPackage driver_package;
|
||||
const char *name;
|
||||
gboolean (* check_function) (const CoglGpuInfoStrings *strings,
|
||||
CoglBool (* check_function) (const CoglGpuInfoStrings *strings,
|
||||
int *version_out);
|
||||
} CoglGpuInfoDriverPackageDescription;
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_gpu_info_parse_version_string (const char *version_string,
|
||||
int n_components,
|
||||
const char **tail,
|
||||
int *version_ret)
|
||||
{
|
||||
int version = 0;
|
||||
guint64 part;
|
||||
uint64_t part;
|
||||
int i;
|
||||
|
||||
for (i = 0; ; i++)
|
||||
@ -93,7 +93,7 @@ _cogl_gpu_info_parse_version_string (const char *version_string,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
check_intel_vendor (const CoglGpuInfoStrings *strings)
|
||||
{
|
||||
const char *intel_part = strstr (strings->renderer_string, "Intel(R)");
|
||||
@ -110,7 +110,7 @@ check_intel_vendor (const CoglGpuInfoStrings *strings)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
check_unknown_vendor (const CoglGpuInfoStrings *strings)
|
||||
{
|
||||
/* 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,
|
||||
int *version_ret)
|
||||
{
|
||||
guint64 micro_part;
|
||||
uint64_t micro_part;
|
||||
const char *v;
|
||||
|
||||
/* The version string should always begin a two-part GL version
|
||||
@ -184,7 +184,7 @@ check_mesa_driver_package (const CoglGpuInfoStrings *strings,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
check_unknown_driver_package (const CoglGpuInfoStrings *strings,
|
||||
int *version_out)
|
||||
{
|
||||
|
@ -32,7 +32,7 @@
|
||||
GType \
|
||||
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)) \
|
||||
{ \
|
||||
GType type = \
|
||||
|
@ -42,10 +42,10 @@ COGL_BUFFER_DEFINE (IndexBuffer, index_buffer);
|
||||
* indices buffer should be able to contain multiple ranges of indices
|
||||
* which the wiki design doesn't currently consider. */
|
||||
CoglIndexBuffer *
|
||||
cogl_index_buffer_new (CoglContext *context, gsize bytes)
|
||||
cogl_index_buffer_new (CoglContext *context, size_t bytes)
|
||||
{
|
||||
CoglIndexBuffer *indices = g_slice_new (CoglIndexBuffer);
|
||||
gboolean use_malloc;
|
||||
CoglBool use_malloc;
|
||||
|
||||
if (!(context->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS))
|
||||
use_malloc = TRUE;
|
||||
@ -95,7 +95,7 @@ void
|
||||
cogl_index_buffer_set_data (CoglIndexBuffer *indices,
|
||||
CoglIndicesType type,
|
||||
int max_index_value,
|
||||
gsize write_offset,
|
||||
size_t write_offset,
|
||||
void *user_indices,
|
||||
int n_indices)
|
||||
{
|
||||
|
@ -62,7 +62,7 @@ typedef struct _CoglIndexBuffer CoglIndexBuffer;
|
||||
*/
|
||||
CoglIndexBuffer *
|
||||
cogl_index_buffer_new (CoglContext *context,
|
||||
gsize bytes);
|
||||
size_t bytes);
|
||||
|
||||
/**
|
||||
* cogl_is_index_buffer:
|
||||
@ -76,7 +76,7 @@ cogl_index_buffer_new (CoglContext *context,
|
||||
* Since: 1.4
|
||||
* Stability: Unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_index_buffer (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -61,7 +61,7 @@ sizeof_indices_type (CoglIndicesType type)
|
||||
CoglIndices *
|
||||
cogl_indices_new_for_buffer (CoglIndicesType type,
|
||||
CoglIndexBuffer *buffer,
|
||||
gsize offset)
|
||||
size_t offset)
|
||||
{
|
||||
CoglIndices *indices = g_slice_new (CoglIndices);
|
||||
|
||||
@ -111,7 +111,7 @@ cogl_indices_get_type (CoglIndices *indices)
|
||||
return indices->type;
|
||||
}
|
||||
|
||||
gsize
|
||||
size_t
|
||||
cogl_indices_get_offset (CoglIndices *indices)
|
||||
{
|
||||
_COGL_RETURN_VAL_IF_FAIL (cogl_is_indices (indices), 0);
|
||||
@ -122,7 +122,7 @@ cogl_indices_get_offset (CoglIndices *indices)
|
||||
static void
|
||||
warn_about_midscene_changes (void)
|
||||
{
|
||||
static gboolean seen = FALSE;
|
||||
static CoglBool seen = FALSE;
|
||||
if (!seen)
|
||||
{
|
||||
g_warning ("Mid-scene modification of indices has "
|
||||
@ -133,7 +133,7 @@ warn_about_midscene_changes (void)
|
||||
|
||||
void
|
||||
cogl_indices_set_offset (CoglIndices *indices,
|
||||
gsize offset)
|
||||
size_t offset)
|
||||
{
|
||||
_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 */
|
||||
if (ctx->rectangle_byte_indices == NULL)
|
||||
{
|
||||
guint8 *byte_array = g_malloc (256 / 4 * 6 * sizeof (guint8));
|
||||
guint8 *p = byte_array;
|
||||
uint8_t *byte_array = g_malloc (256 / 4 * 6 * sizeof (uint8_t));
|
||||
uint8_t *p = byte_array;
|
||||
int i, vert_num = 0;
|
||||
|
||||
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)
|
||||
{
|
||||
guint16 *short_array;
|
||||
guint16 *p;
|
||||
uint16_t *short_array;
|
||||
uint16_t *p;
|
||||
int i, vert_num = 0;
|
||||
|
||||
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 */
|
||||
p = short_array = g_malloc ((ctx->rectangle_short_indices_len
|
||||
+ 5) / 6 * 6
|
||||
* sizeof (guint16));
|
||||
* sizeof (uint16_t));
|
||||
|
||||
/* Fill in the complete quads */
|
||||
for (i = 0; i < ctx->rectangle_short_indices_len; i += 6)
|
||||
|
@ -108,7 +108,7 @@ cogl_indices_new (CoglContext *context,
|
||||
CoglIndices *
|
||||
cogl_indices_new_for_buffer (CoglIndicesType type,
|
||||
CoglIndexBuffer *buffer,
|
||||
gsize offset);
|
||||
size_t offset);
|
||||
|
||||
CoglIndexBuffer *
|
||||
cogl_indices_get_buffer (CoglIndices *indices);
|
||||
@ -116,12 +116,12 @@ cogl_indices_get_buffer (CoglIndices *indices);
|
||||
CoglIndicesType
|
||||
cogl_indices_get_type (CoglIndices *indices);
|
||||
|
||||
gsize
|
||||
size_t
|
||||
cogl_indices_get_offset (CoglIndices *indices);
|
||||
|
||||
void
|
||||
cogl_indices_set_offset (CoglIndices *indices,
|
||||
gsize offset);
|
||||
size_t offset);
|
||||
|
||||
CoglIndices *
|
||||
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
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_indices (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -115,7 +115,7 @@ typedef enum _CoglPipelineEvalFlags
|
||||
COGL_PIPELINE_EVAL_FLAG_NONE = 0
|
||||
} CoglPipelineEvalFlags;
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_check_extension (const char *name, const char *ext);
|
||||
|
||||
GQuark
|
||||
|
@ -94,21 +94,21 @@ _cogl_journal_flush (CoglJournal *journal);
|
||||
void
|
||||
_cogl_journal_discard (CoglJournal *journal);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_journal_all_entries_within_bounds (CoglJournal *journal,
|
||||
float clip_x0,
|
||||
float clip_y0,
|
||||
float clip_x1,
|
||||
float clip_y1);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_journal_try_read_pixel (CoglJournal *journal,
|
||||
int x,
|
||||
int y,
|
||||
CoglBitmap *bitmap,
|
||||
gboolean *found_intersection);
|
||||
CoglBool *found_intersection);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_is_journal (void *object);
|
||||
|
||||
#endif /* __COGL_JOURNAL_PRIVATE_H */
|
||||
|
@ -94,29 +94,29 @@
|
||||
|
||||
typedef struct _CoglJournalFlushState
|
||||
{
|
||||
CoglJournal *journal;
|
||||
CoglJournal *journal;
|
||||
|
||||
CoglAttributeBuffer *attribute_buffer;
|
||||
GArray *attributes;
|
||||
int current_attribute;
|
||||
GArray *attributes;
|
||||
int current_attribute;
|
||||
|
||||
gsize stride;
|
||||
size_t array_offset;
|
||||
GLuint current_vertex;
|
||||
size_t stride;
|
||||
size_t array_offset;
|
||||
GLuint current_vertex;
|
||||
|
||||
CoglIndices *indices;
|
||||
gsize indices_type_size;
|
||||
CoglIndices *indices;
|
||||
size_t indices_type_size;
|
||||
|
||||
CoglMatrixStack *modelview_stack;
|
||||
CoglMatrixStack *projection_stack;
|
||||
CoglMatrixStack *modelview_stack;
|
||||
CoglMatrixStack *projection_stack;
|
||||
|
||||
CoglPipeline *pipeline;
|
||||
CoglPipeline *pipeline;
|
||||
} CoglJournalFlushState;
|
||||
|
||||
typedef void (*CoglJournalBatchCallback) (CoglJournalEntry *start,
|
||||
int n_entries,
|
||||
void *data);
|
||||
typedef gboolean (*CoglJournalBatchTest) (CoglJournalEntry *entry0,
|
||||
typedef CoglBool (*CoglJournalBatchTest) (CoglJournalEntry *entry0,
|
||||
CoglJournalEntry *entry1);
|
||||
|
||||
static void _cogl_journal_free (CoglJournal *journal);
|
||||
@ -160,9 +160,9 @@ _cogl_journal_new (CoglFramebuffer *framebuffer)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
@ -189,9 +189,9 @@ _cogl_journal_dump_logged_quad (guint8 *data, int n_layers)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
_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++)
|
||||
{
|
||||
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;
|
||||
|
||||
if (G_UNLIKELY (COGL_DEBUG_ENABLED
|
||||
@ -224,9 +224,9 @@ _cogl_journal_dump_quad_vertices (guint8 *data, int n_layers)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
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)))
|
||||
{
|
||||
static CoglPipeline *outline = NULL;
|
||||
guint8 color_intensity;
|
||||
uint8_t color_intensity;
|
||||
int i;
|
||||
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);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
compare_entry_modelviews (CoglJournalEntry *entry0,
|
||||
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);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
compare_entry_pipelines (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
|
||||
{
|
||||
/* 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);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
compare_entry_n_layers (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
|
||||
{
|
||||
if (entry0->n_layers == entry1->n_layers)
|
||||
@ -582,11 +582,11 @@ _cogl_journal_flush_vbo_offsets_and_entries (CoglJournalEntry *batch_start,
|
||||
int batch_len,
|
||||
void *data)
|
||||
{
|
||||
CoglJournalFlushState *state = data;
|
||||
CoglContext *ctx = state->journal->framebuffer->context;
|
||||
gsize stride;
|
||||
int i;
|
||||
CoglAttribute **attribute_entry;
|
||||
CoglJournalFlushState *state = data;
|
||||
CoglContext *ctx = state->journal->framebuffer->context;
|
||||
size_t stride;
|
||||
int i;
|
||||
CoglAttribute **attribute_entry;
|
||||
COGL_STATIC_TIMER (time_flush_vbo_texcoord_pipeline_entries,
|
||||
"flush: clip+vbo+texcoords+pipeline+entries", /* parent */
|
||||
"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)))
|
||||
{
|
||||
guint8 *verts;
|
||||
uint8_t *verts;
|
||||
|
||||
/* Mapping a buffer for read is probably a really bad thing to
|
||||
do but this will only happen during debugging so it probably
|
||||
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) +
|
||||
state->array_offset);
|
||||
|
||||
@ -679,7 +679,7 @@ _cogl_journal_flush_vbo_offsets_and_entries (CoglJournalEntry *batch_start,
|
||||
time_flush_vbo_texcoord_pipeline_entries);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
compare_entry_strides (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
|
||||
{
|
||||
/* 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);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
calculate_translation (const CoglMatrix *a,
|
||||
const CoglMatrix *b,
|
||||
float *tx_p,
|
||||
@ -846,7 +846,7 @@ typedef struct
|
||||
float x_2, y_2;
|
||||
} ClipBounds;
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
can_software_clip_entry (CoglJournalEntry *journal_entry,
|
||||
CoglJournalEntry *prev_journal_entry,
|
||||
CoglClipStack *clip_stack,
|
||||
@ -1119,7 +1119,7 @@ _cogl_journal_maybe_software_clip_entries (CoglJournalEntry *batch_start,
|
||||
time_check_software_clip);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
compare_entry_clip_stacks (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
|
||||
{
|
||||
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 */
|
||||
static CoglAttributeBuffer *
|
||||
create_attribute_buffer (CoglJournal *journal,
|
||||
gsize n_bytes)
|
||||
size_t n_bytes)
|
||||
{
|
||||
CoglAttributeBuffer *vbo;
|
||||
|
||||
@ -1163,11 +1163,11 @@ create_attribute_buffer (CoglJournal *journal,
|
||||
}
|
||||
|
||||
static CoglAttributeBuffer *
|
||||
upload_vertices (CoglJournal *journal,
|
||||
upload_vertices (CoglJournal *journal,
|
||||
const CoglJournalEntry *entries,
|
||||
int n_entries,
|
||||
size_t needed_vbo_len,
|
||||
GArray *vertices)
|
||||
int n_entries,
|
||||
size_t needed_vbo_len,
|
||||
GArray *vertices)
|
||||
{
|
||||
CoglAttributeBuffer *attribute_buffer;
|
||||
CoglBuffer *buffer;
|
||||
@ -1284,7 +1284,7 @@ _cogl_journal_discard (CoglJournal *journal)
|
||||
|
||||
/* Note: A return value of FALSE doesn't mean 'no' it means
|
||||
* 'unknown' */
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_journal_all_entries_within_bounds (CoglJournal *journal,
|
||||
float clip_x0,
|
||||
float clip_y0,
|
||||
@ -1329,7 +1329,7 @@ _cogl_journal_all_entries_within_bounds (CoglJournal *journal,
|
||||
*/
|
||||
for (i = 1; i < journal->entries->len; i++)
|
||||
{
|
||||
gboolean found_reference = FALSE;
|
||||
CoglBool found_reference = FALSE;
|
||||
entry = &g_array_index (journal->entries, CoglJournalEntry, i);
|
||||
|
||||
for (clip_entry = entry->clip_stack;
|
||||
@ -1466,7 +1466,7 @@ _cogl_journal_flush (CoglJournal *journal)
|
||||
COGL_TIMER_STOP (_cogl_uprof_context, flush_timer);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
add_framebuffer_deps_cb (CoglPipelineLayer *layer, void *user_data)
|
||||
{
|
||||
CoglFramebuffer *framebuffer = user_data;
|
||||
@ -1492,12 +1492,12 @@ _cogl_journal_log_quad (CoglJournal *journal,
|
||||
unsigned int tex_coords_len)
|
||||
{
|
||||
CoglFramebuffer *framebuffer = journal->framebuffer;
|
||||
gsize stride;
|
||||
size_t stride;
|
||||
int next_vert;
|
||||
float *v;
|
||||
int i;
|
||||
int next_entry;
|
||||
guint32 disable_layers;
|
||||
uint32_t disable_layers;
|
||||
CoglJournalEntry *entry;
|
||||
CoglPipeline *final_pipeline;
|
||||
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
|
||||
* change the definition of CoglColor: */
|
||||
_cogl_pipeline_get_colorubv (pipeline, (guint8 *) v);
|
||||
_cogl_pipeline_get_colorubv (pipeline, (uint8_t *) v);
|
||||
v++;
|
||||
|
||||
memcpy (v, position, sizeof (float) * 2);
|
||||
@ -1559,7 +1559,7 @@ _cogl_journal_log_quad (CoglJournal *journal,
|
||||
{
|
||||
g_print ("Logged new quad:\n");
|
||||
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;
|
||||
@ -1704,16 +1704,16 @@ entry_to_screen_polygon (CoglFramebuffer *framebuffer,
|
||||
#undef VIEWPORT_TRANSFORM_Y
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
try_checking_point_hits_entry_after_clipping (CoglFramebuffer *framebuffer,
|
||||
CoglJournalEntry *entry,
|
||||
float *vertices,
|
||||
float x,
|
||||
float y,
|
||||
gboolean *hit)
|
||||
CoglBool *hit)
|
||||
{
|
||||
gboolean can_software_clip = TRUE;
|
||||
gboolean needs_software_clip = FALSE;
|
||||
CoglBool can_software_clip = TRUE;
|
||||
CoglBool needs_software_clip = FALSE;
|
||||
CoglClipStack *clip_entry;
|
||||
|
||||
*hit = TRUE;
|
||||
@ -1777,12 +1777,12 @@ try_checking_point_hits_entry_after_clipping (CoglFramebuffer *framebuffer,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_journal_try_read_pixel (CoglJournal *journal,
|
||||
int x,
|
||||
int y,
|
||||
CoglBitmap *bitmap,
|
||||
gboolean *found_intersection)
|
||||
CoglBool *found_intersection)
|
||||
{
|
||||
CoglPixelFormat format;
|
||||
int i;
|
||||
@ -1819,12 +1819,12 @@ _cogl_journal_try_read_pixel (CoglJournal *journal,
|
||||
{
|
||||
CoglJournalEntry *entry =
|
||||
&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);
|
||||
float *vertices = (float *)color + 1;
|
||||
float poly[16];
|
||||
CoglFramebuffer *framebuffer = journal->framebuffer;
|
||||
guint8 *pixel;
|
||||
uint8_t *pixel;
|
||||
|
||||
entry_to_screen_polygon (framebuffer, entry, vertices, poly);
|
||||
|
||||
@ -1833,7 +1833,7 @@ _cogl_journal_try_read_pixel (CoglJournal *journal,
|
||||
|
||||
if (entry->clip_stack)
|
||||
{
|
||||
gboolean hit;
|
||||
CoglBool hit;
|
||||
|
||||
if (!try_checking_point_hits_entry_after_clipping (framebuffer,
|
||||
entry,
|
||||
|
@ -58,7 +58,7 @@ cogl_material_unref (CoglHandle handle)
|
||||
cogl_object_unref (handle);
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_material (CoglHandle handle)
|
||||
{
|
||||
return cogl_is_pipeline (handle);
|
||||
@ -73,10 +73,10 @@ cogl_material_set_color (CoglMaterial *material,
|
||||
|
||||
void
|
||||
cogl_material_set_color4ub (CoglMaterial *material,
|
||||
guint8 red,
|
||||
guint8 green,
|
||||
guint8 blue,
|
||||
guint8 alpha)
|
||||
uint8_t red,
|
||||
uint8_t green,
|
||||
uint8_t blue,
|
||||
uint8_t alpha)
|
||||
{
|
||||
cogl_pipeline_set_color4ub (COGL_PIPELINE (material),
|
||||
red, green, blue, alpha);
|
||||
@ -189,7 +189,7 @@ cogl_material_set_alpha_test_function (CoglMaterial *material,
|
||||
alpha_reference);
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_material_set_blend (CoglMaterial *material,
|
||||
const char *blend_string,
|
||||
GError **error)
|
||||
@ -248,7 +248,7 @@ cogl_material_remove_layer (CoglMaterial *material,
|
||||
cogl_pipeline_remove_layer (COGL_PIPELINE (material), layer_index);
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_material_set_layer_combine (CoglMaterial *material,
|
||||
int layer_index,
|
||||
const char *blend_string,
|
||||
@ -327,10 +327,10 @@ cogl_material_set_layer_filters (CoglMaterial *material,
|
||||
mag_filter);
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
|
||||
int layer_index,
|
||||
gboolean enable,
|
||||
CoglBool enable,
|
||||
GError **error)
|
||||
{
|
||||
CoglPipeline *pipeline = COGL_PIPELINE (material);
|
||||
@ -340,7 +340,7 @@ cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
|
||||
error);
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_material_get_layer_point_sprite_coords_enabled (CoglMaterial *material,
|
||||
int layer_index)
|
||||
{
|
||||
@ -436,7 +436,7 @@ cogl_material_foreach_layer (CoglMaterial *material,
|
||||
(CoglPipelineLayerCallback)callback, user_data);
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_material_set_depth_state (CoglMaterial *material,
|
||||
const CoglDepthState *state,
|
||||
GError **error)
|
||||
|
@ -198,7 +198,7 @@ cogl_material_unref (CoglHandle material) G_GNUC_DEPRECATED;
|
||||
* Return value: %TRUE if the handle references a #CoglMaterial,
|
||||
* %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_material (CoglHandle handle);
|
||||
|
||||
/**
|
||||
@ -237,10 +237,10 @@ cogl_material_set_color (CoglMaterial *material,
|
||||
*/
|
||||
void
|
||||
cogl_material_set_color4ub (CoglMaterial *material,
|
||||
guint8 red,
|
||||
guint8 green,
|
||||
guint8 blue,
|
||||
guint8 alpha);
|
||||
uint8_t red,
|
||||
uint8_t green,
|
||||
uint8_t blue,
|
||||
uint8_t alpha);
|
||||
|
||||
/**
|
||||
* cogl_material_set_color4f:
|
||||
@ -587,7 +587,7 @@ cogl_material_set_alpha_test_function (CoglMaterial *material,
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_material_set_blend (CoglMaterial *material,
|
||||
const char *blend_string,
|
||||
GError **error);
|
||||
@ -832,7 +832,7 @@ cogl_material_remove_layer (CoglMaterial *material,
|
||||
*
|
||||
* Since: 1.0
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_material_set_layer_combine (CoglMaterial *material,
|
||||
int layer_index,
|
||||
const char *blend_string,
|
||||
@ -1013,10 +1013,10 @@ cogl_material_set_layer_filters (CoglMaterial *material,
|
||||
* Return value: %TRUE if the function succeeds, %FALSE otherwise.
|
||||
* Since: 1.4
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
|
||||
int layer_index,
|
||||
gboolean enable,
|
||||
CoglBool enable,
|
||||
GError **error);
|
||||
|
||||
/**
|
||||
@ -1032,7 +1032,7 @@ cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_material_get_layer_point_sprite_coords_enabled (CoglMaterial *material,
|
||||
int layer_index);
|
||||
|
||||
@ -1215,7 +1215,7 @@ cogl_material_layer_get_wrap_mode_p (CoglMaterialLayer *layer);
|
||||
* Since: 1.8
|
||||
* Stability: Unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_material_set_depth_state (CoglMaterial *material,
|
||||
const CoglDepthState *state,
|
||||
GError **error);
|
||||
@ -1247,7 +1247,7 @@ cogl_material_get_depth_state (CoglMaterial *material,
|
||||
* Since: 1.4
|
||||
* Stability: Unstable
|
||||
*/
|
||||
typedef gboolean (*CoglMaterialLayerCallback) (CoglMaterial *material,
|
||||
typedef CoglBool (*CoglMaterialLayerCallback) (CoglMaterial *material,
|
||||
int layer_index,
|
||||
void *user_data);
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
typedef struct {
|
||||
CoglMatrix matrix;
|
||||
gboolean is_identity;
|
||||
CoglBool is_identity;
|
||||
/* count of pushes with no changes; when a change is
|
||||
* requested, we create a new state and decrement this
|
||||
*/
|
||||
@ -93,7 +93,7 @@ _cogl_matrix_stack_top (CoglMatrixStack *stack)
|
||||
*/
|
||||
static CoglMatrixState *
|
||||
_cogl_matrix_stack_top_mutable (CoglMatrixStack *stack,
|
||||
gboolean initialize)
|
||||
CoglBool initialize)
|
||||
{
|
||||
CoglMatrixState *state;
|
||||
CoglMatrixState *new_top;
|
||||
@ -321,7 +321,7 @@ _cogl_matrix_stack_ortho (CoglMatrixStack *stack,
|
||||
stack->age++;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
|
||||
CoglMatrix *inverse)
|
||||
{
|
||||
@ -367,7 +367,7 @@ _cogl_matrix_stack_set (CoglMatrixStack *stack,
|
||||
|
||||
static void
|
||||
_cogl_matrix_stack_flush_matrix_to_gl_builtin (CoglContext *ctx,
|
||||
gboolean is_identity,
|
||||
CoglBool is_identity,
|
||||
CoglMatrix *matrix,
|
||||
CoglMatrixMode mode)
|
||||
{
|
||||
@ -409,14 +409,14 @@ void
|
||||
_cogl_matrix_stack_flush_to_gl_builtins (CoglContext *ctx,
|
||||
CoglMatrixStack *stack,
|
||||
CoglMatrixMode mode,
|
||||
gboolean disable_flip)
|
||||
CoglBool disable_flip)
|
||||
{
|
||||
g_assert (ctx->driver == COGL_DRIVER_GL ||
|
||||
ctx->driver == COGL_DRIVER_GLES1);
|
||||
|
||||
#if defined (HAVE_COGL_GL) || defined (HAVE_COGL_GLES)
|
||||
{
|
||||
gboolean needs_flip;
|
||||
CoglBool needs_flip;
|
||||
CoglMatrixState *state;
|
||||
CoglMatrixStackCache *cache;
|
||||
|
||||
@ -451,7 +451,7 @@ _cogl_matrix_stack_flush_to_gl_builtins (CoglContext *ctx,
|
||||
if (!cache ||
|
||||
_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)
|
||||
{
|
||||
@ -485,13 +485,13 @@ _cogl_matrix_stack_get_age (CoglMatrixStack *stack)
|
||||
return stack->age;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_matrix_stack_has_identity_flag (CoglMatrixStack *stack)
|
||||
{
|
||||
return _cogl_matrix_stack_top (stack)->is_identity;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_matrix_stack_equal (CoglMatrixStack *stack0,
|
||||
CoglMatrixStack *stack1)
|
||||
{
|
||||
@ -507,14 +507,14 @@ _cogl_matrix_stack_equal (CoglMatrixStack *stack0,
|
||||
return cogl_matrix_equal (&state0->matrix, &state1->matrix);
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_matrix_stack_check_and_update_cache (CoglMatrixStack *stack,
|
||||
CoglMatrixStackCache *cache,
|
||||
gboolean flip)
|
||||
CoglBool flip)
|
||||
{
|
||||
gboolean is_identity =
|
||||
CoglBool is_identity =
|
||||
_cogl_matrix_stack_has_identity_flag (stack) && !flip;
|
||||
gboolean is_dirty;
|
||||
CoglBool is_dirty;
|
||||
|
||||
if (is_identity && cache->flushed_identity)
|
||||
is_dirty = FALSE;
|
||||
|
@ -38,8 +38,8 @@ typedef struct
|
||||
{
|
||||
CoglMatrixStack *stack;
|
||||
unsigned int age;
|
||||
gboolean flushed_identity;
|
||||
gboolean flipped;
|
||||
CoglBool flushed_identity;
|
||||
CoglBool flipped;
|
||||
} CoglMatrixStackCache;
|
||||
|
||||
typedef enum {
|
||||
@ -49,7 +49,7 @@ typedef enum {
|
||||
} CoglMatrixMode;
|
||||
|
||||
typedef void (* CoglMatrixStackFlushFunc) (CoglContext *context,
|
||||
gboolean is_identity,
|
||||
CoglBool is_identity,
|
||||
const CoglMatrix *matrix,
|
||||
void *user_data);
|
||||
|
||||
@ -106,7 +106,7 @@ _cogl_matrix_stack_ortho (CoglMatrixStack *stack,
|
||||
float top,
|
||||
float z_near,
|
||||
float z_far);
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
|
||||
CoglMatrix *inverse);
|
||||
void
|
||||
@ -120,7 +120,7 @@ void
|
||||
_cogl_matrix_stack_flush_to_gl_builtins (CoglContext *ctx,
|
||||
CoglMatrixStack *stack,
|
||||
CoglMatrixMode mode,
|
||||
gboolean disable_flip);
|
||||
CoglBool disable_flip);
|
||||
|
||||
unsigned int
|
||||
_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 but no expensive comparison is performed to verify
|
||||
it. */
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_matrix_stack_has_identity_flag (CoglMatrixStack *stack);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_matrix_stack_equal (CoglMatrixStack *stack0,
|
||||
CoglMatrixStack *stack1);
|
||||
|
||||
void
|
||||
_cogl_matrix_stack_init_cache (CoglMatrixStackCache *cache);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_matrix_stack_check_and_update_cache (CoglMatrixStack *stack,
|
||||
CoglMatrixStackCache *cache,
|
||||
gboolean flip);
|
||||
CoglBool flip);
|
||||
|
||||
void
|
||||
_cogl_matrix_stack_destroy_cache (CoglMatrixStackCache *cache);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_is_matrix_stack (void *object);
|
||||
|
||||
#endif /* __COGL_MATRIX_STACK_H */
|
||||
|
@ -431,7 +431,7 @@ _cogl_matrix_print (const CoglMatrix *matrix)
|
||||
* with partial pivoting followed by back/substitution with the loops manually
|
||||
* unrolled.
|
||||
*/
|
||||
static gboolean
|
||||
static CoglBool
|
||||
invert_matrix_general (CoglMatrix *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
|
||||
* original translation vector using by the calculated submatrix inverse.
|
||||
*/
|
||||
static gboolean
|
||||
static CoglBool
|
||||
invert_matrix_3d_general (CoglMatrix *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
|
||||
* translation parts.
|
||||
*/
|
||||
static gboolean
|
||||
static CoglBool
|
||||
invert_matrix_3d (CoglMatrix *matrix)
|
||||
{
|
||||
const float *in = (float *)matrix;
|
||||
@ -735,7 +735,7 @@ invert_matrix_3d (CoglMatrix *matrix)
|
||||
*
|
||||
* Simply copies identity into CoglMatrix::inv.
|
||||
*/
|
||||
static gboolean
|
||||
static CoglBool
|
||||
invert_matrix_identity (CoglMatrix *matrix)
|
||||
{
|
||||
memcpy (matrix->inv, identity, 16 * sizeof (float));
|
||||
@ -752,7 +752,7 @@ invert_matrix_identity (CoglMatrix *matrix)
|
||||
*
|
||||
* Calculates the
|
||||
*/
|
||||
static gboolean
|
||||
static CoglBool
|
||||
invert_matrix_3d_no_rotation (CoglMatrix *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
|
||||
* translation to the identity matrix.
|
||||
*/
|
||||
static gboolean
|
||||
static CoglBool
|
||||
invert_matrix_2d_no_rotation (CoglMatrix *matrix)
|
||||
{
|
||||
const float *in = (float *)matrix;
|
||||
@ -811,7 +811,7 @@ invert_matrix_2d_no_rotation (CoglMatrix *matrix)
|
||||
|
||||
#if 0
|
||||
/* broken */
|
||||
static gboolean
|
||||
static CoglBool
|
||||
invert_matrix_perspective (CoglMatrix *matrix)
|
||||
{
|
||||
const float *in = matrix;
|
||||
@ -841,7 +841,7 @@ invert_matrix_perspective (CoglMatrix *matrix)
|
||||
/*
|
||||
* 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.
|
||||
@ -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,
|
||||
* and copies the identity matrix into CoglMatrix::inv.
|
||||
*/
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_matrix_update_inverse (CoglMatrix *matrix)
|
||||
{
|
||||
if (matrix->flags & MAT_DIRTY_FLAGS ||
|
||||
@ -1124,7 +1124,7 @@ _cogl_matrix_update_inverse (CoglMatrix *matrix)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_matrix_get_inverse (const CoglMatrix *matrix, CoglMatrix *inverse)
|
||||
{
|
||||
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 m[16];
|
||||
gboolean optimized;
|
||||
CoglBool optimized;
|
||||
|
||||
s = sinf (angle * DEG2RAD);
|
||||
c = cosf (angle * DEG2RAD);
|
||||
@ -1600,7 +1600,7 @@ cogl_matrix_init_identity (CoglMatrix *matrix)
|
||||
/*
|
||||
* Test if the given matrix preserves vector lengths.
|
||||
*/
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_matrix_is_length_preserving (const CoglMatrix *m)
|
||||
{
|
||||
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.
|
||||
* (or perhaps if the upper-left 3x3 is non-identity)
|
||||
*/
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_matrix_has_rotation (const CoglMatrix *matrix)
|
||||
{
|
||||
if (matrix->flags & (MAT_FLAG_GENERAL |
|
||||
@ -1622,13 +1622,13 @@ _cogl_matrix_has_rotation (const CoglMatrix *matrix)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_matrix_is_general_scale (const CoglMatrix *matrix)
|
||||
{
|
||||
return (matrix->flags & MAT_FLAG_GENERAL_SCALE) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_matrix_is_dirty (const CoglMatrix *matrix)
|
||||
{
|
||||
return (matrix->flags & MAT_DIRTY_ALL) ? TRUE : FALSE;
|
||||
@ -1782,8 +1782,8 @@ cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
|
||||
height_2d);
|
||||
}
|
||||
|
||||
gboolean
|
||||
cogl_matrix_equal (gconstpointer v1, gconstpointer v2)
|
||||
CoglBool
|
||||
cogl_matrix_equal (const void *v1, const void *v2)
|
||||
{
|
||||
const CoglMatrix *a = v1;
|
||||
const CoglMatrix *b = v2;
|
||||
@ -1896,8 +1896,8 @@ _cogl_matrix_transform_points_f2 (const CoglMatrix *matrix,
|
||||
|
||||
for (i = 0; i < n_points; i++)
|
||||
{
|
||||
Point2f p = *(Point2f *)((guint8 *)points_in + i * stride_in);
|
||||
Point3f *o = (Point3f *)((guint8 *)points_out + i * stride_out);
|
||||
Point2f p = *(Point2f *)((uint8_t *)points_in + i * stride_in);
|
||||
Point3f *o = (Point3f *)((uint8_t *)points_out + i * stride_out);
|
||||
|
||||
o->x = matrix->xx * p.x + matrix->xy * p.y + matrix->xw;
|
||||
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++)
|
||||
{
|
||||
Point2f p = *(Point2f *)((guint8 *)points_in + i * stride_in);
|
||||
Point4f *o = (Point4f *)((guint8 *)points_out + i * stride_out);
|
||||
Point2f p = *(Point2f *)((uint8_t *)points_in + i * stride_in);
|
||||
Point4f *o = (Point4f *)((uint8_t *)points_out + i * stride_out);
|
||||
|
||||
o->x = matrix->xx * p.x + matrix->xy * p.y + matrix->xw;
|
||||
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++)
|
||||
{
|
||||
Point3f p = *(Point3f *)((guint8 *)points_in + i * stride_in);
|
||||
Point3f *o = (Point3f *)((guint8 *)points_out + i * stride_out);
|
||||
Point3f p = *(Point3f *)((uint8_t *)points_in + i * stride_in);
|
||||
Point3f *o = (Point3f *)((uint8_t *)points_out + i * stride_out);
|
||||
|
||||
o->x = matrix->xx * p.x + matrix->xy * p.y +
|
||||
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++)
|
||||
{
|
||||
Point3f p = *(Point3f *)((guint8 *)points_in + i * stride_in);
|
||||
Point4f *o = (Point4f *)((guint8 *)points_out + i * stride_out);
|
||||
Point3f p = *(Point3f *)((uint8_t *)points_in + i * stride_in);
|
||||
Point4f *o = (Point4f *)((uint8_t *)points_out + i * stride_out);
|
||||
|
||||
o->x = matrix->xx * p.x + matrix->xy * p.y +
|
||||
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++)
|
||||
{
|
||||
Point4f p = *(Point4f *)((guint8 *)points_in + i * stride_in);
|
||||
Point4f *o = (Point4f *)((guint8 *)points_out + i * stride_out);
|
||||
Point4f p = *(Point4f *)((uint8_t *)points_in + i * stride_in);
|
||||
Point4f *o = (Point4f *)((uint8_t *)points_out + i * stride_out);
|
||||
|
||||
o->x = matrix->xx * p.x + matrix->xy * p.y +
|
||||
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)
|
||||
{
|
||||
if (!(matrix->flags & MAT_DIRTY_TYPE) &&
|
||||
|
@ -483,8 +483,8 @@ cogl_matrix_init_from_quaternion (CoglMatrix *matrix,
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
gboolean
|
||||
cogl_matrix_equal (gconstpointer v1, gconstpointer v2);
|
||||
CoglBool
|
||||
cogl_matrix_equal (const void *v1, const void *v2);
|
||||
|
||||
/**
|
||||
* cogl_matrix_copy:
|
||||
@ -533,7 +533,7 @@ cogl_matrix_free (CoglMatrix *matrix);
|
||||
*
|
||||
* Since: 1.2
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_matrix_get_inverse (const CoglMatrix *matrix,
|
||||
CoglMatrix *inverse);
|
||||
|
||||
@ -584,11 +584,11 @@ cogl_matrix_transform_point (const CoglMatrix *matrix,
|
||||
* |[
|
||||
* typedef struct {
|
||||
* float x,y;
|
||||
* guint8 r,g,b,a;
|
||||
* uint8_t r,g,b,a;
|
||||
* float s,t,p;
|
||||
* } MyInVertex;
|
||||
* typedef struct {
|
||||
* guint8 r,g,b,a;
|
||||
* uint8_t r,g,b,a;
|
||||
* float x,y,z;
|
||||
* } MyOutVertex;
|
||||
* MyInVertex vertices[N_VERTICES];
|
||||
@ -639,11 +639,11 @@ cogl_matrix_transform_points (const CoglMatrix *matrix,
|
||||
* |[
|
||||
* typedef struct {
|
||||
* float x,y;
|
||||
* guint8 r,g,b,a;
|
||||
* uint8_t r,g,b,a;
|
||||
* float s,t,p;
|
||||
* } MyInVertex;
|
||||
* typedef struct {
|
||||
* guint8 r,g,b,a;
|
||||
* uint8_t r,g,b,a;
|
||||
* float x,y,z;
|
||||
* } MyOutVertex;
|
||||
* 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
|
||||
* Since: 1.8
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_matrix_is_identity (const CoglMatrix *matrix);
|
||||
|
||||
/**
|
||||
|
@ -223,8 +223,8 @@ typedef struct _ClampData
|
||||
{
|
||||
float start;
|
||||
float end;
|
||||
gboolean s_flipped;
|
||||
gboolean t_flipped;
|
||||
CoglBool s_flipped;
|
||||
CoglBool t_flipped;
|
||||
CoglMetaTextureCallback callback;
|
||||
void *user_data;
|
||||
} ClampData;
|
||||
@ -273,7 +273,7 @@ clamp_t_cb (CoglTexture *sub_texture,
|
||||
clamp_data->user_data);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
foreach_clamped_region (CoglMetaTexture *meta_texture,
|
||||
float *tx_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 ||
|
||||
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,
|
||||
wrap_s, wrap_t,
|
||||
callback,
|
||||
|
@ -56,7 +56,7 @@ struct _CoglNode
|
||||
|
||||
/* TRUE if the node took a strong reference on its parent. Weak
|
||||
* 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))
|
||||
@ -70,12 +70,12 @@ void
|
||||
_cogl_pipeline_node_set_parent_real (CoglNode *node,
|
||||
CoglNode *parent,
|
||||
CoglNodeUnparentVFunc unparent,
|
||||
gboolean take_strong_reference);
|
||||
CoglBool take_strong_reference);
|
||||
|
||||
void
|
||||
_cogl_pipeline_node_unparent_real (CoglNode *node);
|
||||
|
||||
typedef gboolean (*CoglNodeChildCallback) (CoglNode *child, void *user_data);
|
||||
typedef CoglBool (*CoglNodeChildCallback) (CoglNode *child, void *user_data);
|
||||
|
||||
void
|
||||
_cogl_pipeline_node_foreach_child (CoglNode *node,
|
||||
|
@ -43,7 +43,7 @@ void
|
||||
_cogl_pipeline_node_set_parent_real (CoglNode *node,
|
||||
CoglNode *parent,
|
||||
CoglNodeUnparentVFunc unparent,
|
||||
gboolean take_strong_reference)
|
||||
CoglBool take_strong_reference)
|
||||
{
|
||||
/* NB: the old parent may indirectly be keeping the new parent alive
|
||||
* so we have to ref the new parent before unrefing the old.
|
||||
|
@ -182,7 +182,7 @@ _cogl_##type_name##_object_new (Cogl##TypeName *new_obj) \
|
||||
\
|
||||
COGL_OBJECT_COMMON_DEFINE_WITH_CODE(TypeName, type_name, code) \
|
||||
\
|
||||
gboolean \
|
||||
CoglBool \
|
||||
cogl_is_##type_name (void *object) \
|
||||
{ \
|
||||
CoglObject *obj = object; \
|
||||
@ -197,7 +197,7 @@ cogl_is_##type_name (void *object) \
|
||||
\
|
||||
COGL_OBJECT_COMMON_DEFINE_WITH_CODE(TypeName, type_name, code) \
|
||||
\
|
||||
gboolean \
|
||||
CoglBool \
|
||||
_cogl_is_##type_name (void *object) \
|
||||
{ \
|
||||
CoglObject *obj = object; \
|
||||
|
@ -79,7 +79,7 @@ cogl_offscreen_new_to_texture (CoglTexture *texture);
|
||||
* Returns: %TRUE if @object is a #CoglOffscreen framebuffer,
|
||||
* %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_offscreen (void *object);
|
||||
|
||||
#ifndef COGL_DISABLE_DEPRECATED
|
||||
|
@ -51,7 +51,7 @@ struct _CoglOnscreen
|
||||
CoglFramebuffer _parent;
|
||||
|
||||
#ifdef COGL_HAS_X11_SUPPORT
|
||||
guint32 foreign_xid;
|
||||
uint32_t foreign_xid;
|
||||
CoglOnscreenX11MaskCallback foreign_update_mask_callback;
|
||||
void *foreign_update_mask_data;
|
||||
#endif
|
||||
@ -60,7 +60,7 @@ struct _CoglOnscreen
|
||||
HWND foreign_hwnd;
|
||||
#endif
|
||||
|
||||
gboolean swap_throttled;
|
||||
CoglBool swap_throttled;
|
||||
|
||||
CoglSwapBuffersNotifyList swap_callbacks;
|
||||
|
||||
|
@ -83,7 +83,7 @@ cogl_onscreen_template_set_samples_per_pixel (
|
||||
void
|
||||
cogl_onscreen_template_set_swap_throttled (
|
||||
CoglOnscreenTemplate *onscreen_template,
|
||||
gboolean throttled)
|
||||
CoglBool throttled)
|
||||
{
|
||||
onscreen_template->config.swap_throttled = throttled;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ cogl_onscreen_template_set_samples_per_pixel (
|
||||
void
|
||||
cogl_onscreen_template_set_swap_throttled (
|
||||
CoglOnscreenTemplate *onscreen_template,
|
||||
gboolean throttled);
|
||||
CoglBool throttled);
|
||||
|
||||
/**
|
||||
* cogl_is_onscreen_template:
|
||||
@ -99,7 +99,7 @@ cogl_onscreen_template_set_swap_throttled (
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_onscreen_template (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -176,7 +176,7 @@ cogl_onscreen_swap_region (CoglOnscreen *onscreen,
|
||||
#ifdef COGL_HAS_X11_SUPPORT
|
||||
void
|
||||
cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen,
|
||||
guint32 xid,
|
||||
uint32_t xid,
|
||||
CoglOnscreenX11MaskCallback update,
|
||||
void *user_data)
|
||||
{
|
||||
@ -189,7 +189,7 @@ cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen,
|
||||
onscreen->foreign_update_mask_data = user_data;
|
||||
}
|
||||
|
||||
guint32
|
||||
uint32_t
|
||||
cogl_x11_onscreen_get_window_xid (CoglOnscreen *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)
|
||||
{
|
||||
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
|
||||
const CoglWinsysVtable *winsys = _cogl_framebuffer_get_winsys (framebuffer);
|
||||
XVisualInfo *visinfo;
|
||||
guint32 id;
|
||||
uint32_t id;
|
||||
|
||||
/* This should only be called for xlib based onscreens */
|
||||
_COGL_RETURN_VAL_IF_FAIL (winsys->xlib_get_visual_info != NULL, 0);
|
||||
|
||||
visinfo = winsys->xlib_get_visual_info ();
|
||||
id = (guint32)visinfo->visualid;
|
||||
id = (uint32_t)visinfo->visualid;
|
||||
|
||||
XFree (visinfo);
|
||||
return id;
|
||||
@ -291,7 +291,7 @@ cogl_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen,
|
||||
|
||||
void
|
||||
cogl_onscreen_set_swap_throttled (CoglOnscreen *onscreen,
|
||||
gboolean throttled)
|
||||
CoglBool throttled)
|
||||
{
|
||||
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
|
||||
framebuffer->config.swap_throttled = throttled;
|
||||
|
@ -60,7 +60,7 @@ cogl_onscreen_new (CoglContext *context, int width, int height);
|
||||
|
||||
#ifdef COGL_HAS_X11
|
||||
typedef void (*CoglOnscreenX11MaskCallback) (CoglOnscreen *onscreen,
|
||||
guint32 event_mask,
|
||||
uint32_t event_mask,
|
||||
void *user_data);
|
||||
|
||||
/**
|
||||
@ -88,7 +88,7 @@ typedef void (*CoglOnscreenX11MaskCallback) (CoglOnscreen *onscreen,
|
||||
* [{
|
||||
* static void
|
||||
* my_update_cogl_x11_event_mask (CoglOnscreen *onscreen,
|
||||
* guint32 event_mask,
|
||||
* uint32_t event_mask,
|
||||
* void *user_data)
|
||||
* {
|
||||
* XSetWindowAttributes attrs;
|
||||
@ -115,7 +115,7 @@ typedef void (*CoglOnscreenX11MaskCallback) (CoglOnscreen *onscreen,
|
||||
*/
|
||||
void
|
||||
cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen,
|
||||
guint32 xid,
|
||||
uint32_t xid,
|
||||
CoglOnscreenX11MaskCallback update,
|
||||
void *user_data);
|
||||
|
||||
@ -136,12 +136,12 @@ cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen,
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
guint32
|
||||
uint32_t
|
||||
cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen);
|
||||
|
||||
/* XXX: we should maybe remove this, since nothing currently uses
|
||||
* it and the current implementation looks dubious. */
|
||||
guint32
|
||||
uint32_t
|
||||
cogl_x11_onscreen_get_visual_xid (CoglOnscreen *onscreen);
|
||||
#endif /* COGL_HAS_X11 */
|
||||
|
||||
@ -237,7 +237,7 @@ cogl_wayland_onscreen_resize (CoglOnscreen *onscreen,
|
||||
*/
|
||||
void
|
||||
cogl_onscreen_set_swap_throttled (CoglOnscreen *onscreen,
|
||||
gboolean throttled);
|
||||
CoglBool throttled);
|
||||
|
||||
/**
|
||||
* cogl_onscreen_show:
|
||||
@ -391,7 +391,7 @@ cogl_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen,
|
||||
* Since: 1.10
|
||||
* Stability: unstable
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_onscreen (void *object);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -45,7 +45,7 @@ G_BEGIN_DECLS
|
||||
* Return value: %TRUE if the handle references a #CoglPath,
|
||||
* %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
CoglBool
|
||||
cogl_is_path (CoglHandle handle);
|
||||
|
||||
/**
|
||||
|
@ -97,13 +97,13 @@ struct _CoglPathData
|
||||
case and divert to the journal or a rectangle clip. If it is TRUE
|
||||
then the entire path can be described by calling
|
||||
_cogl_path_get_bounds */
|
||||
gboolean is_rectangle;
|
||||
CoglBool is_rectangle;
|
||||
};
|
||||
|
||||
void
|
||||
_cogl_add_path_to_stencil_buffer (CoglPath *path,
|
||||
gboolean merge,
|
||||
gboolean need_clear);
|
||||
CoglBool merge,
|
||||
CoglBool need_clear);
|
||||
|
||||
void
|
||||
_cogl_path_get_bounds (CoglPath *path,
|
||||
@ -112,7 +112,7 @@ _cogl_path_get_bounds (CoglPath *path,
|
||||
float *max_x,
|
||||
float *max_y);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_path_is_rectangle (CoglPath *path);
|
||||
|
||||
void
|
||||
|
@ -58,7 +58,7 @@ pipeline_fragment_hash (const void *data)
|
||||
0);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
pipeline_fragment_equal (const void *a, const void *b)
|
||||
{
|
||||
unsigned int fragment_state;
|
||||
@ -89,7 +89,7 @@ pipeline_vertex_hash (const void *data)
|
||||
0);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
pipeline_vertex_equal (const void *a, const void *b)
|
||||
{
|
||||
unsigned long vertex_state =
|
||||
@ -122,7 +122,7 @@ pipeline_combined_hash (const void *data)
|
||||
0);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
pipeline_combined_equal (const void *a, const void *b)
|
||||
{
|
||||
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))
|
||||
{
|
||||
static gboolean seen = FALSE;
|
||||
static CoglBool seen = FALSE;
|
||||
if (!seen)
|
||||
g_warning ("Over 50 separate fragment shaders have been "
|
||||
"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))
|
||||
{
|
||||
static gboolean seen = FALSE;
|
||||
static CoglBool seen = FALSE;
|
||||
if (!seen)
|
||||
g_warning ("Over 50 separate vertex shaders have been "
|
||||
"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))
|
||||
{
|
||||
static gboolean seen = FALSE;
|
||||
static CoglBool seen = FALSE;
|
||||
if (!seen)
|
||||
g_warning ("Over 50 separate programs have been "
|
||||
"generated which is very unusual, so something "
|
||||
|
@ -44,7 +44,7 @@ typedef struct
|
||||
int indent;
|
||||
} PrintDebugState;
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
dump_layer_cb (CoglNode *node, void *user_data)
|
||||
{
|
||||
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;
|
||||
PrintDebugState state_out;
|
||||
GString *changes_label;
|
||||
gboolean changes = FALSE;
|
||||
CoglBool changes = FALSE;
|
||||
|
||||
if (state->parent_id >= 0)
|
||||
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;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
dump_layer_ref_cb (CoglPipelineLayer *layer, void *data)
|
||||
{
|
||||
PrintDebugState *state = data;
|
||||
@ -132,7 +132,7 @@ dump_layer_ref_cb (CoglPipelineLayer *layer, void *data)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
dump_pipeline_cb (CoglNode *node, void *user_data)
|
||||
{
|
||||
CoglPipeline *pipeline = COGL_PIPELINE (node);
|
||||
@ -140,8 +140,8 @@ dump_pipeline_cb (CoglNode *node, void *user_data)
|
||||
int pipeline_id = *state->node_id_ptr;
|
||||
PrintDebugState state_out;
|
||||
GString *changes_label;
|
||||
gboolean changes = FALSE;
|
||||
gboolean layers = FALSE;
|
||||
CoglBool changes = FALSE;
|
||||
CoglBool layers = FALSE;
|
||||
|
||||
if (state->parent_id >= 0)
|
||||
g_string_append_printf (state->graph, "%*spipeline%d -> pipeline%d;\n",
|
||||
|
@ -155,7 +155,7 @@ dirty_shader_state (CoglPipeline *pipeline)
|
||||
NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_pipeline_fragend_arbfp_start (CoglPipeline *pipeline,
|
||||
int n_layers,
|
||||
unsigned long pipelines_difference,
|
||||
@ -441,7 +441,7 @@ setup_arg (CoglPipeline *pipeline,
|
||||
|
||||
if (other_layer == NULL)
|
||||
{
|
||||
static gboolean warning_seen = FALSE;
|
||||
static CoglBool warning_seen = FALSE;
|
||||
if (!warning_seen)
|
||||
{
|
||||
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,
|
||||
CoglPipelineFragendARBfpArg *arg1)
|
||||
{
|
||||
@ -708,7 +708,7 @@ append_masked_combine (CoglPipeline *arbfp_authority,
|
||||
n_args);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_pipeline_fragend_arbfp_add_layer (CoglPipeline *pipeline,
|
||||
CoglPipelineLayer *layer,
|
||||
unsigned long layers_difference)
|
||||
@ -792,7 +792,7 @@ _cogl_pipeline_fragend_arbfp_add_layer (CoglPipeline *pipeline,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_pipeline_fragend_arbfp_passthrough (CoglPipeline *pipeline)
|
||||
{
|
||||
CoglPipelineShaderState *shader_state = get_shader_state (pipeline);
|
||||
@ -808,11 +808,11 @@ _cogl_pipeline_fragend_arbfp_passthrough (CoglPipeline *pipeline)
|
||||
typedef struct _UpdateConstantsState
|
||||
{
|
||||
int unit;
|
||||
gboolean update_all;
|
||||
CoglBool update_all;
|
||||
CoglPipelineShaderState *shader_state;
|
||||
} UpdateConstantsState;
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
update_constants_cb (CoglPipeline *pipeline,
|
||||
int layer_index,
|
||||
void *user_data)
|
||||
@ -838,7 +838,7 @@ update_constants_cb (CoglPipeline *pipeline,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_pipeline_fragend_arbfp_end (CoglPipeline *pipeline,
|
||||
unsigned long pipelines_difference)
|
||||
{
|
||||
@ -917,7 +917,7 @@ _cogl_pipeline_fragend_arbfp_end (CoglPipeline *pipeline,
|
||||
else
|
||||
{
|
||||
CoglProgram *program = shader_state->user_program;
|
||||
gboolean program_changed;
|
||||
CoglBool program_changed;
|
||||
|
||||
/* If the shader has changed since it was last flushed then we
|
||||
need to update all uniforms */
|
||||
|
@ -89,7 +89,7 @@ get_max_texture_units (void)
|
||||
return ctx->max_texture_units;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_pipeline_fragend_fixed_start (CoglPipeline *pipeline,
|
||||
int n_layers,
|
||||
unsigned long pipelines_difference,
|
||||
@ -161,7 +161,7 @@ translate_sources (CoglPipeline *pipeline,
|
||||
|
||||
if (layer == NULL)
|
||||
{
|
||||
static gboolean warning_seen = FALSE;
|
||||
static CoglBool warning_seen = FALSE;
|
||||
if (!warning_seen)
|
||||
{
|
||||
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,
|
||||
CoglPipelineLayer *layer,
|
||||
unsigned long layers_difference)
|
||||
@ -357,7 +357,7 @@ _cogl_pipeline_fragend_fixed_add_layer (CoglPipeline *pipeline,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
get_highest_unit_index_cb (CoglPipelineLayer *layer,
|
||||
void *user_data)
|
||||
{
|
||||
@ -369,7 +369,7 @@ get_highest_unit_index_cb (CoglPipelineLayer *layer,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_pipeline_fragend_fixed_end (CoglPipeline *pipeline,
|
||||
unsigned long pipelines_difference)
|
||||
{
|
||||
|
@ -200,7 +200,7 @@ get_layer_fragment_snippets (CoglPipelineLayer *layer)
|
||||
return &layer->big_state->fragment_snippets;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
has_replace_hook (CoglPipelineLayer *layer,
|
||||
CoglSnippetHook hook)
|
||||
{
|
||||
@ -213,7 +213,7 @@ has_replace_hook (CoglPipelineLayer *layer,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_pipeline_fragend_glsl_start (CoglPipeline *pipeline,
|
||||
int n_layers,
|
||||
unsigned long pipelines_difference,
|
||||
@ -581,7 +581,7 @@ add_arg (CoglPipelineShaderState *shader_state,
|
||||
|
||||
if (other_layer == NULL)
|
||||
{
|
||||
static gboolean warning_seen = FALSE;
|
||||
static CoglBool warning_seen = FALSE;
|
||||
if (!warning_seen)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_pipeline_fragend_glsl_add_layer (CoglPipeline *pipeline,
|
||||
CoglPipelineLayer *layer,
|
||||
unsigned long layers_difference)
|
||||
@ -998,7 +998,7 @@ add_alpha_test_snippet (CoglPipeline *pipeline,
|
||||
|
||||
#endif /* HAVE_COGL_GLES2 */
|
||||
|
||||
static gboolean
|
||||
static CoglBool
|
||||
_cogl_pipeline_fragend_glsl_end (CoglPipeline *pipeline,
|
||||
unsigned long pipelines_difference)
|
||||
{
|
||||
|
@ -187,7 +187,7 @@ typedef struct
|
||||
/* The texture matrix dscribes how to transform texture coordinates */
|
||||
CoglMatrix matrix;
|
||||
|
||||
gboolean point_sprite_coords;
|
||||
CoglBool point_sprite_coords;
|
||||
|
||||
CoglPipelineSnippetList vertex_snippets;
|
||||
CoglPipelineSnippetList fragment_snippets;
|
||||
@ -262,7 +262,7 @@ struct _CoglPipelineLayer
|
||||
|
||||
};
|
||||
|
||||
typedef gboolean
|
||||
typedef CoglBool
|
||||
(*CoglPipelineLayerStateComparitor) (CoglPipelineLayer *authority0,
|
||||
CoglPipelineLayer *authority1);
|
||||
|
||||
@ -286,7 +286,7 @@ _cogl_pipeline_layer_resolve_authorities (CoglPipelineLayer *layer,
|
||||
unsigned long differences,
|
||||
CoglPipelineLayer **authorities);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_pipeline_layer_equal (CoglPipelineLayer *layer0,
|
||||
CoglPipelineLayer *layer1,
|
||||
unsigned long differences_mask,
|
||||
@ -300,10 +300,10 @@ _cogl_pipeline_layer_pre_change_notify (CoglPipeline *required_owner,
|
||||
void
|
||||
_cogl_pipeline_layer_prune_redundant_ancestry (CoglPipelineLayer *layer);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_pipeline_layer_has_alpha (CoglPipelineLayer *layer);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_pipeline_layer_has_user_matrix (CoglPipeline *pipeline,
|
||||
int layer_index);
|
||||
|
||||
@ -380,7 +380,7 @@ _cogl_pipeline_layer_get_texture (CoglPipelineLayer *layer);
|
||||
int
|
||||
_cogl_pipeline_layer_get_unit_index (CoglPipelineLayer *layer);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_pipeline_layer_needs_combine_separate
|
||||
(CoglPipelineLayer *combine_authority);
|
||||
|
||||
|
@ -44,41 +44,41 @@ CoglPipelineFilter
|
||||
_cogl_pipeline_get_layer_mag_filter (CoglPipeline *pipeline,
|
||||
int layer_index);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_pipeline_layer_texture_type_equal (CoglPipelineLayer *authority0,
|
||||
CoglPipelineLayer *authority1,
|
||||
CoglPipelineEvalFlags flags);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_pipeline_layer_texture_data_equal (CoglPipelineLayer *authority0,
|
||||
CoglPipelineLayer *authority1,
|
||||
CoglPipelineEvalFlags flags);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_pipeline_layer_combine_state_equal (CoglPipelineLayer *authority0,
|
||||
CoglPipelineLayer *authority1);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_pipeline_layer_combine_constant_equal (CoglPipelineLayer *authority0,
|
||||
CoglPipelineLayer *authority1);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_pipeline_layer_sampler_equal (CoglPipelineLayer *authority0,
|
||||
CoglPipelineLayer *authority1);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_pipeline_layer_user_matrix_equal (CoglPipelineLayer *authority0,
|
||||
CoglPipelineLayer *authority1);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_pipeline_layer_point_sprite_coords_equal (CoglPipelineLayer *authority0,
|
||||
CoglPipelineLayer *authority1);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_pipeline_layer_vertex_snippets_equal (CoglPipelineLayer *authority0,
|
||||
CoglPipelineLayer *authority1);
|
||||
|
||||
gboolean
|
||||
CoglBool
|
||||
_cogl_pipeline_layer_fragment_snippets_equal (CoglPipelineLayer *authority0,
|
||||
CoglPipelineLayer *authority1);
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user