mirror of
https://github.com/brl/mutter.git
synced 2025-02-17 21:54:10 +00:00
cogl: Drop _COGL_RETURN_IF_FAIL macro
This was introduced when the Cogl maintainers tried to move away from GLib. Since we always require it, we can just use `g_return_if_fail()` immediately. https://gitlab.gnome.org/GNOME/mutter/merge_requests/629
This commit is contained in:
parent
a2a114e79c
commit
576330edce
@ -138,7 +138,7 @@ void
|
|||||||
cogl_pango_font_map_set_resolution (CoglPangoFontMap *font_map,
|
cogl_pango_font_map_set_resolution (CoglPangoFontMap *font_map,
|
||||||
double dpi)
|
double dpi)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (COGL_PANGO_IS_FONT_MAP (font_map));
|
g_return_if_fail (COGL_PANGO_IS_FONT_MAP (font_map));
|
||||||
|
|
||||||
pango_cairo_font_map_set_resolution (PANGO_CAIRO_FONT_MAP (font_map), dpi);
|
pango_cairo_font_map_set_resolution (PANGO_CAIRO_FONT_MAP (font_map), dpi);
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ cogl_pango_renderer_draw_glyph (CoglPangoRenderer *priv,
|
|||||||
{
|
{
|
||||||
CoglPangoRendererSliceCbData data;
|
CoglPangoRendererSliceCbData data;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (priv->display_list != NULL);
|
g_return_if_fail (priv->display_list != NULL);
|
||||||
|
|
||||||
data.display_list = priv->display_list;
|
data.display_list = priv->display_list;
|
||||||
data.x1 = x1;
|
data.x1 = x1;
|
||||||
@ -577,7 +577,7 @@ cogl_pango_renderer_set_dirty_glyph (PangoFont *font,
|
|||||||
/* Glyphs that don't take up any space will end up without a
|
/* Glyphs that don't take up any space will end up without a
|
||||||
texture. These should never become dirty so they shouldn't end up
|
texture. These should never become dirty so they shouldn't end up
|
||||||
here */
|
here */
|
||||||
_COGL_RETURN_IF_FAIL (value->texture != NULL);
|
g_return_if_fail (value->texture != NULL);
|
||||||
|
|
||||||
if (_cogl_texture_get_format (value->texture) == COGL_PIXEL_FORMAT_A_8)
|
if (_cogl_texture_get_format (value->texture) == COGL_PIXEL_FORMAT_A_8)
|
||||||
{
|
{
|
||||||
@ -705,7 +705,7 @@ cogl_pango_ensure_glyph_cache_for_layout (PangoLayout *layout)
|
|||||||
context = pango_layout_get_context (layout);
|
context = pango_layout_get_context (layout);
|
||||||
priv = cogl_pango_get_renderer_from_context (context);
|
priv = cogl_pango_get_renderer_from_context (context);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (PANGO_IS_LAYOUT (layout));
|
g_return_if_fail (PANGO_IS_LAYOUT (layout));
|
||||||
|
|
||||||
if ((iter = pango_layout_get_iter (layout)) == NULL)
|
if ((iter = pango_layout_get_iter (layout)) == NULL)
|
||||||
return;
|
return;
|
||||||
@ -759,7 +759,7 @@ cogl_pango_renderer_draw_box (PangoRenderer *renderer,
|
|||||||
{
|
{
|
||||||
CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer);
|
CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (priv->display_list != NULL);
|
g_return_if_fail (priv->display_list != NULL);
|
||||||
|
|
||||||
_cogl_pango_display_list_add_rectangle (priv->display_list,
|
_cogl_pango_display_list_add_rectangle (priv->display_list,
|
||||||
x,
|
x,
|
||||||
@ -803,7 +803,7 @@ cogl_pango_renderer_draw_rectangle (PangoRenderer *renderer,
|
|||||||
CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer);
|
CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer);
|
||||||
float x1, x2, y1, y2;
|
float x1, x2, y1, y2;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (priv->display_list != NULL);
|
g_return_if_fail (priv->display_list != NULL);
|
||||||
|
|
||||||
cogl_pango_renderer_set_color_for_part (renderer, part);
|
cogl_pango_renderer_set_color_for_part (renderer, part);
|
||||||
|
|
||||||
@ -830,7 +830,7 @@ cogl_pango_renderer_draw_trapezoid (PangoRenderer *renderer,
|
|||||||
{
|
{
|
||||||
CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer);
|
CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (priv->display_list != NULL);
|
g_return_if_fail (priv->display_list != NULL);
|
||||||
|
|
||||||
cogl_pango_renderer_set_color_for_part (renderer, part);
|
cogl_pango_renderer_set_color_for_part (renderer, part);
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ void
|
|||||||
cogl2_path_set_fill_rule (CoglPath *path,
|
cogl2_path_set_fill_rule (CoglPath *path,
|
||||||
CoglPathFillRule fill_rule)
|
CoglPathFillRule fill_rule)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
if (path->data->fill_rule != fill_rule)
|
if (path->data->fill_rule != fill_rule)
|
||||||
{
|
{
|
||||||
@ -225,9 +225,9 @@ _cogl_path_stroke_nodes (CoglPath *path,
|
|||||||
int path_num = 0;
|
int path_num = 0;
|
||||||
CoglPathNode *node;
|
CoglPathNode *node;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_framebuffer (framebuffer));
|
g_return_if_fail (cogl_is_framebuffer (framebuffer));
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
data = path->data;
|
data = path->data;
|
||||||
|
|
||||||
@ -392,7 +392,7 @@ _cogl_path_fill_nodes (CoglPath *path,
|
|||||||
void
|
void
|
||||||
cogl2_path_fill (CoglPath *path)
|
cogl2_path_fill (CoglPath *path)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
_cogl_path_fill_nodes (path,
|
_cogl_path_fill_nodes (path,
|
||||||
cogl_get_draw_framebuffer (),
|
cogl_get_draw_framebuffer (),
|
||||||
@ -407,7 +407,7 @@ cogl2_path_fill (CoglPath *path)
|
|||||||
void
|
void
|
||||||
cogl2_path_stroke (CoglPath *path)
|
cogl2_path_stroke (CoglPath *path)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
if (path->data->path_nodes->len == 0)
|
if (path->data->path_nodes->len == 0)
|
||||||
return;
|
return;
|
||||||
@ -424,7 +424,7 @@ cogl2_path_move_to (CoglPath *path,
|
|||||||
{
|
{
|
||||||
CoglPathData *data;
|
CoglPathData *data;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
_cogl_path_add_node (path, TRUE, x, y);
|
_cogl_path_add_node (path, TRUE, x, y);
|
||||||
|
|
||||||
@ -443,7 +443,7 @@ cogl2_path_rel_move_to (CoglPath *path,
|
|||||||
{
|
{
|
||||||
CoglPathData *data;
|
CoglPathData *data;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
data = path->data;
|
data = path->data;
|
||||||
|
|
||||||
@ -459,7 +459,7 @@ cogl2_path_line_to (CoglPath *path,
|
|||||||
{
|
{
|
||||||
CoglPathData *data;
|
CoglPathData *data;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
_cogl_path_add_node (path, FALSE, x, y);
|
_cogl_path_add_node (path, FALSE, x, y);
|
||||||
|
|
||||||
@ -476,7 +476,7 @@ cogl2_path_rel_line_to (CoglPath *path,
|
|||||||
{
|
{
|
||||||
CoglPathData *data;
|
CoglPathData *data;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
data = path->data;
|
data = path->data;
|
||||||
|
|
||||||
@ -488,7 +488,7 @@ cogl2_path_rel_line_to (CoglPath *path,
|
|||||||
void
|
void
|
||||||
cogl2_path_close (CoglPath *path)
|
cogl2_path_close (CoglPath *path)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
_cogl_path_add_node (path, FALSE, path->data->path_start.x,
|
_cogl_path_add_node (path, FALSE, path->data->path_start.x,
|
||||||
path->data->path_start.y);
|
path->data->path_start.y);
|
||||||
@ -514,7 +514,7 @@ cogl2_path_polyline (CoglPath *path,
|
|||||||
{
|
{
|
||||||
int c = 0;
|
int c = 0;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
cogl2_path_move_to (path, coords[0], coords[1]);
|
cogl2_path_move_to (path, coords[0], coords[1]);
|
||||||
|
|
||||||
@ -639,7 +639,7 @@ cogl2_path_arc (CoglPath *path,
|
|||||||
{
|
{
|
||||||
float angle_step = 10;
|
float angle_step = 10;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
/* it is documented that a move to is needed to create a freestanding
|
/* it is documented that a move to is needed to create a freestanding
|
||||||
* arc
|
* arc
|
||||||
@ -683,7 +683,7 @@ cogl2_path_ellipse (CoglPath *path,
|
|||||||
{
|
{
|
||||||
float angle_step = 10;
|
float angle_step = 10;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
/* FIXME: if shows to be slow might be optimized
|
/* FIXME: if shows to be slow might be optimized
|
||||||
* by mirroring just a quarter of it */
|
* by mirroring just a quarter of it */
|
||||||
@ -709,7 +709,7 @@ cogl2_path_round_rectangle (CoglPath *path,
|
|||||||
float inner_width = x_2 - x_1 - radius * 2;
|
float inner_width = x_2 - x_1 - radius * 2;
|
||||||
float inner_height = y_2 - y_1 - radius * 2;
|
float inner_height = y_2 - y_1 - radius * 2;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
cogl2_path_move_to (path, x_1, y_1 + radius);
|
cogl2_path_move_to (path, x_1, y_1 + radius);
|
||||||
_cogl_path_rel_arc (path,
|
_cogl_path_rel_arc (path,
|
||||||
@ -860,7 +860,7 @@ cogl2_path_curve_to (CoglPath *path,
|
|||||||
{
|
{
|
||||||
CoglBezCubic cubic;
|
CoglBezCubic cubic;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
/* Prepare cubic curve */
|
/* Prepare cubic curve */
|
||||||
cubic.p1 = path->data->path_pen;
|
cubic.p1 = path->data->path_pen;
|
||||||
@ -890,7 +890,7 @@ cogl2_path_rel_curve_to (CoglPath *path,
|
|||||||
{
|
{
|
||||||
CoglPathData *data;
|
CoglPathData *data;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
data = path->data;
|
data = path->data;
|
||||||
|
|
||||||
@ -1053,7 +1053,7 @@ cogl_rel_curve2_to (CoglPath *path,
|
|||||||
{
|
{
|
||||||
CoglPathData *data;
|
CoglPathData *data;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
data = path->data;
|
data = path->data;
|
||||||
|
|
||||||
@ -1579,9 +1579,9 @@ cogl_framebuffer_fill_path (CoglFramebuffer *framebuffer,
|
|||||||
CoglPipeline *pipeline,
|
CoglPipeline *pipeline,
|
||||||
CoglPath *path)
|
CoglPath *path)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_framebuffer (framebuffer));
|
g_return_if_fail (cogl_is_framebuffer (framebuffer));
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
_cogl_path_fill_nodes (path, framebuffer, pipeline, 0 /* flags */);
|
_cogl_path_fill_nodes (path, framebuffer, pipeline, 0 /* flags */);
|
||||||
}
|
}
|
||||||
@ -1591,9 +1591,9 @@ cogl_framebuffer_stroke_path (CoglFramebuffer *framebuffer,
|
|||||||
CoglPipeline *pipeline,
|
CoglPipeline *pipeline,
|
||||||
CoglPath *path)
|
CoglPath *path)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_framebuffer (framebuffer));
|
g_return_if_fail (cogl_is_framebuffer (framebuffer));
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_path (path));
|
g_return_if_fail (cogl_is_path (path));
|
||||||
|
|
||||||
_cogl_path_stroke_nodes (path, framebuffer, pipeline);
|
_cogl_path_stroke_nodes (path, framebuffer, pipeline);
|
||||||
}
|
}
|
||||||
|
@ -490,7 +490,7 @@ void
|
|||||||
cogl_attribute_set_normalized (CoglAttribute *attribute,
|
cogl_attribute_set_normalized (CoglAttribute *attribute,
|
||||||
gboolean normalized)
|
gboolean normalized)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_attribute (attribute));
|
g_return_if_fail (cogl_is_attribute (attribute));
|
||||||
|
|
||||||
if (G_UNLIKELY (attribute->immutable_ref))
|
if (G_UNLIKELY (attribute->immutable_ref))
|
||||||
warn_about_midscene_changes ();
|
warn_about_midscene_changes ();
|
||||||
@ -511,8 +511,8 @@ void
|
|||||||
cogl_attribute_set_buffer (CoglAttribute *attribute,
|
cogl_attribute_set_buffer (CoglAttribute *attribute,
|
||||||
CoglAttributeBuffer *attribute_buffer)
|
CoglAttributeBuffer *attribute_buffer)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_attribute (attribute));
|
g_return_if_fail (cogl_is_attribute (attribute));
|
||||||
_COGL_RETURN_IF_FAIL (attribute->is_buffered);
|
g_return_if_fail (attribute->is_buffered);
|
||||||
|
|
||||||
if (G_UNLIKELY (attribute->immutable_ref))
|
if (G_UNLIKELY (attribute->immutable_ref))
|
||||||
warn_about_midscene_changes ();
|
warn_about_midscene_changes ();
|
||||||
@ -540,8 +540,8 @@ _cogl_attribute_immutable_unref (CoglAttribute *attribute)
|
|||||||
{
|
{
|
||||||
CoglBuffer *buffer = COGL_BUFFER (attribute->d.buffered.attribute_buffer);
|
CoglBuffer *buffer = COGL_BUFFER (attribute->d.buffered.attribute_buffer);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_attribute (attribute));
|
g_return_if_fail (cogl_is_attribute (attribute));
|
||||||
_COGL_RETURN_IF_FAIL (attribute->immutable_ref > 0);
|
g_return_if_fail (attribute->immutable_ref > 0);
|
||||||
|
|
||||||
attribute->immutable_ref--;
|
attribute->immutable_ref--;
|
||||||
_cogl_buffer_immutable_unref (buffer);
|
_cogl_buffer_immutable_unref (buffer);
|
||||||
|
@ -409,7 +409,7 @@ _cogl_blit_begin (CoglBlitData *data,
|
|||||||
_cogl_blit_modes[i].name);
|
_cogl_blit_modes[i].name);
|
||||||
|
|
||||||
/* The last blit mode can't fail so this should never happen */
|
/* The last blit mode can't fail so this should never happen */
|
||||||
_COGL_RETURN_IF_FAIL (i < G_N_ELEMENTS (_cogl_blit_modes));
|
g_return_if_fail (i < G_N_ELEMENTS (_cogl_blit_modes));
|
||||||
}
|
}
|
||||||
|
|
||||||
data->blit_mode = _cogl_blit_default_mode;
|
data->blit_mode = _cogl_blit_default_mode;
|
||||||
|
@ -167,8 +167,8 @@ _cogl_buffer_initialize (CoglBuffer *buffer,
|
|||||||
void
|
void
|
||||||
_cogl_buffer_fini (CoglBuffer *buffer)
|
_cogl_buffer_fini (CoglBuffer *buffer)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (!(buffer->flags & COGL_BUFFER_FLAG_MAPPED));
|
g_return_if_fail (!(buffer->flags & COGL_BUFFER_FLAG_MAPPED));
|
||||||
_COGL_RETURN_IF_FAIL (buffer->immutable_ref == 0);
|
g_return_if_fail (buffer->immutable_ref == 0);
|
||||||
|
|
||||||
if (buffer->flags & COGL_BUFFER_FLAG_BUFFER_OBJECT)
|
if (buffer->flags & COGL_BUFFER_FLAG_BUFFER_OBJECT)
|
||||||
buffer->context->driver_vtable->buffer_destroy (buffer);
|
buffer->context->driver_vtable->buffer_destroy (buffer);
|
||||||
@ -328,7 +328,7 @@ _cogl_buffer_unmap_for_fill_or_fallback (CoglBuffer *buffer)
|
|||||||
{
|
{
|
||||||
CoglContext *ctx = buffer->context;
|
CoglContext *ctx = buffer->context;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (ctx->buffer_map_fallback_in_use);
|
g_return_if_fail (ctx->buffer_map_fallback_in_use);
|
||||||
|
|
||||||
ctx->buffer_map_fallback_in_use = FALSE;
|
ctx->buffer_map_fallback_in_use = FALSE;
|
||||||
|
|
||||||
@ -401,8 +401,8 @@ _cogl_buffer_immutable_ref (CoglBuffer *buffer)
|
|||||||
void
|
void
|
||||||
_cogl_buffer_immutable_unref (CoglBuffer *buffer)
|
_cogl_buffer_immutable_unref (CoglBuffer *buffer)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_buffer (buffer));
|
g_return_if_fail (cogl_is_buffer (buffer));
|
||||||
_COGL_RETURN_IF_FAIL (buffer->immutable_ref > 0);
|
g_return_if_fail (buffer->immutable_ref > 0);
|
||||||
|
|
||||||
buffer->immutable_ref--;
|
buffer->immutable_ref--;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ cogl_color_init_from_4ub (CoglColor *color,
|
|||||||
uint8_t blue,
|
uint8_t blue,
|
||||||
uint8_t alpha)
|
uint8_t alpha)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (color != NULL);
|
g_return_if_fail (color != NULL);
|
||||||
|
|
||||||
color->red = red;
|
color->red = red;
|
||||||
color->green = green;
|
color->green = green;
|
||||||
@ -94,7 +94,7 @@ cogl_color_init_from_4f (CoglColor *color,
|
|||||||
float blue,
|
float blue,
|
||||||
float alpha)
|
float alpha)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (color != NULL);
|
g_return_if_fail (color != NULL);
|
||||||
|
|
||||||
color->red = (red * 255);
|
color->red = (red * 255);
|
||||||
color->green = (green * 255);
|
color->green = (green * 255);
|
||||||
@ -117,7 +117,7 @@ void
|
|||||||
cogl_color_init_from_4fv (CoglColor *color,
|
cogl_color_init_from_4fv (CoglColor *color,
|
||||||
const float *color_array)
|
const float *color_array)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (color != NULL);
|
g_return_if_fail (color != NULL);
|
||||||
|
|
||||||
color->red = (color_array[0] * 255);
|
color->red = (color_array[0] * 255);
|
||||||
color->green = (color_array[1] * 255);
|
color->green = (color_array[1] * 255);
|
||||||
|
@ -52,7 +52,7 @@ void
|
|||||||
cogl_depth_state_set_test_enabled (CoglDepthState *state,
|
cogl_depth_state_set_test_enabled (CoglDepthState *state,
|
||||||
gboolean enabled)
|
gboolean enabled)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC);
|
g_return_if_fail (state->magic == COGL_DEPTH_STATE_MAGIC);
|
||||||
state->test_enabled = enabled;
|
state->test_enabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ void
|
|||||||
cogl_depth_state_set_write_enabled (CoglDepthState *state,
|
cogl_depth_state_set_write_enabled (CoglDepthState *state,
|
||||||
gboolean enabled)
|
gboolean enabled)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC);
|
g_return_if_fail (state->magic == COGL_DEPTH_STATE_MAGIC);
|
||||||
state->write_enabled = enabled;
|
state->write_enabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ void
|
|||||||
cogl_depth_state_set_test_function (CoglDepthState *state,
|
cogl_depth_state_set_test_function (CoglDepthState *state,
|
||||||
CoglDepthTestFunction function)
|
CoglDepthTestFunction function)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC);
|
g_return_if_fail (state->magic == COGL_DEPTH_STATE_MAGIC);
|
||||||
state->test_function = function;
|
state->test_function = function;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ cogl_depth_state_set_range (CoglDepthState *state,
|
|||||||
float near,
|
float near,
|
||||||
float far)
|
float far)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC);
|
g_return_if_fail (state->magic == COGL_DEPTH_STATE_MAGIC);
|
||||||
state->range_near = near;
|
state->range_near = near;
|
||||||
state->range_far = far;
|
state->range_far = far;
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ cogl_depth_state_get_range (CoglDepthState *state,
|
|||||||
float *near_out,
|
float *near_out,
|
||||||
float *far_out)
|
float *far_out)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC);
|
g_return_if_fail (state->magic == COGL_DEPTH_STATE_MAGIC);
|
||||||
*near_out = state->range_near;
|
*near_out = state->range_near;
|
||||||
*far_out = state->range_far;
|
*far_out = state->range_far;
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ void
|
|||||||
cogl_display_set_onscreen_template (CoglDisplay *display,
|
cogl_display_set_onscreen_template (CoglDisplay *display,
|
||||||
CoglOnscreenTemplate *onscreen_template)
|
CoglOnscreenTemplate *onscreen_template)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (display->setup == FALSE);
|
g_return_if_fail (display->setup == FALSE);
|
||||||
|
|
||||||
if (onscreen_template)
|
if (onscreen_template)
|
||||||
cogl_object_ref (onscreen_template);
|
cogl_object_ref (onscreen_template);
|
||||||
@ -158,7 +158,7 @@ void
|
|||||||
cogl_wayland_display_set_compositor_display (CoglDisplay *display,
|
cogl_wayland_display_set_compositor_display (CoglDisplay *display,
|
||||||
struct wl_display *wayland_display)
|
struct wl_display *wayland_display)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (display->setup == FALSE);
|
g_return_if_fail (display->setup == FALSE);
|
||||||
|
|
||||||
display->wayland_compositor_display = wayland_display;
|
display->wayland_compositor_display = wayland_display;
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ void
|
|||||||
_cogl_propagate_error (CoglError **dest,
|
_cogl_propagate_error (CoglError **dest,
|
||||||
CoglError *src)
|
CoglError *src)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (src != NULL);
|
g_return_if_fail (src != NULL);
|
||||||
|
|
||||||
if (dest == NULL)
|
if (dest == NULL)
|
||||||
{
|
{
|
||||||
|
@ -445,11 +445,11 @@ ensure_size_initialized (CoglFramebuffer *framebuffer)
|
|||||||
{
|
{
|
||||||
/* Currently we assume the size is always initialized for
|
/* Currently we assume the size is always initialized for
|
||||||
* onscreen framebuffers. */
|
* onscreen framebuffers. */
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_offscreen (framebuffer));
|
g_return_if_fail (cogl_is_offscreen (framebuffer));
|
||||||
|
|
||||||
/* We also assume the size would have been initialized if the
|
/* We also assume the size would have been initialized if the
|
||||||
* framebuffer were allocated. */
|
* framebuffer were allocated. */
|
||||||
_COGL_RETURN_IF_FAIL (!framebuffer->allocated);
|
g_return_if_fail (!framebuffer->allocated);
|
||||||
|
|
||||||
cogl_framebuffer_allocate (framebuffer, NULL);
|
cogl_framebuffer_allocate (framebuffer, NULL);
|
||||||
}
|
}
|
||||||
@ -493,7 +493,7 @@ cogl_framebuffer_set_viewport (CoglFramebuffer *framebuffer,
|
|||||||
{
|
{
|
||||||
CoglContext *context = framebuffer->context;
|
CoglContext *context = framebuffer->context;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (width > 0 && height > 0);
|
g_return_if_fail (width > 0 && height > 0);
|
||||||
|
|
||||||
if (framebuffer->viewport_x == x &&
|
if (framebuffer->viewport_x == x &&
|
||||||
framebuffer->viewport_y == y &&
|
framebuffer->viewport_y == y &&
|
||||||
@ -1069,7 +1069,7 @@ void
|
|||||||
cogl_framebuffer_set_depth_texture_enabled (CoglFramebuffer *framebuffer,
|
cogl_framebuffer_set_depth_texture_enabled (CoglFramebuffer *framebuffer,
|
||||||
gboolean enabled)
|
gboolean enabled)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (!framebuffer->allocated);
|
g_return_if_fail (!framebuffer->allocated);
|
||||||
|
|
||||||
framebuffer->config.depth_texture_enabled = enabled;
|
framebuffer->config.depth_texture_enabled = enabled;
|
||||||
}
|
}
|
||||||
@ -1104,7 +1104,7 @@ void
|
|||||||
cogl_framebuffer_set_samples_per_pixel (CoglFramebuffer *framebuffer,
|
cogl_framebuffer_set_samples_per_pixel (CoglFramebuffer *framebuffer,
|
||||||
int samples_per_pixel)
|
int samples_per_pixel)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (!framebuffer->allocated);
|
g_return_if_fail (!framebuffer->allocated);
|
||||||
|
|
||||||
framebuffer->config.samples_per_pixel = samples_per_pixel;
|
framebuffer->config.samples_per_pixel = samples_per_pixel;
|
||||||
}
|
}
|
||||||
@ -1355,16 +1355,16 @@ _cogl_blit_framebuffer (CoglFramebuffer *src,
|
|||||||
{
|
{
|
||||||
CoglContext *ctx = src->context;
|
CoglContext *ctx = src->context;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (_cogl_has_private_feature
|
g_return_if_fail (_cogl_has_private_feature
|
||||||
(ctx, COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT));
|
(ctx, COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT));
|
||||||
|
|
||||||
/* We can only support blitting between offscreen buffers because
|
/* We can only support blitting between offscreen buffers because
|
||||||
otherwise we would need to mirror the image and GLES2.0 doesn't
|
otherwise we would need to mirror the image and GLES2.0 doesn't
|
||||||
support this */
|
support this */
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_offscreen (src));
|
g_return_if_fail (cogl_is_offscreen (src));
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_offscreen (dest));
|
g_return_if_fail (cogl_is_offscreen (dest));
|
||||||
/* The buffers must be the same format */
|
/* The buffers must be the same format */
|
||||||
_COGL_RETURN_IF_FAIL (src->internal_format == dest->internal_format);
|
g_return_if_fail (src->internal_format == dest->internal_format);
|
||||||
|
|
||||||
/* Make sure the current framebuffers are bound. We explicitly avoid
|
/* Make sure the current framebuffers are bound. We explicitly avoid
|
||||||
flushing the clip state so we can bind our own empty state */
|
flushing the clip state so we can bind our own empty state */
|
||||||
@ -1399,7 +1399,7 @@ cogl_framebuffer_discard_buffers (CoglFramebuffer *framebuffer,
|
|||||||
{
|
{
|
||||||
CoglContext *ctx = framebuffer->context;
|
CoglContext *ctx = framebuffer->context;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (buffers & COGL_BUFFER_BIT_COLOR);
|
g_return_if_fail (buffers & COGL_BUFFER_BIT_COLOR);
|
||||||
|
|
||||||
ctx->driver_vtable->framebuffer_discard_buffers (framebuffer, buffers);
|
ctx->driver_vtable->framebuffer_discard_buffers (framebuffer, buffers);
|
||||||
}
|
}
|
||||||
|
@ -1923,7 +1923,7 @@ cogl_pop_gles2_context (CoglContext *ctx)
|
|||||||
CoglGLES2Context *gles2_ctx;
|
CoglGLES2Context *gles2_ctx;
|
||||||
const CoglWinsysVtable *winsys = ctx->display->renderer->winsys_vtable;
|
const CoglWinsysVtable *winsys = ctx->display->renderer->winsys_vtable;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (ctx->gles2_context_stack.length > 0);
|
g_return_if_fail (ctx->gles2_context_stack.length > 0);
|
||||||
|
|
||||||
g_queue_pop_tail (&ctx->gles2_context_stack);
|
g_queue_pop_tail (&ctx->gles2_context_stack);
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ void
|
|||||||
cogl_indices_set_offset (CoglIndices *indices,
|
cogl_indices_set_offset (CoglIndices *indices,
|
||||||
size_t offset)
|
size_t offset)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_indices (indices));
|
g_return_if_fail (cogl_is_indices (indices));
|
||||||
|
|
||||||
if (G_UNLIKELY (indices->immutable_ref))
|
if (G_UNLIKELY (indices->immutable_ref))
|
||||||
warn_about_midscene_changes ();
|
warn_about_midscene_changes ();
|
||||||
@ -177,8 +177,8 @@ _cogl_indices_immutable_ref (CoglIndices *indices)
|
|||||||
void
|
void
|
||||||
_cogl_indices_immutable_unref (CoglIndices *indices)
|
_cogl_indices_immutable_unref (CoglIndices *indices)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_indices (indices));
|
g_return_if_fail (cogl_is_indices (indices));
|
||||||
_COGL_RETURN_IF_FAIL (indices->immutable_ref > 0);
|
g_return_if_fail (indices->immutable_ref > 0);
|
||||||
|
|
||||||
indices->immutable_ref--;
|
indices->immutable_ref--;
|
||||||
_cogl_buffer_immutable_unref (COGL_BUFFER (indices->buffer));
|
_cogl_buffer_immutable_unref (COGL_BUFFER (indices->buffer));
|
||||||
|
@ -396,10 +396,10 @@ cogl_matrix_stack_pop (CoglMatrixStack *stack)
|
|||||||
CoglMatrixEntry *old_top;
|
CoglMatrixEntry *old_top;
|
||||||
CoglMatrixEntry *new_top;
|
CoglMatrixEntry *new_top;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (stack != NULL);
|
g_return_if_fail (stack != NULL);
|
||||||
|
|
||||||
old_top = stack->last_entry;
|
old_top = stack->last_entry;
|
||||||
_COGL_RETURN_IF_FAIL (old_top != NULL);
|
g_return_if_fail (old_top != NULL);
|
||||||
|
|
||||||
/* To pop we are moving the top of the stack to the old top's parent
|
/* To pop we are moving the top of the stack to the old top's parent
|
||||||
* node. The stack always needs to have a reference to the top entry
|
* node. The stack always needs to have a reference to the top entry
|
||||||
|
@ -376,7 +376,7 @@ _cogl_matrix_prefix_print (const char *prefix, const CoglMatrix *matrix)
|
|||||||
{
|
{
|
||||||
if (!(matrix->flags & MAT_DIRTY_TYPE))
|
if (!(matrix->flags & MAT_DIRTY_TYPE))
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (matrix->type < COGL_MATRIX_N_TYPES);
|
g_return_if_fail (matrix->type < COGL_MATRIX_N_TYPES);
|
||||||
g_print ("%sMatrix type: %s, flags: %x\n",
|
g_print ("%sMatrix type: %s, flags: %x\n",
|
||||||
prefix, types[matrix->type], (int)matrix->flags);
|
prefix, types[matrix->type], (int)matrix->flags);
|
||||||
}
|
}
|
||||||
@ -2167,7 +2167,7 @@ cogl_matrix_transform_points (const CoglMatrix *matrix,
|
|||||||
int n_points)
|
int n_points)
|
||||||
{
|
{
|
||||||
/* The results of transforming always have three components... */
|
/* The results of transforming always have three components... */
|
||||||
_COGL_RETURN_IF_FAIL (stride_out >= sizeof (Point3f));
|
g_return_if_fail (stride_out >= sizeof (Point3f));
|
||||||
|
|
||||||
if (n_components == 2)
|
if (n_components == 2)
|
||||||
_cogl_matrix_transform_points_f2 (matrix,
|
_cogl_matrix_transform_points_f2 (matrix,
|
||||||
@ -2176,7 +2176,7 @@ cogl_matrix_transform_points (const CoglMatrix *matrix,
|
|||||||
n_points);
|
n_points);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (n_components == 3);
|
g_return_if_fail (n_components == 3);
|
||||||
|
|
||||||
_cogl_matrix_transform_points_f3 (matrix,
|
_cogl_matrix_transform_points_f3 (matrix,
|
||||||
stride_in, points_in,
|
stride_in, points_in,
|
||||||
@ -2206,7 +2206,7 @@ cogl_matrix_project_points (const CoglMatrix *matrix,
|
|||||||
n_points);
|
n_points);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (n_components == 4);
|
g_return_if_fail (n_components == 4);
|
||||||
|
|
||||||
_cogl_matrix_project_points_f4 (matrix,
|
_cogl_matrix_project_points_f4 (matrix,
|
||||||
stride_in, points_in,
|
stride_in, points_in,
|
||||||
|
@ -84,7 +84,7 @@ _cogl_pipeline_node_unparent_real (CoglNode *node)
|
|||||||
if (parent == NULL)
|
if (parent == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (!_cogl_list_empty (&parent->children));
|
g_return_if_fail (!_cogl_list_empty (&parent->children));
|
||||||
|
|
||||||
_cogl_list_remove (&node->link);
|
_cogl_list_remove (&node->link);
|
||||||
|
|
||||||
|
@ -63,8 +63,8 @@ _cogl_object_default_unref (void *object)
|
|||||||
{
|
{
|
||||||
CoglObject *obj = object;
|
CoglObject *obj = object;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (object != NULL);
|
g_return_if_fail (object != NULL);
|
||||||
_COGL_RETURN_IF_FAIL (obj->ref_count > 0);
|
g_return_if_fail (obj->ref_count > 0);
|
||||||
|
|
||||||
if (--obj->ref_count < 1)
|
if (--obj->ref_count < 1)
|
||||||
{
|
{
|
||||||
@ -109,7 +109,7 @@ cogl_object_unref (void *obj)
|
|||||||
{
|
{
|
||||||
void (* unref_func) (void *);
|
void (* unref_func) (void *);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (obj != NULL);
|
g_return_if_fail (obj != NULL);
|
||||||
|
|
||||||
unref_func = ((CoglObject *) obj)->klass->virt_unref;
|
unref_func = ((CoglObject *) obj)->klass->virt_unref;
|
||||||
unref_func (obj);
|
unref_func (obj);
|
||||||
|
@ -165,7 +165,7 @@ _cogl_onscreen_free (CoglOnscreen *onscreen)
|
|||||||
framebuffer->context->window_buffer = NULL;
|
framebuffer->context->window_buffer = NULL;
|
||||||
|
|
||||||
winsys->onscreen_deinit (onscreen);
|
winsys->onscreen_deinit (onscreen);
|
||||||
_COGL_RETURN_IF_FAIL (onscreen->winsys == NULL);
|
g_return_if_fail (onscreen->winsys == NULL);
|
||||||
|
|
||||||
/* Chain up to parent */
|
/* Chain up to parent */
|
||||||
_cogl_framebuffer_free (framebuffer);
|
_cogl_framebuffer_free (framebuffer);
|
||||||
@ -304,7 +304,7 @@ cogl_onscreen_swap_buffers_with_damage (CoglOnscreen *onscreen,
|
|||||||
const CoglWinsysVtable *winsys;
|
const CoglWinsysVtable *winsys;
|
||||||
CoglFrameInfo *info;
|
CoglFrameInfo *info;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (framebuffer->type == COGL_FRAMEBUFFER_TYPE_ONSCREEN);
|
g_return_if_fail (framebuffer->type == COGL_FRAMEBUFFER_TYPE_ONSCREEN);
|
||||||
|
|
||||||
info = _cogl_frame_info_new ();
|
info = _cogl_frame_info_new ();
|
||||||
info->frame_counter = onscreen->frame_counter;
|
info->frame_counter = onscreen->frame_counter;
|
||||||
@ -354,7 +354,7 @@ cogl_onscreen_swap_region (CoglOnscreen *onscreen,
|
|||||||
const CoglWinsysVtable *winsys;
|
const CoglWinsysVtable *winsys;
|
||||||
CoglFrameInfo *info;
|
CoglFrameInfo *info;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (framebuffer->type == COGL_FRAMEBUFFER_TYPE_ONSCREEN);
|
g_return_if_fail (framebuffer->type == COGL_FRAMEBUFFER_TYPE_ONSCREEN);
|
||||||
|
|
||||||
info = _cogl_frame_info_new ();
|
info = _cogl_frame_info_new ();
|
||||||
info->frame_counter = onscreen->frame_counter;
|
info->frame_counter = onscreen->frame_counter;
|
||||||
@ -367,7 +367,7 @@ cogl_onscreen_swap_region (CoglOnscreen *onscreen,
|
|||||||
|
|
||||||
/* This should only be called if the winsys advertises
|
/* This should only be called if the winsys advertises
|
||||||
COGL_WINSYS_FEATURE_SWAP_REGION */
|
COGL_WINSYS_FEATURE_SWAP_REGION */
|
||||||
_COGL_RETURN_IF_FAIL (winsys->onscreen_swap_region != NULL);
|
g_return_if_fail (winsys->onscreen_swap_region != NULL);
|
||||||
|
|
||||||
winsys->onscreen_swap_region (COGL_ONSCREEN (framebuffer),
|
winsys->onscreen_swap_region (COGL_ONSCREEN (framebuffer),
|
||||||
rectangles,
|
rectangles,
|
||||||
@ -421,7 +421,7 @@ cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen,
|
|||||||
{
|
{
|
||||||
/* We don't wan't applications to get away with being lazy here and not
|
/* We don't wan't applications to get away with being lazy here and not
|
||||||
* passing an update callback... */
|
* passing an update callback... */
|
||||||
_COGL_RETURN_IF_FAIL (update);
|
g_return_if_fail (update);
|
||||||
|
|
||||||
onscreen->foreign_xid = xid;
|
onscreen->foreign_xid = xid;
|
||||||
onscreen->foreign_update_mask_callback = update;
|
onscreen->foreign_update_mask_callback = update;
|
||||||
@ -480,7 +480,7 @@ void
|
|||||||
cogl_onscreen_remove_frame_callback (CoglOnscreen *onscreen,
|
cogl_onscreen_remove_frame_callback (CoglOnscreen *onscreen,
|
||||||
CoglFrameClosure *closure)
|
CoglFrameClosure *closure)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (closure);
|
g_return_if_fail (closure);
|
||||||
|
|
||||||
_cogl_closure_disconnect (closure);
|
_cogl_closure_disconnect (closure);
|
||||||
}
|
}
|
||||||
@ -552,7 +552,7 @@ cogl_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen,
|
|||||||
CoglFrameClosure *closure = g_hash_table_lookup (ctx->swap_callback_closures,
|
CoglFrameClosure *closure = g_hash_table_lookup (ctx->swap_callback_closures,
|
||||||
GINT_TO_POINTER (id));
|
GINT_TO_POINTER (id));
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (closure);
|
g_return_if_fail (closure);
|
||||||
|
|
||||||
cogl_onscreen_remove_frame_callback (onscreen, closure);
|
cogl_onscreen_remove_frame_callback (onscreen, closure);
|
||||||
}
|
}
|
||||||
@ -692,7 +692,7 @@ void
|
|||||||
cogl_onscreen_remove_dirty_callback (CoglOnscreen *onscreen,
|
cogl_onscreen_remove_dirty_callback (CoglOnscreen *onscreen,
|
||||||
CoglOnscreenDirtyClosure *closure)
|
CoglOnscreenDirtyClosure *closure)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (closure);
|
g_return_if_fail (closure);
|
||||||
|
|
||||||
_cogl_closure_disconnect (closure);
|
_cogl_closure_disconnect (closure);
|
||||||
}
|
}
|
||||||
|
@ -313,7 +313,7 @@ cogl_pipeline_set_layer_wrap_mode_s (CoglPipeline *pipeline,
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
/* Note: this will ensure that the layer exists, creating one if it
|
/* Note: this will ensure that the layer exists, creating one if it
|
||||||
* doesn't already.
|
* doesn't already.
|
||||||
@ -355,7 +355,7 @@ cogl_pipeline_set_layer_wrap_mode_t (CoglPipeline *pipeline,
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
/* Note: this will ensure that the layer exists, creating one if it
|
/* Note: this will ensure that the layer exists, creating one if it
|
||||||
* doesn't already.
|
* doesn't already.
|
||||||
@ -409,7 +409,7 @@ cogl_pipeline_set_layer_wrap_mode_p (CoglPipeline *pipeline,
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
/* Note: this will ensure that the layer exists, creating one if it
|
/* Note: this will ensure that the layer exists, creating one if it
|
||||||
* doesn't already.
|
* doesn't already.
|
||||||
@ -451,7 +451,7 @@ cogl_pipeline_set_layer_wrap_mode (CoglPipeline *pipeline,
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
/* Note: this will ensure that the layer exists, creating one if it
|
/* Note: this will ensure that the layer exists, creating one if it
|
||||||
* doesn't already.
|
* doesn't already.
|
||||||
@ -799,9 +799,9 @@ cogl_pipeline_add_layer_snippet (CoglPipeline *pipeline,
|
|||||||
int layer_index,
|
int layer_index,
|
||||||
CoglSnippet *snippet)
|
CoglSnippet *snippet)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_snippet (snippet));
|
g_return_if_fail (cogl_is_snippet (snippet));
|
||||||
_COGL_RETURN_IF_FAIL (snippet->hook >= COGL_SNIPPET_FIRST_LAYER_HOOK);
|
g_return_if_fail (snippet->hook >= COGL_SNIPPET_FIRST_LAYER_HOOK);
|
||||||
|
|
||||||
if (snippet->hook < COGL_SNIPPET_FIRST_LAYER_FRAGMENT_HOOK)
|
if (snippet->hook < COGL_SNIPPET_FIRST_LAYER_FRAGMENT_HOOK)
|
||||||
_cogl_pipeline_layer_add_vertex_snippet (pipeline,
|
_cogl_pipeline_layer_add_vertex_snippet (pipeline,
|
||||||
@ -1140,7 +1140,7 @@ cogl_pipeline_set_layer_combine_constant (CoglPipeline *pipeline,
|
|||||||
CoglPipelineLayer *new;
|
CoglPipelineLayer *new;
|
||||||
float color_as_floats[4];
|
float color_as_floats[4];
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
/* Note: this will ensure that the layer exists, creating one if it
|
/* Note: this will ensure that the layer exists, creating one if it
|
||||||
* doesn't already.
|
* doesn't already.
|
||||||
@ -1223,7 +1223,7 @@ _cogl_pipeline_get_layer_combine_constant (CoglPipeline *pipeline,
|
|||||||
CoglPipelineLayer *layer;
|
CoglPipelineLayer *layer;
|
||||||
CoglPipelineLayer *authority;
|
CoglPipelineLayer *authority;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
/* Note: this will ensure that the layer exists, creating one if it
|
/* Note: this will ensure that the layer exists, creating one if it
|
||||||
* doesn't already.
|
* doesn't already.
|
||||||
@ -1268,7 +1268,7 @@ cogl_pipeline_set_layer_matrix (CoglPipeline *pipeline,
|
|||||||
CoglPipelineLayer *authority;
|
CoglPipelineLayer *authority;
|
||||||
CoglPipelineLayer *new;
|
CoglPipelineLayer *new;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
/* Note: this will ensure that the layer exists, creating one if it
|
/* Note: this will ensure that the layer exists, creating one if it
|
||||||
* doesn't already.
|
* doesn't already.
|
||||||
@ -1374,7 +1374,7 @@ _cogl_pipeline_get_layer_filters (CoglPipeline *pipeline,
|
|||||||
CoglPipelineLayer *layer;
|
CoglPipelineLayer *layer;
|
||||||
CoglPipelineLayer *authority;
|
CoglPipelineLayer *authority;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
layer = _cogl_pipeline_get_layer (pipeline, layer_index);
|
layer = _cogl_pipeline_get_layer (pipeline, layer_index);
|
||||||
|
|
||||||
@ -1451,9 +1451,9 @@ cogl_pipeline_set_layer_filters (CoglPipeline *pipeline,
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (mag_filter == COGL_PIPELINE_FILTER_NEAREST ||
|
g_return_if_fail (mag_filter == COGL_PIPELINE_FILTER_NEAREST ||
|
||||||
mag_filter == COGL_PIPELINE_FILTER_LINEAR);
|
mag_filter == COGL_PIPELINE_FILTER_LINEAR);
|
||||||
|
|
||||||
/* Note: this will ensure that the layer exists, creating one if it
|
/* Note: this will ensure that the layer exists, creating one if it
|
||||||
|
@ -375,7 +375,7 @@ cogl_pipeline_get_color (CoglPipeline *pipeline,
|
|||||||
{
|
{
|
||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority =
|
authority =
|
||||||
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_COLOR);
|
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_COLOR);
|
||||||
@ -401,7 +401,7 @@ cogl_pipeline_set_color (CoglPipeline *pipeline,
|
|||||||
CoglPipelineState state = COGL_PIPELINE_STATE_COLOR;
|
CoglPipelineState state = COGL_PIPELINE_STATE_COLOR;
|
||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority = _cogl_pipeline_get_authority (pipeline, state);
|
authority = _cogl_pipeline_get_authority (pipeline, state);
|
||||||
|
|
||||||
@ -473,8 +473,8 @@ _cogl_pipeline_set_blend_enabled (CoglPipeline *pipeline,
|
|||||||
CoglPipelineState state = COGL_PIPELINE_STATE_BLEND_ENABLE;
|
CoglPipelineState state = COGL_PIPELINE_STATE_BLEND_ENABLE;
|
||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
_COGL_RETURN_IF_FAIL (enable > 1 &&
|
g_return_if_fail (enable > 1 &&
|
||||||
"don't pass TRUE or FALSE to _set_blend_enabled!");
|
"don't pass TRUE or FALSE to _set_blend_enabled!");
|
||||||
|
|
||||||
authority = _cogl_pipeline_get_authority (pipeline, state);
|
authority = _cogl_pipeline_get_authority (pipeline, state);
|
||||||
@ -503,7 +503,7 @@ cogl_pipeline_get_ambient (CoglPipeline *pipeline,
|
|||||||
{
|
{
|
||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority =
|
authority =
|
||||||
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LIGHTING);
|
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LIGHTING);
|
||||||
@ -520,7 +520,7 @@ cogl_pipeline_set_ambient (CoglPipeline *pipeline,
|
|||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
CoglPipelineLightingState *lighting_state;
|
CoglPipelineLightingState *lighting_state;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority = _cogl_pipeline_get_authority (pipeline, state);
|
authority = _cogl_pipeline_get_authority (pipeline, state);
|
||||||
|
|
||||||
@ -553,7 +553,7 @@ cogl_pipeline_get_diffuse (CoglPipeline *pipeline,
|
|||||||
{
|
{
|
||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority =
|
authority =
|
||||||
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LIGHTING);
|
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LIGHTING);
|
||||||
@ -570,7 +570,7 @@ cogl_pipeline_set_diffuse (CoglPipeline *pipeline,
|
|||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
CoglPipelineLightingState *lighting_state;
|
CoglPipelineLightingState *lighting_state;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority = _cogl_pipeline_get_authority (pipeline, state);
|
authority = _cogl_pipeline_get_authority (pipeline, state);
|
||||||
|
|
||||||
@ -612,7 +612,7 @@ cogl_pipeline_get_specular (CoglPipeline *pipeline,
|
|||||||
{
|
{
|
||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority =
|
authority =
|
||||||
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LIGHTING);
|
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LIGHTING);
|
||||||
@ -628,7 +628,7 @@ cogl_pipeline_set_specular (CoglPipeline *pipeline, const CoglColor *specular)
|
|||||||
CoglPipelineState state = COGL_PIPELINE_STATE_LIGHTING;
|
CoglPipelineState state = COGL_PIPELINE_STATE_LIGHTING;
|
||||||
CoglPipelineLightingState *lighting_state;
|
CoglPipelineLightingState *lighting_state;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority = _cogl_pipeline_get_authority (pipeline, state);
|
authority = _cogl_pipeline_get_authority (pipeline, state);
|
||||||
|
|
||||||
@ -676,7 +676,7 @@ cogl_pipeline_set_shininess (CoglPipeline *pipeline,
|
|||||||
CoglPipelineState state = COGL_PIPELINE_STATE_LIGHTING;
|
CoglPipelineState state = COGL_PIPELINE_STATE_LIGHTING;
|
||||||
CoglPipelineLightingState *lighting_state;
|
CoglPipelineLightingState *lighting_state;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
if (shininess < 0.0)
|
if (shininess < 0.0)
|
||||||
{
|
{
|
||||||
@ -712,7 +712,7 @@ cogl_pipeline_get_emission (CoglPipeline *pipeline,
|
|||||||
{
|
{
|
||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority =
|
authority =
|
||||||
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LIGHTING);
|
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LIGHTING);
|
||||||
@ -728,7 +728,7 @@ cogl_pipeline_set_emission (CoglPipeline *pipeline, const CoglColor *emission)
|
|||||||
CoglPipelineState state = COGL_PIPELINE_STATE_LIGHTING;
|
CoglPipelineState state = COGL_PIPELINE_STATE_LIGHTING;
|
||||||
CoglPipelineLightingState *lighting_state;
|
CoglPipelineLightingState *lighting_state;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority = _cogl_pipeline_get_authority (pipeline, state);
|
authority = _cogl_pipeline_get_authority (pipeline, state);
|
||||||
|
|
||||||
@ -763,7 +763,7 @@ _cogl_pipeline_set_alpha_test_function (CoglPipeline *pipeline,
|
|||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
CoglPipelineAlphaFuncState *alpha_state;
|
CoglPipelineAlphaFuncState *alpha_state;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority = _cogl_pipeline_get_authority (pipeline, state);
|
authority = _cogl_pipeline_get_authority (pipeline, state);
|
||||||
|
|
||||||
@ -793,7 +793,7 @@ _cogl_pipeline_set_alpha_test_function_reference (CoglPipeline *pipeline,
|
|||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
CoglPipelineAlphaFuncState *alpha_state;
|
CoglPipelineAlphaFuncState *alpha_state;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority = _cogl_pipeline_get_authority (pipeline, state);
|
authority = _cogl_pipeline_get_authority (pipeline, state);
|
||||||
|
|
||||||
@ -1031,7 +1031,7 @@ cogl_pipeline_set_blend_constant (CoglPipeline *pipeline,
|
|||||||
{
|
{
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
if (!_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_BLEND_CONSTANT))
|
if (!_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_BLEND_CONSTANT))
|
||||||
return;
|
return;
|
||||||
@ -1092,7 +1092,7 @@ cogl_pipeline_set_user_program (CoglPipeline *pipeline,
|
|||||||
CoglPipelineState state = COGL_PIPELINE_STATE_USER_SHADER;
|
CoglPipelineState state = COGL_PIPELINE_STATE_USER_SHADER;
|
||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority = _cogl_pipeline_get_authority (pipeline, state);
|
authority = _cogl_pipeline_get_authority (pipeline, state);
|
||||||
|
|
||||||
@ -1186,7 +1186,7 @@ cogl_pipeline_get_depth_state (CoglPipeline *pipeline,
|
|||||||
{
|
{
|
||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority =
|
authority =
|
||||||
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_DEPTH);
|
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_DEPTH);
|
||||||
@ -1201,7 +1201,7 @@ _cogl_pipeline_set_fog_state (CoglPipeline *pipeline,
|
|||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
CoglPipelineFogState *current_fog_state;
|
CoglPipelineFogState *current_fog_state;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority = _cogl_pipeline_get_authority (pipeline, state);
|
authority = _cogl_pipeline_get_authority (pipeline, state);
|
||||||
|
|
||||||
@ -1236,7 +1236,7 @@ cogl_pipeline_set_cull_face_mode (CoglPipeline *pipeline,
|
|||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
CoglPipelineCullFaceState *cull_face_state;
|
CoglPipelineCullFaceState *cull_face_state;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority = _cogl_pipeline_get_authority (pipeline, state);
|
authority = _cogl_pipeline_get_authority (pipeline, state);
|
||||||
|
|
||||||
@ -1266,7 +1266,7 @@ cogl_pipeline_set_front_face_winding (CoglPipeline *pipeline,
|
|||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
CoglPipelineCullFaceState *cull_face_state;
|
CoglPipelineCullFaceState *cull_face_state;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority = _cogl_pipeline_get_authority (pipeline, state);
|
authority = _cogl_pipeline_get_authority (pipeline, state);
|
||||||
|
|
||||||
@ -1336,7 +1336,7 @@ _cogl_pipeline_set_non_zero_point_size (CoglPipeline *pipeline,
|
|||||||
CoglPipelineState state = COGL_PIPELINE_STATE_NON_ZERO_POINT_SIZE;
|
CoglPipelineState state = COGL_PIPELINE_STATE_NON_ZERO_POINT_SIZE;
|
||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority = _cogl_pipeline_get_authority (pipeline, state);
|
authority = _cogl_pipeline_get_authority (pipeline, state);
|
||||||
|
|
||||||
@ -1360,7 +1360,7 @@ cogl_pipeline_set_point_size (CoglPipeline *pipeline,
|
|||||||
CoglPipelineState state = COGL_PIPELINE_STATE_POINT_SIZE;
|
CoglPipelineState state = COGL_PIPELINE_STATE_POINT_SIZE;
|
||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority = _cogl_pipeline_get_authority (pipeline, state);
|
authority = _cogl_pipeline_get_authority (pipeline, state);
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ _cogl_pipeline_promote_weak_ancestors (CoglPipeline *strong)
|
|||||||
{
|
{
|
||||||
CoglNode *n;
|
CoglNode *n;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (!strong->is_weak);
|
g_return_if_fail (!strong->is_weak);
|
||||||
|
|
||||||
/* If the parent of strong is weak, then we want to promote it by
|
/* If the parent of strong is weak, then we want to promote it by
|
||||||
taking a reference on strong's grandparent. We don't need to take
|
taking a reference on strong's grandparent. We don't need to take
|
||||||
@ -298,7 +298,7 @@ _cogl_pipeline_revert_weak_ancestors (CoglPipeline *strong)
|
|||||||
{
|
{
|
||||||
CoglNode *n;
|
CoglNode *n;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (!strong->is_weak);
|
g_return_if_fail (!strong->is_weak);
|
||||||
|
|
||||||
/* This reverts the effect of calling
|
/* This reverts the effect of calling
|
||||||
_cogl_pipeline_promote_weak_ancestors */
|
_cogl_pipeline_promote_weak_ancestors */
|
||||||
@ -579,7 +579,7 @@ _cogl_pipeline_foreach_layer_internal (CoglPipeline *pipeline,
|
|||||||
|
|
||||||
for (i = 0, cont = TRUE; i < n_layers && cont == TRUE; i++)
|
for (i = 0, cont = TRUE; i < n_layers && cont == TRUE; i++)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (authority->layers_cache_dirty == FALSE);
|
g_return_if_fail (authority->layers_cache_dirty == FALSE);
|
||||||
cont = callback (authority->layers_cache[i], user_data);
|
cont = callback (authority->layers_cache[i], user_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1077,7 +1077,7 @@ _cogl_pipeline_init_multi_property_sparse_state (CoglPipeline *pipeline,
|
|||||||
{
|
{
|
||||||
CoglPipeline *authority;
|
CoglPipeline *authority;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (change & COGL_PIPELINE_STATE_ALL_SPARSE);
|
g_return_if_fail (change & COGL_PIPELINE_STATE_ALL_SPARSE);
|
||||||
|
|
||||||
if (!(change & COGL_PIPELINE_STATE_MULTI_PROPERTY))
|
if (!(change & COGL_PIPELINE_STATE_MULTI_PROPERTY))
|
||||||
return;
|
return;
|
||||||
@ -1420,7 +1420,7 @@ _cogl_pipeline_add_layer_difference (CoglPipeline *pipeline,
|
|||||||
CoglPipelineLayer *layer,
|
CoglPipelineLayer *layer,
|
||||||
gboolean inc_n_layers)
|
gboolean inc_n_layers)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (layer->owner == NULL);
|
g_return_if_fail (layer->owner == NULL);
|
||||||
|
|
||||||
layer->owner = pipeline;
|
layer->owner = pipeline;
|
||||||
cogl_object_ref (layer);
|
cogl_object_ref (layer);
|
||||||
@ -1816,7 +1816,7 @@ _cogl_pipeline_prune_empty_layer_difference (CoglPipeline *layers_authority,
|
|||||||
CoglPipelineLayerInfo layer_info;
|
CoglPipelineLayerInfo layer_info;
|
||||||
CoglPipeline *old_layers_authority;
|
CoglPipeline *old_layers_authority;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (link != NULL);
|
g_return_if_fail (link != NULL);
|
||||||
|
|
||||||
/* If the layer's parent doesn't have an owner then we can simply
|
/* If the layer's parent doesn't have an owner then we can simply
|
||||||
* take ownership ourselves and drop our reference on the empty
|
* take ownership ourselves and drop our reference on the empty
|
||||||
@ -2423,7 +2423,7 @@ cogl_pipeline_remove_layer (CoglPipeline *pipeline, int layer_index)
|
|||||||
CoglPipelineLayerInfo layer_info;
|
CoglPipelineLayerInfo layer_info;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
authority =
|
authority =
|
||||||
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LAYERS);
|
_cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LAYERS);
|
||||||
|
@ -95,7 +95,7 @@ cogl_poll_renderer_dispatch (CoglRenderer *renderer,
|
|||||||
{
|
{
|
||||||
GList *l, *next;
|
GList *l, *next;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_renderer (renderer));
|
g_return_if_fail (cogl_is_renderer (renderer));
|
||||||
|
|
||||||
_cogl_closure_list_invoke_no_args (&renderer->idle_closures);
|
_cogl_closure_list_invoke_no_args (&renderer->idle_closures);
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ cogl_primitive_texture_set_auto_mipmap (CoglPrimitiveTexture *primitive_texture,
|
|||||||
{
|
{
|
||||||
CoglTexture *texture;
|
CoglTexture *texture;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_primitive_texture (primitive_texture));
|
g_return_if_fail (cogl_is_primitive_texture (primitive_texture));
|
||||||
|
|
||||||
texture = COGL_TEXTURE (primitive_texture);
|
texture = COGL_TEXTURE (primitive_texture);
|
||||||
|
|
||||||
|
@ -414,7 +414,7 @@ cogl_primitive_set_attributes (CoglPrimitive *primitive,
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_primitive (primitive));
|
g_return_if_fail (cogl_is_primitive (primitive));
|
||||||
|
|
||||||
if (G_UNLIKELY (primitive->immutable_ref))
|
if (G_UNLIKELY (primitive->immutable_ref))
|
||||||
{
|
{
|
||||||
@ -427,7 +427,7 @@ cogl_primitive_set_attributes (CoglPrimitive *primitive,
|
|||||||
* attribute thats actually in the new list too. */
|
* attribute thats actually in the new list too. */
|
||||||
for (i = 0; i < n_attributes; i++)
|
for (i = 0; i < n_attributes; i++)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_attribute (attributes[i]));
|
g_return_if_fail (cogl_is_attribute (attributes[i]));
|
||||||
cogl_object_ref (attributes[i]);
|
cogl_object_ref (attributes[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -472,7 +472,7 @@ void
|
|||||||
cogl_primitive_set_first_vertex (CoglPrimitive *primitive,
|
cogl_primitive_set_first_vertex (CoglPrimitive *primitive,
|
||||||
int first_vertex)
|
int first_vertex)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_primitive (primitive));
|
g_return_if_fail (cogl_is_primitive (primitive));
|
||||||
|
|
||||||
if (G_UNLIKELY (primitive->immutable_ref))
|
if (G_UNLIKELY (primitive->immutable_ref))
|
||||||
{
|
{
|
||||||
@ -495,7 +495,7 @@ void
|
|||||||
cogl_primitive_set_n_vertices (CoglPrimitive *primitive,
|
cogl_primitive_set_n_vertices (CoglPrimitive *primitive,
|
||||||
int n_vertices)
|
int n_vertices)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_primitive (primitive));
|
g_return_if_fail (cogl_is_primitive (primitive));
|
||||||
|
|
||||||
primitive->n_vertices = n_vertices;
|
primitive->n_vertices = n_vertices;
|
||||||
}
|
}
|
||||||
@ -512,7 +512,7 @@ void
|
|||||||
cogl_primitive_set_mode (CoglPrimitive *primitive,
|
cogl_primitive_set_mode (CoglPrimitive *primitive,
|
||||||
CoglVerticesMode mode)
|
CoglVerticesMode mode)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_primitive (primitive));
|
g_return_if_fail (cogl_is_primitive (primitive));
|
||||||
|
|
||||||
if (G_UNLIKELY (primitive->immutable_ref))
|
if (G_UNLIKELY (primitive->immutable_ref))
|
||||||
{
|
{
|
||||||
@ -528,7 +528,7 @@ cogl_primitive_set_indices (CoglPrimitive *primitive,
|
|||||||
CoglIndices *indices,
|
CoglIndices *indices,
|
||||||
int n_indices)
|
int n_indices)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_primitive (primitive));
|
g_return_if_fail (cogl_is_primitive (primitive));
|
||||||
|
|
||||||
if (G_UNLIKELY (primitive->immutable_ref))
|
if (G_UNLIKELY (primitive->immutable_ref))
|
||||||
{
|
{
|
||||||
@ -586,8 +586,8 @@ _cogl_primitive_immutable_unref (CoglPrimitive *primitive)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_primitive (primitive));
|
g_return_if_fail (cogl_is_primitive (primitive));
|
||||||
_COGL_RETURN_IF_FAIL (primitive->immutable_ref > 0);
|
g_return_if_fail (primitive->immutable_ref > 0);
|
||||||
|
|
||||||
primitive->immutable_ref--;
|
primitive->immutable_ref--;
|
||||||
|
|
||||||
|
@ -447,7 +447,7 @@ cogl_quaternion_multiply (CoglQuaternion *result,
|
|||||||
float y = a->y;
|
float y = a->y;
|
||||||
float z = a->z;
|
float z = a->z;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (b != result);
|
g_return_if_fail (b != result);
|
||||||
|
|
||||||
result->w = w * b->w - x * b->x - y * b->y - z * b->z;
|
result->w = w * b->w - x * b->x - y * b->y - z * b->z;
|
||||||
|
|
||||||
@ -504,7 +504,7 @@ cogl_quaternion_slerp (CoglQuaternion *result,
|
|||||||
float fa;
|
float fa;
|
||||||
float fb;
|
float fb;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (t >=0 && t <= 1.0f);
|
g_return_if_fail (t >=0 && t <= 1.0f);
|
||||||
|
|
||||||
if (t == 0)
|
if (t == 0)
|
||||||
{
|
{
|
||||||
@ -591,7 +591,7 @@ cogl_quaternion_nlerp (CoglQuaternion *result,
|
|||||||
float fa;
|
float fa;
|
||||||
float fb;
|
float fb;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (t >=0 && t <= 1.0f);
|
g_return_if_fail (t >=0 && t <= 1.0f);
|
||||||
|
|
||||||
if (t == 0)
|
if (t == 0)
|
||||||
{
|
{
|
||||||
|
@ -228,10 +228,10 @@ void
|
|||||||
cogl_xlib_renderer_set_foreign_display (CoglRenderer *renderer,
|
cogl_xlib_renderer_set_foreign_display (CoglRenderer *renderer,
|
||||||
Display *xdisplay)
|
Display *xdisplay)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_renderer (renderer));
|
g_return_if_fail (cogl_is_renderer (renderer));
|
||||||
|
|
||||||
/* NB: Renderers are considered immutable once connected */
|
/* NB: Renderers are considered immutable once connected */
|
||||||
_COGL_RETURN_IF_FAIL (!renderer->connected);
|
g_return_if_fail (!renderer->connected);
|
||||||
|
|
||||||
renderer->foreign_xdpy = xdisplay;
|
renderer->foreign_xdpy = xdisplay;
|
||||||
|
|
||||||
@ -252,9 +252,9 @@ void
|
|||||||
cogl_xlib_renderer_set_event_retrieval_enabled (CoglRenderer *renderer,
|
cogl_xlib_renderer_set_event_retrieval_enabled (CoglRenderer *renderer,
|
||||||
gboolean enable)
|
gboolean enable)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_renderer (renderer));
|
g_return_if_fail (cogl_is_renderer (renderer));
|
||||||
/* NB: Renderers are considered immutable once connected */
|
/* NB: Renderers are considered immutable once connected */
|
||||||
_COGL_RETURN_IF_FAIL (!renderer->connected);
|
g_return_if_fail (!renderer->connected);
|
||||||
|
|
||||||
renderer->xlib_enable_event_retrieval = enable;
|
renderer->xlib_enable_event_retrieval = enable;
|
||||||
}
|
}
|
||||||
@ -263,8 +263,8 @@ void
|
|||||||
cogl_xlib_renderer_request_reset_on_video_memory_purge (CoglRenderer *renderer,
|
cogl_xlib_renderer_request_reset_on_video_memory_purge (CoglRenderer *renderer,
|
||||||
gboolean enable)
|
gboolean enable)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_renderer (renderer));
|
g_return_if_fail (cogl_is_renderer (renderer));
|
||||||
_COGL_RETURN_IF_FAIL (!renderer->connected);
|
g_return_if_fail (!renderer->connected);
|
||||||
|
|
||||||
renderer->xlib_want_reset_on_video_memory_purge = enable;
|
renderer->xlib_want_reset_on_video_memory_purge = enable;
|
||||||
}
|
}
|
||||||
@ -273,9 +273,9 @@ void
|
|||||||
cogl_xlib_renderer_set_threaded_swap_wait_enabled (CoglRenderer *renderer,
|
cogl_xlib_renderer_set_threaded_swap_wait_enabled (CoglRenderer *renderer,
|
||||||
gboolean enable)
|
gboolean enable)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_renderer (renderer));
|
g_return_if_fail (cogl_is_renderer (renderer));
|
||||||
/* NB: Renderers are considered immutable once connected */
|
/* NB: Renderers are considered immutable once connected */
|
||||||
_COGL_RETURN_IF_FAIL (!renderer->connected);
|
g_return_if_fail (!renderer->connected);
|
||||||
|
|
||||||
renderer->xlib_enable_threaded_swap_wait = enable;
|
renderer->xlib_enable_threaded_swap_wait = enable;
|
||||||
}
|
}
|
||||||
@ -751,7 +751,7 @@ void
|
|||||||
cogl_renderer_set_winsys_id (CoglRenderer *renderer,
|
cogl_renderer_set_winsys_id (CoglRenderer *renderer,
|
||||||
CoglWinsysID winsys_id)
|
CoglWinsysID winsys_id)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (!renderer->connected);
|
g_return_if_fail (!renderer->connected);
|
||||||
|
|
||||||
renderer->winsys_id_override = winsys_id;
|
renderer->winsys_id_override = winsys_id;
|
||||||
}
|
}
|
||||||
@ -810,7 +810,7 @@ void
|
|||||||
cogl_renderer_set_driver (CoglRenderer *renderer,
|
cogl_renderer_set_driver (CoglRenderer *renderer,
|
||||||
CoglDriver driver)
|
CoglDriver driver)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (!renderer->connected);
|
g_return_if_fail (!renderer->connected);
|
||||||
renderer->driver_override = driver;
|
renderer->driver_override = driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -829,8 +829,8 @@ cogl_renderer_foreach_output (CoglRenderer *renderer,
|
|||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (renderer->connected);
|
g_return_if_fail (renderer->connected);
|
||||||
_COGL_RETURN_IF_FAIL (callback != NULL);
|
g_return_if_fail (callback != NULL);
|
||||||
|
|
||||||
for (l = renderer->outputs; l; l = l->next)
|
for (l = renderer->outputs; l; l = l->next)
|
||||||
callback (l->data, user_data);
|
callback (l->data, user_data);
|
||||||
|
@ -88,7 +88,7 @@ void
|
|||||||
cogl_snippet_set_declarations (CoglSnippet *snippet,
|
cogl_snippet_set_declarations (CoglSnippet *snippet,
|
||||||
const char *declarations)
|
const char *declarations)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_snippet (snippet));
|
g_return_if_fail (cogl_is_snippet (snippet));
|
||||||
|
|
||||||
if (!_cogl_snippet_modify (snippet))
|
if (!_cogl_snippet_modify (snippet))
|
||||||
return;
|
return;
|
||||||
@ -109,7 +109,7 @@ void
|
|||||||
cogl_snippet_set_pre (CoglSnippet *snippet,
|
cogl_snippet_set_pre (CoglSnippet *snippet,
|
||||||
const char *pre)
|
const char *pre)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_snippet (snippet));
|
g_return_if_fail (cogl_is_snippet (snippet));
|
||||||
|
|
||||||
if (!_cogl_snippet_modify (snippet))
|
if (!_cogl_snippet_modify (snippet))
|
||||||
return;
|
return;
|
||||||
@ -130,7 +130,7 @@ void
|
|||||||
cogl_snippet_set_replace (CoglSnippet *snippet,
|
cogl_snippet_set_replace (CoglSnippet *snippet,
|
||||||
const char *replace)
|
const char *replace)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_snippet (snippet));
|
g_return_if_fail (cogl_is_snippet (snippet));
|
||||||
|
|
||||||
if (!_cogl_snippet_modify (snippet))
|
if (!_cogl_snippet_modify (snippet))
|
||||||
return;
|
return;
|
||||||
@ -151,7 +151,7 @@ void
|
|||||||
cogl_snippet_set_post (CoglSnippet *snippet,
|
cogl_snippet_set_post (CoglSnippet *snippet,
|
||||||
const char *post)
|
const char *post)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_snippet (snippet));
|
g_return_if_fail (cogl_is_snippet (snippet));
|
||||||
|
|
||||||
if (!_cogl_snippet_modify (snippet))
|
if (!_cogl_snippet_modify (snippet))
|
||||||
return;
|
return;
|
||||||
|
@ -79,7 +79,7 @@ _cogl_span_iter_begin (CoglSpanIter *iter,
|
|||||||
{
|
{
|
||||||
/* XXX: If CLAMP_TO_EDGE needs to be emulated then it needs to be
|
/* XXX: If CLAMP_TO_EDGE needs to be emulated then it needs to be
|
||||||
* done at a higher level than here... */
|
* done at a higher level than here... */
|
||||||
_COGL_RETURN_IF_FAIL (wrap_mode == COGL_PIPELINE_WRAP_MODE_REPEAT ||
|
g_return_if_fail (wrap_mode == COGL_PIPELINE_WRAP_MODE_REPEAT ||
|
||||||
wrap_mode == COGL_PIPELINE_WRAP_MODE_MIRRORED_REPEAT);
|
wrap_mode == COGL_PIPELINE_WRAP_MODE_MIRRORED_REPEAT);
|
||||||
|
|
||||||
iter->span = NULL;
|
iter->span = NULL;
|
||||||
|
@ -1337,7 +1337,7 @@ _cogl_texture_2d_sliced_gl_flush_legacy_texobj_filters (CoglTexture *tex,
|
|||||||
CoglTexture2D *slice_tex;
|
CoglTexture2D *slice_tex;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (tex_2ds->slice_textures != NULL);
|
g_return_if_fail (tex_2ds->slice_textures != NULL);
|
||||||
|
|
||||||
/* Apply new filters to every slice. The slice texture itself should
|
/* Apply new filters to every slice. The slice texture itself should
|
||||||
cache the value and avoid resubmitting the same filter value to
|
cache the value and avoid resubmitting the same filter value to
|
||||||
@ -1357,7 +1357,7 @@ _cogl_texture_2d_sliced_pre_paint (CoglTexture *tex,
|
|||||||
CoglTexture2DSliced *tex_2ds = COGL_TEXTURE_2D_SLICED (tex);
|
CoglTexture2DSliced *tex_2ds = COGL_TEXTURE_2D_SLICED (tex);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (tex_2ds->slice_textures != NULL);
|
g_return_if_fail (tex_2ds->slice_textures != NULL);
|
||||||
|
|
||||||
/* Pass the pre-paint on to every slice */
|
/* Pass the pre-paint on to every slice */
|
||||||
for (i = 0; i < tex_2ds->slice_textures->len; i++)
|
for (i = 0; i < tex_2ds->slice_textures->len; i++)
|
||||||
@ -1374,7 +1374,7 @@ _cogl_texture_2d_sliced_ensure_non_quad_rendering (CoglTexture *tex)
|
|||||||
CoglTexture2DSliced *tex_2ds = COGL_TEXTURE_2D_SLICED (tex);
|
CoglTexture2DSliced *tex_2ds = COGL_TEXTURE_2D_SLICED (tex);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (tex_2ds->slice_textures != NULL);
|
g_return_if_fail (tex_2ds->slice_textures != NULL);
|
||||||
|
|
||||||
/* Pass the call on to every slice */
|
/* Pass the call on to every slice */
|
||||||
for (i = 0; i < tex_2ds->slice_textures->len; i++)
|
for (i = 0; i < tex_2ds->slice_textures->len; i++)
|
||||||
|
@ -1192,7 +1192,7 @@ void
|
|||||||
cogl_texture_set_components (CoglTexture *texture,
|
cogl_texture_set_components (CoglTexture *texture,
|
||||||
CoglTextureComponents components)
|
CoglTextureComponents components)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (!texture->allocated);
|
g_return_if_fail (!texture->allocated);
|
||||||
|
|
||||||
if (texture->components == components)
|
if (texture->components == components)
|
||||||
return;
|
return;
|
||||||
@ -1210,7 +1210,7 @@ void
|
|||||||
cogl_texture_set_premultiplied (CoglTexture *texture,
|
cogl_texture_set_premultiplied (CoglTexture *texture,
|
||||||
gboolean premultiplied)
|
gboolean premultiplied)
|
||||||
{
|
{
|
||||||
_COGL_RETURN_IF_FAIL (!texture->allocated);
|
g_return_if_fail (!texture->allocated);
|
||||||
|
|
||||||
premultiplied = !!premultiplied;
|
premultiplied = !!premultiplied;
|
||||||
|
|
||||||
|
@ -124,7 +124,6 @@ _cogl_util_fls (unsigned int n)
|
|||||||
|
|
||||||
#define _cogl_util_popcountl __builtin_popcountl
|
#define _cogl_util_popcountl __builtin_popcountl
|
||||||
|
|
||||||
#define _COGL_RETURN_IF_FAIL(EXPR) g_return_if_fail(EXPR)
|
|
||||||
#define _COGL_RETURN_VAL_IF_FAIL(EXPR, VAL) g_return_val_if_fail(EXPR, VAL)
|
#define _COGL_RETURN_VAL_IF_FAIL(EXPR, VAL) g_return_val_if_fail(EXPR, VAL)
|
||||||
|
|
||||||
/* Match a CoglPixelFormat according to channel masks, color depth,
|
/* Match a CoglPixelFormat according to channel masks, color depth,
|
||||||
|
@ -556,7 +556,7 @@ cogl_push_source (void *material_or_pipeline)
|
|||||||
{
|
{
|
||||||
CoglPipeline *pipeline = COGL_PIPELINE (material_or_pipeline);
|
CoglPipeline *pipeline = COGL_PIPELINE (material_or_pipeline);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
_cogl_push_source (pipeline, TRUE);
|
_cogl_push_source (pipeline, TRUE);
|
||||||
}
|
}
|
||||||
@ -571,7 +571,7 @@ _cogl_push_source (CoglPipeline *pipeline, gboolean enable_legacy)
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
|
|
||||||
if (ctx->source_stack)
|
if (ctx->source_stack)
|
||||||
{
|
{
|
||||||
@ -596,7 +596,7 @@ cogl_pop_source (void)
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (ctx->source_stack);
|
g_return_if_fail (ctx->source_stack);
|
||||||
|
|
||||||
top = ctx->source_stack->data;
|
top = ctx->source_stack->data;
|
||||||
top->push_count--;
|
top->push_count--;
|
||||||
@ -644,8 +644,8 @@ cogl_set_source (void *material_or_pipeline)
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
|
g_return_if_fail (cogl_is_pipeline (pipeline));
|
||||||
_COGL_RETURN_IF_FAIL (ctx->source_stack);
|
g_return_if_fail (ctx->source_stack);
|
||||||
|
|
||||||
top = ctx->source_stack->data;
|
top = ctx->source_stack->data;
|
||||||
if (top->pipeline == pipeline && top->enable_legacy)
|
if (top->pipeline == pipeline && top->enable_legacy)
|
||||||
@ -672,7 +672,7 @@ cogl_set_source_texture (CoglTexture *texture)
|
|||||||
{
|
{
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (texture != NULL);
|
g_return_if_fail (texture != NULL);
|
||||||
|
|
||||||
cogl_pipeline_set_layer_texture (ctx->texture_pipeline, 0, texture);
|
cogl_pipeline_set_layer_texture (ctx->texture_pipeline, 0, texture);
|
||||||
cogl_set_source (ctx->texture_pipeline);
|
cogl_set_source (ctx->texture_pipeline);
|
||||||
|
@ -114,8 +114,8 @@ _cogl_set_framebuffers_real (CoglFramebuffer *draw_buffer,
|
|||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (ctx != NULL);
|
g_return_if_fail (ctx != NULL);
|
||||||
_COGL_RETURN_IF_FAIL (draw_buffer && read_buffer ?
|
g_return_if_fail (draw_buffer && read_buffer ?
|
||||||
draw_buffer->context == read_buffer->context : TRUE);
|
draw_buffer->context == read_buffer->context : TRUE);
|
||||||
|
|
||||||
entry = ctx->framebuffer_stack->data;
|
entry = ctx->framebuffer_stack->data;
|
||||||
@ -146,8 +146,8 @@ _cogl_set_framebuffers (CoglFramebuffer *draw_buffer,
|
|||||||
CoglFramebuffer *current_draw_buffer;
|
CoglFramebuffer *current_draw_buffer;
|
||||||
CoglFramebuffer *current_read_buffer;
|
CoglFramebuffer *current_read_buffer;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_framebuffer (draw_buffer));
|
g_return_if_fail (cogl_is_framebuffer (draw_buffer));
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_framebuffer (read_buffer));
|
g_return_if_fail (cogl_is_framebuffer (read_buffer));
|
||||||
|
|
||||||
current_draw_buffer = cogl_get_draw_framebuffer ();
|
current_draw_buffer = cogl_get_draw_framebuffer ();
|
||||||
current_read_buffer = _cogl_get_read_framebuffer ();
|
current_read_buffer = _cogl_get_read_framebuffer ();
|
||||||
@ -213,14 +213,14 @@ _cogl_push_framebuffers (CoglFramebuffer *draw_buffer,
|
|||||||
CoglContext *ctx;
|
CoglContext *ctx;
|
||||||
CoglFramebuffer *old_draw_buffer, *old_read_buffer;
|
CoglFramebuffer *old_draw_buffer, *old_read_buffer;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_framebuffer (draw_buffer));
|
g_return_if_fail (cogl_is_framebuffer (draw_buffer));
|
||||||
_COGL_RETURN_IF_FAIL (cogl_is_framebuffer (read_buffer));
|
g_return_if_fail (cogl_is_framebuffer (read_buffer));
|
||||||
|
|
||||||
ctx = draw_buffer->context;
|
ctx = draw_buffer->context;
|
||||||
_COGL_RETURN_IF_FAIL (ctx != NULL);
|
g_return_if_fail (ctx != NULL);
|
||||||
_COGL_RETURN_IF_FAIL (draw_buffer->context == read_buffer->context);
|
g_return_if_fail (draw_buffer->context == read_buffer->context);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (ctx->framebuffer_stack != NULL);
|
g_return_if_fail (ctx->framebuffer_stack != NULL);
|
||||||
|
|
||||||
/* Copy the top of the stack so that when we call cogl_set_framebuffer
|
/* Copy the top of the stack so that when we call cogl_set_framebuffer
|
||||||
it will still know what the old framebuffer was */
|
it will still know what the old framebuffer was */
|
||||||
|
@ -108,7 +108,7 @@ cogl_program_attach_shader (CoglHandle program_handle,
|
|||||||
shader = shader_handle;
|
shader = shader_handle;
|
||||||
|
|
||||||
if (shader->language == COGL_SHADER_LANGUAGE_GLSL)
|
if (shader->language == COGL_SHADER_LANGUAGE_GLSL)
|
||||||
_COGL_RETURN_IF_FAIL (_cogl_program_get_language (program) ==
|
g_return_if_fail (_cogl_program_get_language (program) ==
|
||||||
COGL_SHADER_LANGUAGE_GLSL);
|
COGL_SHADER_LANGUAGE_GLSL);
|
||||||
|
|
||||||
program->attached_shaders
|
program->attached_shaders
|
||||||
@ -131,7 +131,7 @@ cogl_program_use (CoglHandle handle)
|
|||||||
{
|
{
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (handle == COGL_INVALID_HANDLE ||
|
g_return_if_fail (handle == COGL_INVALID_HANDLE ||
|
||||||
cogl_is_program (handle));
|
cogl_is_program (handle));
|
||||||
|
|
||||||
if (ctx->current_program == 0 && handle != 0)
|
if (ctx->current_program == 0 && handle != 0)
|
||||||
|
@ -1171,7 +1171,7 @@ update_primitive_attributes (CoglVertexBuffer *buffer)
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (n_attributes > 0);
|
g_return_if_fail (n_attributes > 0);
|
||||||
|
|
||||||
attributes = g_alloca (sizeof (CoglAttribute *) * n_attributes);
|
attributes = g_alloca (sizeof (CoglAttribute *) * n_attributes);
|
||||||
|
|
||||||
|
@ -418,10 +418,10 @@ _cogl_buffer_gl_unbind (CoglBuffer *buffer)
|
|||||||
{
|
{
|
||||||
CoglContext *ctx = buffer->context;
|
CoglContext *ctx = buffer->context;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (buffer != NULL);
|
g_return_if_fail (buffer != NULL);
|
||||||
|
|
||||||
/* the unbind should pair up with a previous bind */
|
/* the unbind should pair up with a previous bind */
|
||||||
_COGL_RETURN_IF_FAIL (ctx->current_buffer[buffer->last_target] == buffer);
|
g_return_if_fail (ctx->current_buffer[buffer->last_target] == buffer);
|
||||||
|
|
||||||
if (buffer->flags & COGL_BUFFER_FLAG_BUFFER_OBJECT)
|
if (buffer->flags & COGL_BUFFER_FLAG_BUFFER_OBJECT)
|
||||||
{
|
{
|
||||||
|
@ -388,10 +388,10 @@ _cogl_framebuffer_gl_flush_state (CoglFramebuffer *draw_buffer,
|
|||||||
/* NB: Currently we only take advantage of binding separate
|
/* NB: Currently we only take advantage of binding separate
|
||||||
* read/write buffers for offscreen framebuffer blit
|
* read/write buffers for offscreen framebuffer blit
|
||||||
* purposes. */
|
* purposes. */
|
||||||
_COGL_RETURN_IF_FAIL (_cogl_has_private_feature
|
g_return_if_fail (_cogl_has_private_feature
|
||||||
(ctx, COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT));
|
(ctx, COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT));
|
||||||
_COGL_RETURN_IF_FAIL (draw_buffer->type == COGL_FRAMEBUFFER_TYPE_OFFSCREEN);
|
g_return_if_fail (draw_buffer->type == COGL_FRAMEBUFFER_TYPE_OFFSCREEN);
|
||||||
_COGL_RETURN_IF_FAIL (read_buffer->type == COGL_FRAMEBUFFER_TYPE_OFFSCREEN);
|
g_return_if_fail (read_buffer->type == COGL_FRAMEBUFFER_TYPE_OFFSCREEN);
|
||||||
|
|
||||||
_cogl_framebuffer_gl_bind (draw_buffer, GL_DRAW_FRAMEBUFFER);
|
_cogl_framebuffer_gl_bind (draw_buffer, GL_DRAW_FRAMEBUFFER);
|
||||||
_cogl_framebuffer_gl_bind (read_buffer, GL_READ_FRAMEBUFFER);
|
_cogl_framebuffer_gl_bind (read_buffer, GL_READ_FRAMEBUFFER);
|
||||||
|
@ -467,7 +467,7 @@ _cogl_winsys_display_destroy (CoglDisplay *display)
|
|||||||
CoglRendererEGL *egl_renderer = display->renderer->winsys;
|
CoglRendererEGL *egl_renderer = display->renderer->winsys;
|
||||||
CoglDisplayEGL *egl_display = display->winsys;
|
CoglDisplayEGL *egl_display = display->winsys;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (egl_display != NULL);
|
g_return_if_fail (egl_display != NULL);
|
||||||
|
|
||||||
cleanup_context (display);
|
cleanup_context (display);
|
||||||
|
|
||||||
@ -627,7 +627,7 @@ _cogl_winsys_destroy_gles2_context (CoglGLES2Context *gles2_ctx)
|
|||||||
CoglRendererEGL *egl_renderer = renderer->winsys;
|
CoglRendererEGL *egl_renderer = renderer->winsys;
|
||||||
EGLContext egl_context = gles2_ctx->winsys;
|
EGLContext egl_context = gles2_ctx->winsys;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (egl_display->current_context != egl_context);
|
g_return_if_fail (egl_display->current_context != egl_context);
|
||||||
|
|
||||||
eglDestroyContext (egl_renderer->edpy, egl_context);
|
eglDestroyContext (egl_renderer->edpy, egl_context);
|
||||||
}
|
}
|
||||||
@ -1065,7 +1065,7 @@ _cogl_egl_destroy_image (CoglContext *ctx,
|
|||||||
{
|
{
|
||||||
CoglRendererEGL *egl_renderer = ctx->display->renderer->winsys;
|
CoglRendererEGL *egl_renderer = ctx->display->renderer->winsys;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (egl_renderer->pf_eglDestroyImage);
|
g_return_if_fail (egl_renderer->pf_eglDestroyImage);
|
||||||
|
|
||||||
egl_renderer->pf_eglDestroyImage (egl_renderer->edpy, image);
|
egl_renderer->pf_eglDestroyImage (egl_renderer->edpy, image);
|
||||||
}
|
}
|
||||||
|
@ -1268,7 +1268,7 @@ _cogl_winsys_display_destroy (CoglDisplay *display)
|
|||||||
_cogl_xlib_renderer_get_data (display->renderer);
|
_cogl_xlib_renderer_get_data (display->renderer);
|
||||||
CoglGLXRenderer *glx_renderer = display->renderer->winsys;
|
CoglGLXRenderer *glx_renderer = display->renderer->winsys;
|
||||||
|
|
||||||
_COGL_RETURN_IF_FAIL (glx_display != NULL);
|
g_return_if_fail (glx_display != NULL);
|
||||||
|
|
||||||
if (glx_display->glx_context)
|
if (glx_display->glx_context)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user