Drop CoglError for GError

From https://gitlab.gnome.org/GNOME/mutter/merge_requests/631

```
CoglError was added at a certain point to remove the hard dependency on
GLib, but since this can't be avoided inside mutter, let's remove this
whole abstraction.
```

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/585
This commit is contained in:
Niels De Graef 2019-06-20 10:12:16 +02:00 committed by Niels De Graef
parent 4e84b46c9b
commit 952672ca62
3 changed files with 13 additions and 16 deletions

View File

@ -362,7 +362,7 @@ _st_create_shadow_pipeline (StShadow *shadow_spec,
{
ClutterBackend *backend = clutter_get_default_backend ();
CoglContext *ctx = clutter_backend_get_cogl_context (backend);
CoglError *error = NULL;
GError *error = NULL;
static CoglPipeline *shadow_pipeline_template = NULL;
@ -398,7 +398,7 @@ _st_create_shadow_pipeline (StShadow *shadow_spec,
if (error)
{
g_warning ("Failed to allocate texture: %s", error->message);
cogl_error_free (error);
g_error_free (error);
}
g_free (pixels_out);
@ -466,7 +466,7 @@ _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
CoglFramebuffer *fb;
CoglContext *ctx;
CoglColor clear_color;
CoglError *catch_error = NULL;
GError *catch_error = NULL;
float x, y;
ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
@ -480,7 +480,7 @@ _st_create_shadow_pipeline_from_actor (StShadow *shadow_spec,
if (!cogl_framebuffer_allocate (fb, &catch_error))
{
cogl_error_free (catch_error);
g_error_free (catch_error);
cogl_object_unref (offscreen);
cogl_object_unref (buffer);
return NULL;

View File

@ -72,7 +72,7 @@ create_corner_material (StCornerSpec *corner)
{
ClutterBackend *backend = clutter_get_default_backend ();
CoglContext *ctx = clutter_backend_get_cogl_context (backend);
CoglError *error = NULL;
GError *error = NULL;
CoglTexture *texture;
cairo_t *cr;
cairo_surface_t *surface;
@ -184,7 +184,7 @@ create_corner_material (StCornerSpec *corner)
if (error)
{
g_warning ("Failed to allocate texture: %s", error->message);
cogl_error_free (error);
g_error_free (error);
}
g_free (data);
@ -1007,7 +1007,7 @@ st_theme_node_prerender_background (StThemeNode *node,
{
ClutterBackend *backend = clutter_get_default_backend ();
CoglContext *ctx = clutter_backend_get_cogl_context (backend);
CoglError *error = NULL;
GError *error = NULL;
StBorderImage *border_image;
CoglTexture *texture;
guint radius[4];
@ -1344,7 +1344,7 @@ st_theme_node_prerender_background (StThemeNode *node,
if (error)
{
g_warning ("Failed to allocate texture: %s", error->message);
cogl_error_free (error);
g_error_free (error);
}
cairo_destroy (cr);
@ -2288,7 +2288,7 @@ st_theme_node_prerender_shadow (StThemeNodePaintState *state)
int fb_width, fb_height;
CoglTexture *buffer;
CoglFramebuffer *offscreen = NULL;
CoglError *error = NULL;
GError *error = NULL;
ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
@ -2351,11 +2351,8 @@ st_theme_node_prerender_shadow (StThemeNodePaintState *state)
state->box_shadow_pipeline = _st_create_shadow_pipeline (st_theme_node_get_box_shadow (node),
buffer, state->resource_scale);
}
else
{
cogl_error_free (error);
}
cogl_clear_error (&error);
cogl_clear_object (&offscreen);
cogl_clear_object (&buffer);
}

View File

@ -249,7 +249,7 @@ setup_framebuffers (StThemeNodeTransition *transition,
StThemeNodeTransitionPrivate *priv = transition->priv;
CoglContext *ctx;
guint width, height;
CoglError *catch_error = NULL;
GError *catch_error = NULL;
/* template material to avoid unnecessary shader compilation */
static CoglPipeline *material_template = NULL;
@ -277,7 +277,7 @@ setup_framebuffers (StThemeNodeTransition *transition,
priv->old_offscreen = COGL_FRAMEBUFFER (cogl_offscreen_new_with_texture (priv->old_texture));
if (!cogl_framebuffer_allocate (priv->old_offscreen, &catch_error))
{
cogl_error_free (catch_error);
g_error_free (catch_error);
cogl_clear_object (&priv->old_offscreen);
return FALSE;
}
@ -286,7 +286,7 @@ setup_framebuffers (StThemeNodeTransition *transition,
priv->new_offscreen = COGL_FRAMEBUFFER (cogl_offscreen_new_with_texture (priv->new_texture));
if (!cogl_framebuffer_allocate (priv->new_offscreen, &catch_error))
{
cogl_error_free (catch_error);
g_error_free (catch_error);
cogl_clear_object (&priv->new_offscreen);
return FALSE;
}