cogl: Remove CoglError wrapper

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/mutter/merge_requests/631
This commit is contained in:
Niels De Graef 2019-06-18 08:02:10 +02:00 committed by Niels De Graef
parent 57dfe4696d
commit 70bacb9402
105 changed files with 648 additions and 1071 deletions

View File

@ -1111,7 +1111,7 @@ _clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
{ {
if (backend->dummy_onscreen == COGL_INVALID_HANDLE) if (backend->dummy_onscreen == COGL_INVALID_HANDLE)
{ {
CoglError *internal_error = NULL; GError *internal_error = NULL;
backend->dummy_onscreen = cogl_onscreen_new (backend->cogl_context, 1, 1); backend->dummy_onscreen = cogl_onscreen_new (backend->cogl_context, 1, 1);
@ -1119,7 +1119,7 @@ _clutter_backend_reset_cogl_framebuffer (ClutterBackend *backend)
&internal_error)) &internal_error))
{ {
g_critical ("Unable to create dummy onscreen: %s", internal_error->message); g_critical ("Unable to create dummy onscreen: %s", internal_error->message);
cogl_error_free (internal_error); g_error_free (internal_error);
return; return;
} }
} }

View File

@ -217,7 +217,7 @@ cogl_pango_glyph_cache_add_to_global_atlas (CoglPangoGlyphCache *cache,
CoglPangoGlyphCacheValue *value) CoglPangoGlyphCacheValue *value)
{ {
CoglAtlasTexture *texture; CoglAtlasTexture *texture;
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
if (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_SHARED_ATLAS)) if (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_SHARED_ATLAS))
return FALSE; return FALSE;
@ -232,7 +232,7 @@ cogl_pango_glyph_cache_add_to_global_atlas (CoglPangoGlyphCache *cache,
value->draw_height); value->draw_height);
if (!cogl_texture_allocate (COGL_TEXTURE (texture), &ignore_error)) if (!cogl_texture_allocate (COGL_TEXTURE (texture), &ignore_error))
{ {
cogl_error_free (ignore_error); g_error_free (ignore_error);
return FALSE; return FALSE;
} }

View File

@ -47,7 +47,6 @@
#include "cogl-atlas.h" #include "cogl-atlas.h"
#include "cogl1-context.h" #include "cogl1-context.h"
#include "cogl-sub-texture.h" #include "cogl-sub-texture.h"
#include "cogl-error-private.h"
#include "cogl-gtype-private.h" #include "cogl-gtype-private.h"
#include "driver/gl/cogl-pipeline-opengl-private.h" #include "driver/gl/cogl-pipeline-opengl-private.h"
#include "driver/gl/cogl-texture-gl-private.h" #include "driver/gl/cogl-texture-gl-private.h"
@ -453,7 +452,7 @@ _cogl_atlas_texture_set_region_with_border (CoglAtlasTexture *atlas_tex,
int dst_width, int dst_width,
int dst_height, int dst_height,
CoglBitmap *bmp, CoglBitmap *bmp,
CoglError **error) GError **error)
{ {
CoglAtlas *atlas = atlas_tex->atlas; CoglAtlas *atlas = atlas_tex->atlas;
@ -524,7 +523,7 @@ _cogl_atlas_texture_convert_bitmap_for_upload (CoglAtlasTexture *atlas_tex,
CoglBitmap *bmp, CoglBitmap *bmp,
CoglPixelFormat internal_format, CoglPixelFormat internal_format,
gboolean can_convert_in_place, gboolean can_convert_in_place,
CoglError **error) GError **error)
{ {
CoglBitmap *upload_bmp; CoglBitmap *upload_bmp;
CoglBitmap *override_bmp; CoglBitmap *override_bmp;
@ -574,7 +573,7 @@ _cogl_atlas_texture_set_region (CoglTexture *tex,
int dst_height, int dst_height,
int level, int level,
CoglBitmap *bmp, CoglBitmap *bmp,
CoglError **error) GError **error)
{ {
CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex); CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex);
@ -711,7 +710,7 @@ allocate_space (CoglAtlasTexture *atlas_tex,
int width, int width,
int height, int height,
CoglPixelFormat internal_format, CoglPixelFormat internal_format,
CoglError **error) GError **error)
{ {
CoglTexture *tex = COGL_TEXTURE (atlas_tex); CoglTexture *tex = COGL_TEXTURE (atlas_tex);
CoglContext *ctx = tex->context; CoglContext *ctx = tex->context;
@ -723,7 +722,7 @@ allocate_space (CoglAtlasTexture *atlas_tex,
{ {
COGL_NOTE (ATLAS, "Texture can not be added because the " COGL_NOTE (ATLAS, "Texture can not be added because the "
"format is unsupported"); "format is unsupported");
_cogl_set_error (error, g_set_error_literal (error,
COGL_TEXTURE_ERROR, COGL_TEXTURE_ERROR,
COGL_TEXTURE_ERROR_FORMAT, COGL_TEXTURE_ERROR_FORMAT,
"Texture format unsuitable for atlasing"); "Texture format unsuitable for atlasing");
@ -734,7 +733,7 @@ allocate_space (CoglAtlasTexture *atlas_tex,
and we shouldn't use the atlas */ and we shouldn't use the atlas */
if (!cogl_has_feature (ctx, COGL_FEATURE_ID_OFFSCREEN)) if (!cogl_has_feature (ctx, COGL_FEATURE_ID_OFFSCREEN))
{ {
_cogl_set_error (error, g_set_error_literal (error,
COGL_SYSTEM_ERROR, COGL_SYSTEM_ERROR,
COGL_SYSTEM_ERROR_UNSUPPORTED, COGL_SYSTEM_ERROR_UNSUPPORTED,
"Atlasing disabled because migrations " "Atlasing disabled because migrations "
@ -777,7 +776,7 @@ allocate_space (CoglAtlasTexture *atlas_tex,
/* Ok, this means we really can't add it to the atlas */ /* Ok, this means we really can't add it to the atlas */
cogl_object_unref (atlas); cogl_object_unref (atlas);
_cogl_set_error (error, g_set_error_literal (error,
COGL_SYSTEM_ERROR, COGL_SYSTEM_ERROR,
COGL_SYSTEM_ERROR_NO_MEMORY, COGL_SYSTEM_ERROR_NO_MEMORY,
"Not enough memory to atlas texture"); "Not enough memory to atlas texture");
@ -795,7 +794,7 @@ allocate_space (CoglAtlasTexture *atlas_tex,
static gboolean static gboolean
allocate_with_size (CoglAtlasTexture *atlas_tex, allocate_with_size (CoglAtlasTexture *atlas_tex,
CoglTextureLoader *loader, CoglTextureLoader *loader,
CoglError **error) GError **error)
{ {
CoglTexture *tex = COGL_TEXTURE (atlas_tex); CoglTexture *tex = COGL_TEXTURE (atlas_tex);
CoglPixelFormat internal_format = CoglPixelFormat internal_format =
@ -820,7 +819,7 @@ allocate_with_size (CoglAtlasTexture *atlas_tex,
static gboolean static gboolean
allocate_from_bitmap (CoglAtlasTexture *atlas_tex, allocate_from_bitmap (CoglAtlasTexture *atlas_tex,
CoglTextureLoader *loader, CoglTextureLoader *loader,
CoglError **error) GError **error)
{ {
CoglTexture *tex = COGL_TEXTURE (atlas_tex); CoglTexture *tex = COGL_TEXTURE (atlas_tex);
CoglBitmap *bmp = loader->src.bitmap.bitmap; CoglBitmap *bmp = loader->src.bitmap.bitmap;
@ -880,7 +879,7 @@ allocate_from_bitmap (CoglAtlasTexture *atlas_tex,
static gboolean static gboolean
_cogl_atlas_texture_allocate (CoglTexture *tex, _cogl_atlas_texture_allocate (CoglTexture *tex,
CoglError **error) GError **error)
{ {
CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex); CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex);
CoglTextureLoader *loader = tex->loader; CoglTextureLoader *loader = tex->loader;
@ -933,7 +932,7 @@ cogl_atlas_texture_new_from_data (CoglContext *ctx,
CoglPixelFormat format, CoglPixelFormat format,
int rowstride, int rowstride,
const uint8_t *data, const uint8_t *data,
CoglError **error) GError **error)
{ {
CoglBitmap *bmp; CoglBitmap *bmp;
CoglAtlasTexture *atlas_tex; CoglAtlasTexture *atlas_tex;
@ -969,7 +968,7 @@ cogl_atlas_texture_new_from_data (CoglContext *ctx,
CoglAtlasTexture * CoglAtlasTexture *
cogl_atlas_texture_new_from_file (CoglContext *ctx, cogl_atlas_texture_new_from_file (CoglContext *ctx,
const char *filename, const char *filename,
CoglError **error) GError **error)
{ {
CoglBitmap *bmp; CoglBitmap *bmp;
CoglAtlasTexture *atlas_tex = NULL; CoglAtlasTexture *atlas_tex = NULL;

View File

@ -117,7 +117,7 @@ cogl_atlas_texture_new_with_size (CoglContext *ctx,
* cogl_atlas_texture_new_from_file: * cogl_atlas_texture_new_from_file:
* @ctx: A #CoglContext * @ctx: A #CoglContext
* @filename: the file to load * @filename: the file to load
* @error: A #CoglError to catch exceptional errors or %NULL * @error: A #GError to catch exceptional errors or %NULL
* *
* Creates a #CoglAtlasTexture from an image file. A #CoglAtlasTexture * Creates a #CoglAtlasTexture from an image file. A #CoglAtlasTexture
* represents a sub-region within one of Cogl's shared texture * represents a sub-region within one of Cogl's shared texture
@ -149,7 +149,7 @@ cogl_atlas_texture_new_with_size (CoglContext *ctx,
CoglAtlasTexture * CoglAtlasTexture *
cogl_atlas_texture_new_from_file (CoglContext *ctx, cogl_atlas_texture_new_from_file (CoglContext *ctx,
const char *filename, const char *filename,
CoglError **error); GError **error);
/** /**
* cogl_atlas_texture_new_from_data: * cogl_atlas_texture_new_from_data:
@ -161,7 +161,7 @@ cogl_atlas_texture_new_from_file (CoglContext *ctx,
* row in @data. A value of 0 will make Cogl automatically * row in @data. A value of 0 will make Cogl automatically
* calculate @rowstride from @width and @format. * calculate @rowstride from @width and @format.
* @data: pointer to the memory region where the source buffer resides * @data: pointer to the memory region where the source buffer resides
* @error: A #CoglError to catch exceptional errors or %NULL * @error: A #GError to catch exceptional errors or %NULL
* *
* Creates a new #CoglAtlasTexture texture based on data residing in * Creates a new #CoglAtlasTexture texture based on data residing in
* memory. A #CoglAtlasTexture represents a sub-region within one of * memory. A #CoglAtlasTexture represents a sub-region within one of
@ -198,7 +198,7 @@ cogl_atlas_texture_new_from_data (CoglContext *ctx,
CoglPixelFormat format, CoglPixelFormat format,
int rowstride, int rowstride,
const uint8_t *data, const uint8_t *data,
CoglError **error); GError **error);
/** /**
* cogl_atlas_texture_new_from_bitmap: * cogl_atlas_texture_new_from_bitmap:

View File

@ -283,7 +283,7 @@ _cogl_atlas_create_texture (CoglAtlas *atlas,
int height) int height)
{ {
CoglTexture2D *tex; CoglTexture2D *tex;
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
_COGL_GET_CONTEXT (ctx, NULL); _COGL_GET_CONTEXT (ctx, NULL);
@ -309,7 +309,7 @@ _cogl_atlas_create_texture (CoglAtlas *atlas,
if (!cogl_texture_allocate (COGL_TEXTURE (tex), &ignore_error)) if (!cogl_texture_allocate (COGL_TEXTURE (tex), &ignore_error))
{ {
cogl_error_free (ignore_error); g_error_free (ignore_error);
cogl_object_unref (tex); cogl_object_unref (tex);
tex = NULL; tex = NULL;
} }
@ -327,7 +327,7 @@ _cogl_atlas_create_texture (CoglAtlas *atlas,
if (!cogl_texture_allocate (COGL_TEXTURE (tex), &ignore_error)) if (!cogl_texture_allocate (COGL_TEXTURE (tex), &ignore_error))
{ {
cogl_error_free (ignore_error); g_error_free (ignore_error);
cogl_object_unref (tex); cogl_object_unref (tex);
tex = NULL; tex = NULL;
} }
@ -560,7 +560,7 @@ create_migration_texture (CoglContext *ctx,
CoglPixelFormat internal_format) CoglPixelFormat internal_format)
{ {
CoglTexture *tex; CoglTexture *tex;
CoglError *skip_error = NULL; GError *skip_error = NULL;
/* First try creating a fast-path non-sliced texture */ /* First try creating a fast-path non-sliced texture */
tex = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, width, height)); tex = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, width, height));
@ -573,7 +573,7 @@ create_migration_texture (CoglContext *ctx,
* lazily when uploading data. */ * lazily when uploading data. */
if (!cogl_texture_allocate (tex, &skip_error)) if (!cogl_texture_allocate (tex, &skip_error))
{ {
cogl_error_free (skip_error); g_error_free (skip_error);
cogl_object_unref (tex); cogl_object_unref (tex);
tex = NULL; tex = NULL;
} }
@ -605,7 +605,7 @@ _cogl_atlas_copy_rectangle (CoglAtlas *atlas,
{ {
CoglTexture *tex; CoglTexture *tex;
CoglBlitData blit_data; CoglBlitData blit_data;
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
_COGL_GET_CONTEXT (ctx, NULL); _COGL_GET_CONTEXT (ctx, NULL);
@ -613,7 +613,7 @@ _cogl_atlas_copy_rectangle (CoglAtlas *atlas,
tex = create_migration_texture (ctx, width, height, internal_format); tex = create_migration_texture (ctx, width, height, internal_format);
if (!cogl_texture_allocate (tex, &ignore_error)) if (!cogl_texture_allocate (tex, &ignore_error))
{ {
cogl_error_free (ignore_error); g_error_free (ignore_error);
cogl_object_unref (tex); cogl_object_unref (tex);
return NULL; return NULL;
} }

View File

@ -71,7 +71,7 @@ cogl_attribute_buffer_new (CoglContext *context,
buffer = cogl_attribute_buffer_new_with_size (context, bytes); buffer = cogl_attribute_buffer_new_with_size (context, bytes);
/* Note: to keep the common cases simple this API doesn't throw /* Note: to keep the common cases simple this API doesn't throw
* CoglErrors, so developers can assume this function never returns * GErrors, so developers can assume this function never returns
* NULL and we will simply abort on error. * NULL and we will simply abort on error.
* *
* Developers wanting to catch errors can use * Developers wanting to catch errors can use

View File

@ -361,7 +361,7 @@ _cogl_bitmap_needs_short_temp_buffer (CoglPixelFormat format)
gboolean gboolean
_cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp, _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
CoglBitmap *dst_bmp, CoglBitmap *dst_bmp,
CoglError **error) GError **error)
{ {
uint8_t *src_data; uint8_t *src_data;
uint8_t *dst_data; uint8_t *dst_data;
@ -488,7 +488,7 @@ _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
CoglBitmap * CoglBitmap *
_cogl_bitmap_convert (CoglBitmap *src_bmp, _cogl_bitmap_convert (CoglBitmap *src_bmp,
CoglPixelFormat dst_format, CoglPixelFormat dst_format,
CoglError **error) GError **error)
{ {
CoglBitmap *dst_bmp; CoglBitmap *dst_bmp;
int width, height; int width, height;
@ -547,7 +547,7 @@ CoglBitmap *
_cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp, _cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp,
CoglPixelFormat internal_format, CoglPixelFormat internal_format,
gboolean can_convert_in_place, gboolean can_convert_in_place,
CoglError **error) GError **error)
{ {
CoglContext *ctx = _cogl_bitmap_get_context (src_bmp); CoglContext *ctx = _cogl_bitmap_get_context (src_bmp);
CoglPixelFormat src_format = cogl_bitmap_get_format (src_bmp); CoglPixelFormat src_format = cogl_bitmap_get_format (src_bmp);
@ -616,7 +616,7 @@ _cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp,
gboolean gboolean
_cogl_bitmap_unpremult (CoglBitmap *bmp, _cogl_bitmap_unpremult (CoglBitmap *bmp,
CoglError **error) GError **error)
{ {
uint8_t *p, *data; uint8_t *p, *data;
uint16_t *tmp_row; uint16_t *tmp_row;
@ -684,7 +684,7 @@ _cogl_bitmap_unpremult (CoglBitmap *bmp,
gboolean gboolean
_cogl_bitmap_premult (CoglBitmap *bmp, _cogl_bitmap_premult (CoglBitmap *bmp,
CoglError **error) GError **error)
{ {
uint8_t *p, *data; uint8_t *p, *data;
uint16_t *tmp_row; uint16_t *tmp_row;

View File

@ -34,7 +34,6 @@
#include "cogl-bitmap-private.h" #include "cogl-bitmap-private.h"
#include "cogl-context-private.h" #include "cogl-context-private.h"
#include "cogl-private.h" #include "cogl-private.h"
#include "cogl-error-private.h"
#include <string.h> #include <string.h>
@ -56,7 +55,7 @@ _cogl_bitmap_get_size_from_file (const char *filename,
CoglBitmap * CoglBitmap *
_cogl_bitmap_from_file (CoglContext *ctx, _cogl_bitmap_from_file (CoglContext *ctx,
const char *filename, const char *filename,
CoglError **error) GError **error)
{ {
static CoglUserDataKey pixbuf_key; static CoglUserDataKey pixbuf_key;
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
@ -75,7 +74,7 @@ _cogl_bitmap_from_file (CoglContext *ctx,
pixbuf = gdk_pixbuf_new_from_file (filename, &glib_error); pixbuf = gdk_pixbuf_new_from_file (filename, &glib_error);
if (pixbuf == NULL) if (pixbuf == NULL)
{ {
_cogl_propagate_gerror (error, glib_error); g_propagate_error (error, glib_error);
return FALSE; return FALSE;
} }

View File

@ -70,7 +70,7 @@ struct _CoglBitmap
* @width: width of the bitmap in pixels * @width: width of the bitmap in pixels
* @height: height of the bitmap in pixels * @height: height of the bitmap in pixels
* @format: the format of the pixels the array will store * @format: the format of the pixels the array will store
* @error: A #CoglError for catching exceptional errors or %NULL * @error: A #GError for catching exceptional errors or %NULL
* *
* This is equivalent to cogl_bitmap_new_with_size() except that it * This is equivalent to cogl_bitmap_new_with_size() except that it
* allocated the buffer using g_malloc() instead of creating a * allocated the buffer using g_malloc() instead of creating a
@ -87,7 +87,7 @@ _cogl_bitmap_new_with_malloc_buffer (CoglContext *context,
unsigned int width, unsigned int width,
unsigned int height, unsigned int height,
CoglPixelFormat format, CoglPixelFormat format,
CoglError **error); GError **error);
/* The idea of this function is that it will create a bitmap that /* The idea of this function is that it will create a bitmap that
shares the actual data with another bitmap. This is needed for the shares the actual data with another bitmap. This is needed for the
@ -104,36 +104,36 @@ _cogl_bitmap_new_shared (CoglBitmap *shared_bmp,
CoglBitmap * CoglBitmap *
_cogl_bitmap_convert (CoglBitmap *bmp, _cogl_bitmap_convert (CoglBitmap *bmp,
CoglPixelFormat dst_format, CoglPixelFormat dst_format,
CoglError **error); GError **error);
CoglBitmap * CoglBitmap *
_cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp, _cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp,
CoglPixelFormat internal_format, CoglPixelFormat internal_format,
gboolean can_convert_in_place, gboolean can_convert_in_place,
CoglError **error); GError **error);
gboolean gboolean
_cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp, _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
CoglBitmap *dst_bmp, CoglBitmap *dst_bmp,
CoglError **error); GError **error);
CoglBitmap * CoglBitmap *
_cogl_bitmap_from_file (CoglContext *ctx, _cogl_bitmap_from_file (CoglContext *ctx,
const char *filename, const char *filename,
CoglError **error); GError **error);
gboolean gboolean
_cogl_bitmap_unpremult (CoglBitmap *dst_bmp, _cogl_bitmap_unpremult (CoglBitmap *dst_bmp,
CoglError **error); GError **error);
gboolean gboolean
_cogl_bitmap_premult (CoglBitmap *dst_bmp, _cogl_bitmap_premult (CoglBitmap *dst_bmp,
CoglError **error); GError **error);
gboolean gboolean
_cogl_bitmap_convert_premult_status (CoglBitmap *bmp, _cogl_bitmap_convert_premult_status (CoglBitmap *bmp,
CoglPixelFormat dst_format, CoglPixelFormat dst_format,
CoglError **error); GError **error);
gboolean gboolean
_cogl_bitmap_copy_subregion (CoglBitmap *src, _cogl_bitmap_copy_subregion (CoglBitmap *src,
@ -144,12 +144,12 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
int dst_y, int dst_y,
int width, int width,
int height, int height,
CoglError **error); GError **error);
/* Creates a deep copy of the source bitmap */ /* Creates a deep copy of the source bitmap */
CoglBitmap * CoglBitmap *
_cogl_bitmap_copy (CoglBitmap *src_bmp, _cogl_bitmap_copy (CoglBitmap *src_bmp,
CoglError **error); GError **error);
gboolean gboolean
_cogl_bitmap_get_size_from_file (const char *filename, _cogl_bitmap_get_size_from_file (const char *filename,
@ -172,7 +172,7 @@ uint8_t *
_cogl_bitmap_map (CoglBitmap *bitmap, _cogl_bitmap_map (CoglBitmap *bitmap,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints, CoglBufferMapHint hints,
CoglError **error); GError **error);
void void
_cogl_bitmap_unmap (CoglBitmap *bitmap); _cogl_bitmap_unmap (CoglBitmap *bitmap);
@ -190,7 +190,7 @@ uint8_t *
_cogl_bitmap_gl_bind (CoglBitmap *bitmap, _cogl_bitmap_gl_bind (CoglBitmap *bitmap,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints, CoglBufferMapHint hints,
CoglError **error); GError **error);
void void
_cogl_bitmap_gl_unbind (CoglBitmap *bitmap); _cogl_bitmap_gl_unbind (CoglBitmap *bitmap);

View File

@ -37,7 +37,6 @@
#include "cogl-buffer-private.h" #include "cogl-buffer-private.h"
#include "cogl-pixel-buffer.h" #include "cogl-pixel-buffer.h"
#include "cogl-context-private.h" #include "cogl-context-private.h"
#include "cogl-error-private.h"
#include "cogl-gtype-private.h" #include "cogl-gtype-private.h"
#include "driver/gl/cogl-buffer-gl-private.h" #include "driver/gl/cogl-buffer-gl-private.h"
@ -66,7 +65,7 @@ _cogl_bitmap_free (CoglBitmap *bmp)
gboolean gboolean
_cogl_bitmap_convert_premult_status (CoglBitmap *bmp, _cogl_bitmap_convert_premult_status (CoglBitmap *bmp,
CoglPixelFormat dst_format, CoglPixelFormat dst_format,
CoglError **error) GError **error)
{ {
/* Do we need to unpremultiply? */ /* Do we need to unpremultiply? */
if ((bmp->format & COGL_PREMULT_BIT) > 0 && if ((bmp->format & COGL_PREMULT_BIT) > 0 &&
@ -86,7 +85,7 @@ _cogl_bitmap_convert_premult_status (CoglBitmap *bmp,
CoglBitmap * CoglBitmap *
_cogl_bitmap_copy (CoglBitmap *src_bmp, _cogl_bitmap_copy (CoglBitmap *src_bmp,
CoglError **error) GError **error)
{ {
CoglBitmap *dst_bmp; CoglBitmap *dst_bmp;
CoglPixelFormat src_format = cogl_bitmap_get_format (src_bmp); CoglPixelFormat src_format = cogl_bitmap_get_format (src_bmp);
@ -124,7 +123,7 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
int dst_y, int dst_y,
int width, int width,
int height, int height,
CoglError **error) GError **error)
{ {
uint8_t *srcdata; uint8_t *srcdata;
uint8_t *dstdata; uint8_t *dstdata;
@ -209,7 +208,7 @@ _cogl_bitmap_new_with_malloc_buffer (CoglContext *context,
unsigned int width, unsigned int width,
unsigned int height, unsigned int height,
CoglPixelFormat format, CoglPixelFormat format,
CoglError **error) GError **error)
{ {
static CoglUserDataKey bitmap_free_key; static CoglUserDataKey bitmap_free_key;
int bpp = _cogl_pixel_format_get_bytes_per_pixel (format); int bpp = _cogl_pixel_format_get_bytes_per_pixel (format);
@ -219,8 +218,7 @@ _cogl_bitmap_new_with_malloc_buffer (CoglContext *context,
if (!data) if (!data)
{ {
_cogl_set_error (error, g_set_error_literal (error, COGL_SYSTEM_ERROR,
COGL_SYSTEM_ERROR,
COGL_SYSTEM_ERROR_NO_MEMORY, COGL_SYSTEM_ERROR_NO_MEMORY,
"Failed to allocate memory for bitmap"); "Failed to allocate memory for bitmap");
return NULL; return NULL;
@ -261,7 +259,7 @@ _cogl_bitmap_new_shared (CoglBitmap *shared_bmp,
CoglBitmap * CoglBitmap *
cogl_bitmap_new_from_file (const char *filename, cogl_bitmap_new_from_file (const char *filename,
CoglError **error) GError **error)
{ {
_COGL_GET_CONTEXT (ctx, NULL); _COGL_GET_CONTEXT (ctx, NULL);
@ -380,7 +378,7 @@ uint8_t *
_cogl_bitmap_map (CoglBitmap *bitmap, _cogl_bitmap_map (CoglBitmap *bitmap,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints, CoglBufferMapHint hints,
CoglError **error) GError **error)
{ {
/* Divert to another bitmap if this data is shared */ /* Divert to another bitmap if this data is shared */
if (bitmap->shared_bmp) if (bitmap->shared_bmp)
@ -437,10 +435,10 @@ uint8_t *
_cogl_bitmap_gl_bind (CoglBitmap *bitmap, _cogl_bitmap_gl_bind (CoglBitmap *bitmap,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints, CoglBufferMapHint hints,
CoglError **error) GError **error)
{ {
uint8_t *ptr; uint8_t *ptr;
CoglError *internal_error = NULL; GError *internal_error = NULL;
g_return_val_if_fail (access & (COGL_BUFFER_ACCESS_READ | g_return_val_if_fail (access & (COGL_BUFFER_ACCESS_READ |
COGL_BUFFER_ACCESS_WRITE), COGL_BUFFER_ACCESS_WRITE),
@ -482,7 +480,7 @@ _cogl_bitmap_gl_bind (CoglBitmap *bitmap,
* if an exception was thrown */ * if an exception was thrown */
if (internal_error) if (internal_error)
{ {
_cogl_propagate_error (error, internal_error); g_propagate_error (error, internal_error);
return NULL; return NULL;
} }

View File

@ -70,7 +70,7 @@ GType cogl_bitmap_get_gtype (void);
/** /**
* cogl_bitmap_new_from_file: * cogl_bitmap_new_from_file:
* @filename: the file to load. * @filename: the file to load.
* @error: a #CoglError or %NULL. * @error: a #GError or %NULL.
* *
* Loads an image file from disk. This function can be safely called from * Loads an image file from disk. This function can be safely called from
* within a thread. * within a thread.
@ -82,7 +82,7 @@ GType cogl_bitmap_get_gtype (void);
*/ */
CoglBitmap * CoglBitmap *
cogl_bitmap_new_from_file (const char *filename, cogl_bitmap_new_from_file (const char *filename,
CoglError **error); GError **error);
/** /**
* cogl_bitmap_new_from_buffer: (skip) * cogl_bitmap_new_from_buffer: (skip)
@ -269,7 +269,7 @@ cogl_is_bitmap (void *object);
/** /**
* COGL_BITMAP_ERROR: * COGL_BITMAP_ERROR:
* *
* #CoglError domain for bitmap errors. * #GError domain for bitmap errors.
* *
* Since: 1.4 * Since: 1.4
*/ */

View File

@ -41,7 +41,6 @@
#include "cogl-context-private.h" #include "cogl-context-private.h"
#include "cogl-debug.h" #include "cogl-debug.h"
#include "cogl-blend-string.h" #include "cogl-blend-string.h"
#include "cogl-error-private.h"
typedef enum _ParserState typedef enum _ParserState
{ {
@ -166,7 +165,7 @@ _cogl_blend_string_split_rgba_statement (CoglBlendStringStatement *statement,
static gboolean static gboolean
validate_tex_combine_statements (CoglBlendStringStatement *statements, validate_tex_combine_statements (CoglBlendStringStatement *statements,
int n_statements, int n_statements,
CoglError **error) GError **error)
{ {
int i, j; int i, j;
const char *error_string; const char *error_string;
@ -195,11 +194,8 @@ validate_tex_combine_statements (CoglBlendStringStatement *statements,
return TRUE; return TRUE;
error: error:
_cogl_set_error (error, g_set_error (error, COGL_BLEND_STRING_ERROR, detail,
COGL_BLEND_STRING_ERROR, "Invalid texture combine string: %s", error_string);
detail,
"Invalid texture combine string: %s",
error_string);
if (COGL_DEBUG_ENABLED (COGL_DEBUG_BLEND_STRINGS)) if (COGL_DEBUG_ENABLED (COGL_DEBUG_BLEND_STRINGS))
{ {
@ -212,7 +208,7 @@ error:
static gboolean static gboolean
validate_blend_statements (CoglBlendStringStatement *statements, validate_blend_statements (CoglBlendStringStatement *statements,
int n_statements, int n_statements,
CoglError **error) GError **error)
{ {
int i, j; int i, j;
const char *error_string; const char *error_string;
@ -265,11 +261,8 @@ validate_blend_statements (CoglBlendStringStatement *statements,
return TRUE; return TRUE;
error: error:
_cogl_set_error (error, g_set_error (error, COGL_BLEND_STRING_ERROR, detail,
COGL_BLEND_STRING_ERROR, "Invalid blend string: %s", error_string);
detail,
"Invalid blend string: %s",
error_string);
return FALSE; return FALSE;
} }
@ -277,7 +270,7 @@ static gboolean
validate_statements_for_context (CoglBlendStringStatement *statements, validate_statements_for_context (CoglBlendStringStatement *statements,
int n_statements, int n_statements,
CoglBlendStringContext context, CoglBlendStringContext context,
CoglError **error) GError **error)
{ {
const char *error_string; const char *error_string;
@ -303,8 +296,7 @@ validate_statements_for_context (CoglBlendStringStatement *statements,
return validate_tex_combine_statements (statements, n_statements, error); return validate_tex_combine_statements (statements, n_statements, error);
error: error:
_cogl_set_error (error, g_set_error (error, COGL_BLEND_STRING_ERROR,
COGL_BLEND_STRING_ERROR,
COGL_BLEND_STRING_ERROR_INVALID_ERROR, COGL_BLEND_STRING_ERROR_INVALID_ERROR,
"Invalid %s string: %s", "Invalid %s string: %s",
context == COGL_BLEND_STRING_CONTEXT_BLENDING ? context == COGL_BLEND_STRING_CONTEXT_BLENDING ?
@ -464,7 +456,7 @@ parse_argument (const char *string, /* original user string */
int current_arg, int current_arg,
CoglBlendStringArgument *arg, /* OUT */ CoglBlendStringArgument *arg, /* OUT */
CoglBlendStringContext context, CoglBlendStringContext context,
CoglError **error) GError **error)
{ {
const char *p = *ret_p; const char *p = *ret_p;
const char *mark = NULL; const char *mark = NULL;
@ -733,7 +725,7 @@ parse_argument (const char *string, /* original user string */
error: error:
{ {
int offset = p - string; int offset = p - string;
_cogl_set_error (error, g_set_error (error,
COGL_BLEND_STRING_ERROR, COGL_BLEND_STRING_ERROR,
COGL_BLEND_STRING_ERROR_ARGUMENT_PARSE_ERROR, COGL_BLEND_STRING_ERROR_ARGUMENT_PARSE_ERROR,
"Syntax error for argument %d at offset %d: %s", "Syntax error for argument %d at offset %d: %s",
@ -754,7 +746,7 @@ int
_cogl_blend_string_compile (const char *string, _cogl_blend_string_compile (const char *string,
CoglBlendStringContext context, CoglBlendStringContext context,
CoglBlendStringStatement *statements, CoglBlendStringStatement *statements,
CoglError **error) GError **error)
{ {
const char *p = string; const char *p = string;
const char *mark = NULL; const char *mark = NULL;
@ -914,7 +906,7 @@ finished:
error: error:
{ {
int offset = p - string; int offset = p - string;
_cogl_set_error (error, g_set_error (error,
COGL_BLEND_STRING_ERROR, COGL_BLEND_STRING_ERROR,
COGL_BLEND_STRING_ERROR_PARSE_ERROR, COGL_BLEND_STRING_ERROR_PARSE_ERROR,
"Syntax error at offset %d: %s", "Syntax error at offset %d: %s",
@ -971,7 +963,7 @@ _cogl_blend_string_test (void)
}; };
int i; int i;
CoglError *error = NULL; GError *error = NULL;
for (i = 0; strings[i].string; i++) for (i = 0; strings[i].string; i++)
{ {
CoglBlendStringStatement statements[2]; CoglBlendStringStatement statements[2];
@ -984,7 +976,7 @@ _cogl_blend_string_test (void)
g_print ("Failed to parse string:\n%s\n%s\n", g_print ("Failed to parse string:\n%s\n%s\n",
strings[i].string, strings[i].string,
error->message); error->message);
cogl_error_free (error); g_error_free (error);
error = NULL; error = NULL;
continue; continue;
} }

View File

@ -133,7 +133,7 @@ gboolean
_cogl_blend_string_compile (const char *string, _cogl_blend_string_compile (const char *string,
CoglBlendStringContext context, CoglBlendStringContext context,
CoglBlendStringStatement *statements, CoglBlendStringStatement *statements,
CoglError **error); GError **error);
void void
_cogl_blend_string_split_rgba_statement (CoglBlendStringStatement *statement, _cogl_blend_string_split_rgba_statement (CoglBlendStringStatement *statement,

View File

@ -52,7 +52,7 @@ _cogl_blit_texture_render_begin (CoglBlitData *data)
CoglFramebuffer *fb; CoglFramebuffer *fb;
CoglPipeline *pipeline; CoglPipeline *pipeline;
unsigned int dst_width, dst_height; unsigned int dst_width, dst_height;
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
offscreen = _cogl_offscreen_new_with_texture_full offscreen = _cogl_offscreen_new_with_texture_full
(data->dst_tex, COGL_OFFSCREEN_DISABLE_DEPTH_AND_STENCIL, 0 /* level */); (data->dst_tex, COGL_OFFSCREEN_DISABLE_DEPTH_AND_STENCIL, 0 /* level */);
@ -60,7 +60,7 @@ _cogl_blit_texture_render_begin (CoglBlitData *data)
fb = COGL_FRAMEBUFFER (offscreen); fb = COGL_FRAMEBUFFER (offscreen);
if (!cogl_framebuffer_allocate (fb, &ignore_error)) if (!cogl_framebuffer_allocate (fb, &ignore_error))
{ {
cogl_error_free (ignore_error); g_error_free (ignore_error);
cogl_object_unref (fb); cogl_object_unref (fb);
return FALSE; return FALSE;
} }
@ -150,7 +150,7 @@ _cogl_blit_framebuffer_begin (CoglBlitData *data)
CoglContext *ctx = data->src_tex->context; CoglContext *ctx = data->src_tex->context;
CoglOffscreen *dst_offscreen = NULL, *src_offscreen = NULL; CoglOffscreen *dst_offscreen = NULL, *src_offscreen = NULL;
CoglFramebuffer *dst_fb, *src_fb; CoglFramebuffer *dst_fb, *src_fb;
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
/* We can only blit between FBOs if both textures are the same /* We can only blit between FBOs if both textures are the same
format and the blit framebuffer extension is supported */ format and the blit framebuffer extension is supported */
@ -165,7 +165,7 @@ _cogl_blit_framebuffer_begin (CoglBlitData *data)
dst_fb = COGL_FRAMEBUFFER (dst_offscreen); dst_fb = COGL_FRAMEBUFFER (dst_offscreen);
if (!cogl_framebuffer_allocate (dst_fb, &ignore_error)) if (!cogl_framebuffer_allocate (dst_fb, &ignore_error))
{ {
cogl_error_free (ignore_error); g_error_free (ignore_error);
goto error; goto error;
} }
@ -177,7 +177,7 @@ _cogl_blit_framebuffer_begin (CoglBlitData *data)
src_fb = COGL_FRAMEBUFFER (src_offscreen); src_fb = COGL_FRAMEBUFFER (src_offscreen);
if (!cogl_framebuffer_allocate (src_fb, &ignore_error)) if (!cogl_framebuffer_allocate (src_fb, &ignore_error))
{ {
cogl_error_free (ignore_error); g_error_free (ignore_error);
goto error; goto error;
} }
@ -224,7 +224,7 @@ _cogl_blit_copy_tex_sub_image_begin (CoglBlitData *data)
{ {
CoglOffscreen *offscreen; CoglOffscreen *offscreen;
CoglFramebuffer *fb; CoglFramebuffer *fb;
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
/* This will only work if the target texture is a CoglTexture2D */ /* This will only work if the target texture is a CoglTexture2D */
if (!cogl_is_texture_2d (data->dst_tex)) if (!cogl_is_texture_2d (data->dst_tex))
@ -236,7 +236,7 @@ _cogl_blit_copy_tex_sub_image_begin (CoglBlitData *data)
fb = COGL_FRAMEBUFFER (offscreen); fb = COGL_FRAMEBUFFER (offscreen);
if (!cogl_framebuffer_allocate (fb, &ignore_error)) if (!cogl_framebuffer_allocate (fb, &ignore_error))
{ {
cogl_error_free (ignore_error); g_error_free (ignore_error);
cogl_object_unref (fb); cogl_object_unref (fb);
return FALSE; return FALSE;
} }
@ -292,7 +292,7 @@ _cogl_blit_get_tex_data_blit (CoglBlitData *data,
int width, int width,
int height) int height)
{ {
CoglError *ignore = NULL; GError *ignore = NULL;
int rowstride = data->src_width * data->bpp; int rowstride = data->src_width * data->bpp;
int offset = rowstride * src_y + src_x * data->bpp; int offset = rowstride * src_y + src_x * data->bpp;

View File

@ -53,7 +53,7 @@ struct _CoglBufferVtable
size_t size, size_t size,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints, CoglBufferMapHint hints,
CoglError **error); GError **error);
void (* unmap) (CoglBuffer *buffer); void (* unmap) (CoglBuffer *buffer);
@ -61,7 +61,7 @@ struct _CoglBufferVtable
unsigned int offset, unsigned int offset,
const void *data, const void *data,
unsigned int size, unsigned int size,
CoglError **error); GError **error);
}; };
typedef enum _CoglBufferFlags typedef enum _CoglBufferFlags
@ -153,13 +153,13 @@ _cogl_buffer_set_data (CoglBuffer *buffer,
size_t offset, size_t offset,
const void *data, const void *data,
size_t size, size_t size,
CoglError **error); GError **error);
void * void *
_cogl_buffer_map (CoglBuffer *buffer, _cogl_buffer_map (CoglBuffer *buffer,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints, CoglBufferMapHint hints,
CoglError **error); GError **error);
/* This is a wrapper around cogl_buffer_map_range for internal use /* This is a wrapper around cogl_buffer_map_range for internal use
when we want to map the buffer for write only to replace the entire when we want to map the buffer for write only to replace the entire

View File

@ -88,7 +88,7 @@ malloc_map_range (CoglBuffer *buffer,
size_t size, size_t size,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints, CoglBufferMapHint hints,
CoglError **error) GError **error)
{ {
buffer->flags |= COGL_BUFFER_FLAG_MAPPED; buffer->flags |= COGL_BUFFER_FLAG_MAPPED;
return buffer->data + offset; return buffer->data + offset;
@ -105,7 +105,7 @@ malloc_set_data (CoglBuffer *buffer,
unsigned int offset, unsigned int offset,
const void *data, const void *data,
unsigned int size, unsigned int size,
CoglError **error) GError **error)
{ {
memcpy (buffer->data + offset, data, size); memcpy (buffer->data + offset, data, size);
return TRUE; return TRUE;
@ -223,7 +223,7 @@ void *
_cogl_buffer_map (CoglBuffer *buffer, _cogl_buffer_map (CoglBuffer *buffer,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints, CoglBufferMapHint hints,
CoglError **error) GError **error)
{ {
g_return_val_if_fail (cogl_is_buffer (buffer), NULL); g_return_val_if_fail (cogl_is_buffer (buffer), NULL);
@ -235,12 +235,11 @@ cogl_buffer_map (CoglBuffer *buffer,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints) CoglBufferMapHint hints)
{ {
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
void *ptr = void *ptr =
cogl_buffer_map_range (buffer, 0, buffer->size, access, hints, cogl_buffer_map_range (buffer, 0, buffer->size, access, hints,
&ignore_error); &ignore_error);
if (!ptr) g_clear_error (&ignore_error);
cogl_error_free (ignore_error);
return ptr; return ptr;
} }
@ -250,7 +249,7 @@ cogl_buffer_map_range (CoglBuffer *buffer,
size_t size, size_t size,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints, CoglBufferMapHint hints,
CoglError **error) GError **error)
{ {
g_return_val_if_fail (cogl_is_buffer (buffer), NULL); g_return_val_if_fail (cogl_is_buffer (buffer), NULL);
g_return_val_if_fail (!(buffer->flags & COGL_BUFFER_FLAG_MAPPED), NULL); g_return_val_if_fail (!(buffer->flags & COGL_BUFFER_FLAG_MAPPED), NULL);
@ -293,7 +292,7 @@ _cogl_buffer_map_range_for_fill_or_fallback (CoglBuffer *buffer,
{ {
CoglContext *ctx = buffer->context; CoglContext *ctx = buffer->context;
void *ret; void *ret;
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
g_return_val_if_fail (!ctx->buffer_map_fallback_in_use, NULL); g_return_val_if_fail (!ctx->buffer_map_fallback_in_use, NULL);
@ -309,7 +308,7 @@ _cogl_buffer_map_range_for_fill_or_fallback (CoglBuffer *buffer,
if (ret) if (ret)
return ret; return ret;
cogl_error_free (ignore_error); g_error_free (ignore_error);
/* If the map fails then we'll use a temporary buffer to fill /* If the map fails then we'll use a temporary buffer to fill
the data and then upload it using cogl_buffer_set_data when the data and then upload it using cogl_buffer_set_data when
@ -364,7 +363,7 @@ _cogl_buffer_set_data (CoglBuffer *buffer,
size_t offset, size_t offset,
const void *data, const void *data,
size_t size, size_t size,
CoglError **error) GError **error)
{ {
g_return_val_if_fail (cogl_is_buffer (buffer), FALSE); g_return_val_if_fail (cogl_is_buffer (buffer), FALSE);
g_return_val_if_fail ((offset + size) <= buffer->size, FALSE); g_return_val_if_fail ((offset + size) <= buffer->size, FALSE);
@ -381,11 +380,10 @@ cogl_buffer_set_data (CoglBuffer *buffer,
const void *data, const void *data,
size_t size) size_t size)
{ {
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
gboolean status = gboolean status =
_cogl_buffer_set_data (buffer, offset, data, size, &ignore_error); _cogl_buffer_set_data (buffer, offset, data, size, &ignore_error);
if (!status) g_clear_error (&ignore_error);
cogl_error_free (ignore_error);
return status; return status;
} }

View File

@ -40,7 +40,6 @@
#define __COGL_BUFFER_H__ #define __COGL_BUFFER_H__
#include <cogl/cogl-types.h> #include <cogl/cogl-types.h>
#include <cogl/cogl-error.h>
G_BEGIN_DECLS G_BEGIN_DECLS
@ -258,7 +257,7 @@ cogl_buffer_map (CoglBuffer *buffer,
* @access: how the mapped buffer will be used by the application * @access: how the mapped buffer will be used by the application
* @hints: A mask of #CoglBufferMapHint<!-- -->s that tell Cogl how * @hints: A mask of #CoglBufferMapHint<!-- -->s that tell Cogl how
* the data will be modified once mapped. * the data will be modified once mapped.
* @error: A #CoglError for catching exceptional errors * @error: A #GError for catching exceptional errors
* *
* Maps a sub-region of the buffer into the application's address space * Maps a sub-region of the buffer into the application's address space
* for direct access. * for direct access.
@ -288,7 +287,7 @@ cogl_buffer_map_range (CoglBuffer *buffer,
size_t size, size_t size,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints, CoglBufferMapHint hints,
CoglError **error); GError **error);
/** /**
* cogl_buffer_unmap: * cogl_buffer_unmap:

View File

@ -363,7 +363,7 @@ _cogl_context_get_winsys (CoglContext *context);
* return FALSE and set @error */ * return FALSE and set @error */
gboolean gboolean
_cogl_context_update_features (CoglContext *context, _cogl_context_update_features (CoglContext *context,
CoglError **error); GError **error);
/* Obtains the context and returns retval if NULL */ /* Obtains the context and returns retval if NULL */
#define _COGL_GET_CONTEXT(ctxvar, retval) \ #define _COGL_GET_CONTEXT(ctxvar, retval) \

View File

@ -47,7 +47,6 @@
#include "cogl1-context.h" #include "cogl1-context.h"
#include "cogl-gpu-info-private.h" #include "cogl-gpu-info-private.h"
#include "cogl-config-private.h" #include "cogl-config-private.h"
#include "cogl-error-private.h"
#include "cogl-gtype-private.h" #include "cogl-gtype-private.h"
#include "driver/gl/cogl-pipeline-opengl-private.h" #include "driver/gl/cogl-pipeline-opengl-private.h"
#include "driver/gl/cogl-util-gl-private.h" #include "driver/gl/cogl-util-gl-private.h"
@ -123,7 +122,7 @@ _cogl_context_get_winsys (CoglContext *context)
*/ */
CoglContext * CoglContext *
cogl_context_new (CoglDisplay *display, cogl_context_new (CoglDisplay *display,
CoglError **error) GError **error)
{ {
CoglContext *context; CoglContext *context;
uint8_t white_pixel[] = { 0xff, 0xff, 0xff, 0xff }; uint8_t white_pixel[] = { 0xff, 0xff, 0xff, 0xff };
@ -528,7 +527,7 @@ _cogl_context_free (CoglContext *context)
CoglContext * CoglContext *
_cogl_context_get_default (void) _cogl_context_get_default (void)
{ {
CoglError *error = NULL; GError *error = NULL;
/* Create if doesn't exist yet */ /* Create if doesn't exist yet */
if (_cogl_context == NULL) if (_cogl_context == NULL)
{ {
@ -537,7 +536,7 @@ _cogl_context_get_default (void)
{ {
g_warning ("Failed to create default context: %s", g_warning ("Failed to create default context: %s",
error->message); error->message);
cogl_error_free (error); g_error_free (error);
} }
} }
@ -558,7 +557,7 @@ cogl_context_get_renderer (CoglContext *context)
gboolean gboolean
_cogl_context_update_features (CoglContext *context, _cogl_context_update_features (CoglContext *context,
CoglError **error) GError **error)
{ {
return context->driver_vtable->update_features (context, error); return context->driver_vtable->update_features (context, error);
} }

View File

@ -104,7 +104,7 @@ GType cogl_context_get_gtype (void);
/** /**
* cogl_context_new: (constructor) * cogl_context_new: (constructor)
* @display: (allow-none): A #CoglDisplay pointer * @display: (allow-none): A #CoglDisplay pointer
* @error: A CoglError return location. * @error: A GError return location.
* *
* Creates a new #CoglContext which acts as an application sandbox * Creates a new #CoglContext which acts as an application sandbox
* for any state objects that are allocated. * for any state objects that are allocated.
@ -115,7 +115,7 @@ GType cogl_context_get_gtype (void);
*/ */
CoglContext * CoglContext *
cogl_context_new (CoglDisplay *display, cogl_context_new (CoglDisplay *display,
CoglError **error); GError **error);
/** /**
* cogl_context_get_display: * cogl_context_get_display:

View File

@ -87,7 +87,7 @@ cogl_display_new (CoglRenderer *renderer,
CoglOnscreenTemplate *onscreen_template) CoglOnscreenTemplate *onscreen_template)
{ {
CoglDisplay *display = g_slice_new0 (CoglDisplay); CoglDisplay *display = g_slice_new0 (CoglDisplay);
CoglError *error = NULL; GError *error = NULL;
_cogl_init (); _cogl_init ();
@ -137,7 +137,7 @@ cogl_display_set_onscreen_template (CoglDisplay *display,
gboolean gboolean
cogl_display_setup (CoglDisplay *display, cogl_display_setup (CoglDisplay *display,
CoglError **error) GError **error)
{ {
const CoglWinsysVtable *winsys; const CoglWinsysVtable *winsys;

View File

@ -158,7 +158,7 @@ cogl_display_set_onscreen_template (CoglDisplay *display,
/** /**
* cogl_display_setup: * cogl_display_setup:
* @display: a #CoglDisplay * @display: a #CoglDisplay
* @error: return location for a #CoglError * @error: return location for a #GError
* *
* Explicitly sets up the given @display object. Use of this api is * Explicitly sets up the given @display object. Use of this api is
* optional since Cogl will internally setup the display if not done * optional since Cogl will internally setup the display if not done
@ -188,7 +188,7 @@ cogl_display_set_onscreen_template (CoglDisplay *display,
*/ */
gboolean gboolean
cogl_display_setup (CoglDisplay *display, cogl_display_setup (CoglDisplay *display,
CoglError **error); GError **error);
/** /**
* cogl_is_display: * cogl_is_display:

View File

@ -58,11 +58,11 @@ struct _CoglDriverVtable
gboolean gboolean
(* update_features) (CoglContext *context, (* update_features) (CoglContext *context,
CoglError **error); GError **error);
gboolean gboolean
(* offscreen_allocate) (CoglOffscreen *offscreen, (* offscreen_allocate) (CoglOffscreen *offscreen,
CoglError **error); GError **error);
void void
(* offscreen_free) (CoglOffscreen *offscreen); (* offscreen_free) (CoglOffscreen *offscreen);
@ -118,7 +118,7 @@ struct _CoglDriverVtable
int y, int y,
CoglReadPixelsFlags source, CoglReadPixelsFlags source,
CoglBitmap *bitmap, CoglBitmap *bitmap,
CoglError **error); GError **error);
/* Destroys any driver specific resources associated with the given /* Destroys any driver specific resources associated with the given
* 2D texture. */ * 2D texture. */
@ -146,7 +146,7 @@ struct _CoglDriverVtable
* to the configured size and format of the texture */ * to the configured size and format of the texture */
gboolean gboolean
(* texture_2d_allocate) (CoglTexture *tex, (* texture_2d_allocate) (CoglTexture *tex,
CoglError **error); GError **error);
/* Initialize the specified region of storage of the given texture /* Initialize the specified region of storage of the given texture
* with the contents of the specified framebuffer region * with the contents of the specified framebuffer region
@ -190,7 +190,7 @@ struct _CoglDriverVtable
int dst_x, int dst_x,
int dst_y, int dst_y,
int level, int level,
CoglError **error); GError **error);
gboolean gboolean
(* texture_2d_is_get_data_supported) (CoglTexture2D *tex_2d); (* texture_2d_is_get_data_supported) (CoglTexture2D *tex_2d);
@ -239,7 +239,7 @@ struct _CoglDriverVtable
size_t size, size_t size,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints, CoglBufferMapHint hints,
CoglError **error); GError **error);
/* Unmaps a buffer */ /* Unmaps a buffer */
void void
@ -252,7 +252,7 @@ struct _CoglDriverVtable
unsigned int offset, unsigned int offset,
const void *data, const void *data,
unsigned int size, unsigned int size,
CoglError **error); GError **error);
}; };
#define COGL_DRIVER_ERROR (_cogl_driver_error_quark ()) #define COGL_DRIVER_ERROR (_cogl_driver_error_quark ())

View File

@ -1,57 +0,0 @@
/*
* Cogl
*
* A Low Level GPU Graphics and Utilities API
*
* Copyright (C) 2012 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef __COGL_ERROR_PRIVATE_H__
#define __COGL_ERROR_PRIVATE_H__
#include "cogl-error.h"
void
_cogl_set_error (CoglError **error,
uint32_t domain,
int code,
const char *format,
...) G_GNUC_PRINTF (4, 5);
void
_cogl_set_error_literal (CoglError **error,
uint32_t domain,
int code,
const char *message);
void
_cogl_propagate_error (CoglError **dest,
CoglError *src);
void
_cogl_propagate_gerror (CoglError **dest,
GError *src);
#define _cogl_clear_error(X) g_clear_error ((GError **)X)
#endif /* __COGL_ERROR_PRIVATE_H__ */

View File

@ -1,126 +0,0 @@
/*
* Cogl
*
* A Low Level GPU Graphics and Utilities API
*
* Copyright (C) 2011 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Authors:
* Robert Bragg <robert@linux.intel.com>
*/
#include "cogl-config.h"
#include "cogl-types.h"
#include "cogl-util.h"
#include "cogl-error-private.h"
#include <glib.h>
void
cogl_error_free (CoglError *error)
{
g_error_free ((GError *)error);
}
CoglError *
cogl_error_copy (CoglError *error)
{
return (CoglError *)g_error_copy ((GError *)error);
}
gboolean
cogl_error_matches (CoglError *error,
uint32_t domain,
int code)
{
return g_error_matches ((GError *)error, domain, code);
}
#define ERROR_OVERWRITTEN_WARNING \
"CoglError set over the top of a previous CoglError or " \
"uninitialized memory.\nThis indicates a bug in someone's " \
"code. You must ensure an error is NULL before it's set.\n" \
"The overwriting error message was: %s"
void
_cogl_set_error (CoglError **error,
uint32_t domain,
int code,
const char *format,
...)
{
GError *new;
va_list args;
va_start (args, format);
if (error == NULL)
{
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
va_end (args);
return;
}
new = g_error_new_valist (domain, code, format, args);
va_end (args);
if (*error == NULL)
*error = (CoglError *)new;
else
g_warning (ERROR_OVERWRITTEN_WARNING, new->message);
}
void
_cogl_set_error_literal (CoglError **error,
uint32_t domain,
int code,
const char *message)
{
_cogl_set_error (error, domain, code, "%s", message);
}
void
_cogl_propagate_error (CoglError **dest,
CoglError *src)
{
g_return_if_fail (src != NULL);
if (dest == NULL)
{
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, "%s", src->message);
cogl_error_free (src);
}
else if (*dest)
g_warning (ERROR_OVERWRITTEN_WARNING, src->message);
else
*dest = src;
}
void
_cogl_propagate_gerror (CoglError **dest,
GError *src)
{
_cogl_propagate_error (dest, (CoglError *) src);
}

View File

@ -1,169 +0,0 @@
/*
* Cogl
*
* A Low Level GPU Graphics and Utilities API
*
* Copyright (C) 2012 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION)
#error "Only <cogl/cogl.h> can be included directly."
#endif
#ifndef __COGL_ERROR_H__
#define __COGL_ERROR_H__
#include "cogl-types.h"
G_BEGIN_DECLS
/**
* SECTION:cogl-error
* @short_description: A way for Cogl to throw exceptions
*
* As a general rule Cogl shields non-recoverable errors from
* developers, such as most heap allocation failures (unless for
* exceptionally large resources which we might reasonably expect to
* fail) and this reduces the burden on developers.
*
* There are some Cogl apis though that can fail for exceptional
* reasons that can also potentially be recovered from at runtime
* and for these apis we use a standard convention for reporting
* runtime recoverable errors.
*
* As an example if we look at the cogl_context_new() api which
* takes an error argument:
* |[
* CoglContext *
* cogl_context_new (CoglDisplay *display, CoglError **error);
* ]|
*
* A caller interested in catching any runtime error when creating a
* new #CoglContext would pass the address of a #CoglError pointer
* that has first been initialized to %NULL as follows:
*
* |[
* CoglError *error = NULL;
* CoglContext *context;
*
* context = cogl_context_new (NULL, &error);
* ]|
*
* The return status should usually be enough to determine if there
* was an error set (in this example we can check if context == %NULL)
* but if it's not possible to tell from the function's return status
* you can instead look directly at the error pointer which you
* initialized to %NULL. In this example we now check the error,
* report any error to the user, free the error and then simply
* abort without attempting to recover.
*
* |[
* if (context == NULL)
* {
* fprintf (stderr, "Failed to create a Cogl context: %s\n",
* error->message);
* cogl_error_free (error);
* abort ();
* }
* ]|
*
* All Cogl APIs that accept an error argument can also be passed a
* %NULL pointer. In this case if an exceptional error condition is hit
* then Cogl will simply log the error message and abort the
* application. This can be compared to language execeptions where the
* developer has not attempted to catch the exception. This means the
* above example is essentially redundant because it's what Cogl would
* have done automatically and so, similarly, if your application has
* no way to recover from a particular error you might just as well
* pass a %NULL #CoglError pointer to save a bit of typing.
*
* <note>If you are used to using the GLib API you will probably
* recognize that #CoglError is just like a #GError. In fact if Cogl
* has been built with --enable-glib then it is safe to cast a
* #CoglError to a #GError.</note>
*
* <note>An important detail to be aware of if you are used to using
* GLib's GError API is that Cogl deviates from the GLib GError
* conventions in one noteable way which is that a %NULL error pointer
* does not mean you want to ignore the details of an error, it means
* you are not trying to catch any exceptional errors the function might
* throw which will result in the program aborting with a log message
* if an error is thrown.</note>
*/
#define CoglError GError
/**
* cogl_error_free:
* @error: A #CoglError thrown by the Cogl api
*
* Frees a #CoglError and associated resources.
*/
void
cogl_error_free (CoglError *error);
/**
* cogl_error_copy:
* @error: A #CoglError thrown by the Cogl api
*
* Makes a copy of @error which can later be freed using
* cogl_error_free().
*
* Return value: A newly allocated #CoglError initialized to match the
* contents of @error.
*/
CoglError *
cogl_error_copy (CoglError *error);
/**
* cogl_error_matches:
* @error: A #CoglError thrown by the Cogl api or %NULL
* @domain: The error domain
* @code: The error code
*
* Returns %TRUE if error matches @domain and @code, %FALSE otherwise.
* In particular, when error is %NULL, FALSE will be returned.
*
* Return value: whether the @error corresponds to the given @domain
* and @code.
*/
gboolean
cogl_error_matches (CoglError *error,
uint32_t domain,
int code);
/**
* COGL_GLIB_ERROR:
* @COGL_ERROR: A #CoglError thrown by the Cogl api or %NULL
*
* Simply casts a #CoglError to a #CoglError
*
* If Cogl is built with GLib support then it can safely be assumed
* that a CoglError is a GError and can be used directly with the
* GError api.
*/
#define COGL_GLIB_ERROR(COGL_ERROR) ((CoglError *)COGL_ERROR)
G_END_DECLS
#endif /* __COGL_ERROR_H__ */

View File

@ -497,7 +497,7 @@ _cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
int y, int y,
CoglReadPixelsFlags source, CoglReadPixelsFlags source,
CoglBitmap *bitmap, CoglBitmap *bitmap,
CoglError **error); GError **error);
/* /*
* _cogl_framebuffer_get_stencil_bits: * _cogl_framebuffer_get_stencil_bits:

View File

@ -50,7 +50,6 @@
#include "cogl1-context.h" #include "cogl1-context.h"
#include "cogl-private.h" #include "cogl-private.h"
#include "cogl-primitives-private.h" #include "cogl-primitives-private.h"
#include "cogl-error-private.h"
#include "cogl-gtype-private.h" #include "cogl-gtype-private.h"
#include "driver/gl/cogl-texture-gl-private.h" #include "driver/gl/cogl-texture-gl-private.h"
#include "winsys/cogl-winsys-private.h" #include "winsys/cogl-winsys-private.h"
@ -650,12 +649,12 @@ CoglOffscreen *
cogl_offscreen_new_to_texture (CoglTexture *texture) cogl_offscreen_new_to_texture (CoglTexture *texture)
{ {
CoglOffscreen *ret = _cogl_offscreen_new_with_texture_full (texture, 0, 0); CoglOffscreen *ret = _cogl_offscreen_new_with_texture_full (texture, 0, 0);
CoglError *error = NULL; GError *error = NULL;
if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (ret), &error)) if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (ret), &error))
{ {
cogl_object_unref (ret); cogl_object_unref (ret);
cogl_error_free (error); g_error_free (error);
ret = NULL; ret = NULL;
} }
@ -696,7 +695,7 @@ _cogl_offscreen_free (CoglOffscreen *offscreen)
gboolean gboolean
cogl_framebuffer_allocate (CoglFramebuffer *framebuffer, cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
CoglError **error) GError **error)
{ {
CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer); CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer);
const CoglWinsysVtable *winsys = _cogl_framebuffer_get_winsys (framebuffer); const CoglWinsysVtable *winsys = _cogl_framebuffer_get_winsys (framebuffer);
@ -709,7 +708,7 @@ cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
{ {
if (framebuffer->config.depth_texture_enabled) if (framebuffer->config.depth_texture_enabled)
{ {
_cogl_set_error (error, COGL_FRAMEBUFFER_ERROR, g_set_error_literal (error, COGL_FRAMEBUFFER_ERROR,
COGL_FRAMEBUFFER_ERROR_ALLOCATE, COGL_FRAMEBUFFER_ERROR_ALLOCATE,
"Can't allocate onscreen framebuffer with a " "Can't allocate onscreen framebuffer with a "
"texture based depth buffer"); "texture based depth buffer");
@ -732,7 +731,7 @@ cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
if (!cogl_has_feature (ctx, COGL_FEATURE_ID_OFFSCREEN)) if (!cogl_has_feature (ctx, COGL_FEATURE_ID_OFFSCREEN))
{ {
_cogl_set_error (error, COGL_SYSTEM_ERROR, g_set_error_literal (error, COGL_SYSTEM_ERROR,
COGL_SYSTEM_ERROR_UNSUPPORTED, COGL_SYSTEM_ERROR_UNSUPPORTED,
"Offscreen framebuffers not supported by system"); "Offscreen framebuffers not supported by system");
return FALSE; return FALSE;
@ -745,8 +744,7 @@ cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
* determine whether a texture needs slicing... */ * determine whether a texture needs slicing... */
if (cogl_texture_is_sliced (offscreen->texture)) if (cogl_texture_is_sliced (offscreen->texture))
{ {
_cogl_set_error (error, COGL_SYSTEM_ERROR, g_set_error (error, COGL_SYSTEM_ERROR, COGL_SYSTEM_ERROR_UNSUPPORTED,
COGL_SYSTEM_ERROR_UNSUPPORTED,
"Can't create offscreen framebuffer from " "Can't create offscreen framebuffer from "
"sliced texture"); "sliced texture");
return FALSE; return FALSE;
@ -1212,7 +1210,7 @@ _cogl_framebuffer_try_fast_read_pixel (CoglFramebuffer *framebuffer,
y < framebuffer->clear_clip_y1) y < framebuffer->clear_clip_y1)
{ {
uint8_t *pixel; uint8_t *pixel;
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
/* we currently only care about cases where the premultiplied or /* we currently only care about cases where the premultiplied or
* unpremultipled colors are equivalent... */ * unpremultipled colors are equivalent... */
@ -1225,7 +1223,7 @@ _cogl_framebuffer_try_fast_read_pixel (CoglFramebuffer *framebuffer,
&ignore_error); &ignore_error);
if (pixel == NULL) if (pixel == NULL)
{ {
cogl_error_free (ignore_error); g_error_free (ignore_error);
return FALSE; return FALSE;
} }
@ -1248,7 +1246,7 @@ _cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
int y, int y,
CoglReadPixelsFlags source, CoglReadPixelsFlags source,
CoglBitmap *bitmap, CoglBitmap *bitmap,
CoglError **error) GError **error)
{ {
CoglContext *ctx; CoglContext *ctx;
int width; int width;
@ -1299,13 +1297,12 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
CoglReadPixelsFlags source, CoglReadPixelsFlags source,
CoglBitmap *bitmap) CoglBitmap *bitmap)
{ {
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
gboolean status = gboolean status =
_cogl_framebuffer_read_pixels_into_bitmap (framebuffer, _cogl_framebuffer_read_pixels_into_bitmap (framebuffer,
x, y, source, bitmap, x, y, source, bitmap,
&ignore_error); &ignore_error);
if (!status) g_clear_error (&ignore_error);
cogl_error_free (ignore_error);
return status; return status;
} }

View File

@ -106,7 +106,7 @@ GType cogl_framebuffer_get_gtype (void);
/** /**
* cogl_framebuffer_allocate: * cogl_framebuffer_allocate:
* @framebuffer: A #CoglFramebuffer * @framebuffer: A #CoglFramebuffer
* @error: A pointer to a #CoglError for returning exceptions. * @error: A pointer to a #GError for returning exceptions.
* *
* Explicitly allocates a configured #CoglFramebuffer allowing developers to * Explicitly allocates a configured #CoglFramebuffer allowing developers to
* check and handle any errors that might arise from an unsupported * check and handle any errors that might arise from an unsupported
@ -125,7 +125,7 @@ GType cogl_framebuffer_get_gtype (void);
*/ */
gboolean gboolean
cogl_framebuffer_allocate (CoglFramebuffer *framebuffer, cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
CoglError **error); GError **error);
/** /**
* cogl_framebuffer_get_width: * cogl_framebuffer_get_width:

View File

@ -48,7 +48,6 @@
#include "cogl-swap-chain-private.h" #include "cogl-swap-chain-private.h"
#include "cogl-texture-2d-gl.h" #include "cogl-texture-2d-gl.h"
#include "cogl-texture-2d-private.h" #include "cogl-texture-2d-private.h"
#include "cogl-error-private.h"
#include "cogl-gtype-private.h" #include "cogl-gtype-private.h"
#include "driver/gl/cogl-framebuffer-gl-private.h" #include "driver/gl/cogl-framebuffer-gl-private.h"
#include "driver/gl/cogl-pipeline-opengl-private.h" #include "driver/gl/cogl-pipeline-opengl-private.h"
@ -1566,14 +1565,14 @@ free_texture_object_data (CoglGLES2TextureObjectData *data)
} }
CoglGLES2Context * CoglGLES2Context *
cogl_gles2_context_new (CoglContext *ctx, CoglError **error) cogl_gles2_context_new (CoglContext *ctx, GError **error)
{ {
CoglGLES2Context *gles2_ctx; CoglGLES2Context *gles2_ctx;
const CoglWinsysVtable *winsys; const CoglWinsysVtable *winsys;
if (!cogl_has_feature (ctx, COGL_FEATURE_ID_GLES2_CONTEXT)) if (!cogl_has_feature (ctx, COGL_FEATURE_ID_GLES2_CONTEXT))
{ {
_cogl_set_error (error, COGL_GLES2_CONTEXT_ERROR, g_set_error_literal (error, COGL_GLES2_CONTEXT_ERROR,
COGL_GLES2_CONTEXT_ERROR_UNSUPPORTED, COGL_GLES2_CONTEXT_ERROR_UNSUPPORTED,
"Backend doesn't support creating GLES2 contexts"); "Backend doesn't support creating GLES2 contexts");
@ -1693,11 +1692,11 @@ cogl_gles2_context_get_vtable (CoglGLES2Context *gles2_ctx)
static CoglGLES2Offscreen * static CoglGLES2Offscreen *
_cogl_gles2_offscreen_allocate (CoglOffscreen *offscreen, _cogl_gles2_offscreen_allocate (CoglOffscreen *offscreen,
CoglGLES2Context *gles2_context, CoglGLES2Context *gles2_context,
CoglError **error) GError **error)
{ {
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (offscreen); CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (offscreen);
const CoglWinsysVtable *winsys; const CoglWinsysVtable *winsys;
CoglError *internal_error = NULL; GError *internal_error = NULL;
CoglGLES2Offscreen *gles2_offscreen; CoglGLES2Offscreen *gles2_offscreen;
int level_width; int level_width;
int level_height; int level_height;
@ -1722,8 +1721,8 @@ _cogl_gles2_offscreen_allocate (CoglOffscreen *offscreen,
{ {
winsys->restore_context (framebuffer->context); winsys->restore_context (framebuffer->context);
cogl_error_free (internal_error); g_error_free (internal_error);
_cogl_set_error (error, COGL_FRAMEBUFFER_ERROR, g_set_error_literal (error, COGL_FRAMEBUFFER_ERROR,
COGL_FRAMEBUFFER_ERROR_ALLOCATE, COGL_FRAMEBUFFER_ERROR_ALLOCATE,
"Failed to bind gles2 context to create framebuffer"); "Failed to bind gles2 context to create framebuffer");
return NULL; return NULL;
@ -1751,7 +1750,7 @@ _cogl_gles2_offscreen_allocate (CoglOffscreen *offscreen,
g_slice_free (CoglGLES2Offscreen, gles2_offscreen); g_slice_free (CoglGLES2Offscreen, gles2_offscreen);
_cogl_set_error (error, COGL_FRAMEBUFFER_ERROR, g_set_error_literal (error, COGL_FRAMEBUFFER_ERROR,
COGL_FRAMEBUFFER_ERROR_ALLOCATE, COGL_FRAMEBUFFER_ERROR_ALLOCATE,
"Failed to create an OpenGL framebuffer object"); "Failed to create an OpenGL framebuffer object");
return NULL; return NULL;
@ -1781,10 +1780,10 @@ cogl_push_gles2_context (CoglContext *ctx,
CoglGLES2Context *gles2_ctx, CoglGLES2Context *gles2_ctx,
CoglFramebuffer *read_buffer, CoglFramebuffer *read_buffer,
CoglFramebuffer *write_buffer, CoglFramebuffer *write_buffer,
CoglError **error) GError **error)
{ {
const CoglWinsysVtable *winsys = ctx->display->renderer->winsys_vtable; const CoglWinsysVtable *winsys = ctx->display->renderer->winsys_vtable;
CoglError *internal_error = NULL; GError *internal_error = NULL;
g_return_val_if_fail (gles2_ctx != NULL, FALSE); g_return_val_if_fail (gles2_ctx != NULL, FALSE);
@ -1863,8 +1862,8 @@ cogl_push_gles2_context (CoglContext *ctx,
{ {
winsys->restore_context (ctx); winsys->restore_context (ctx);
cogl_error_free (internal_error); g_error_free (internal_error);
_cogl_set_error (error, COGL_GLES2_CONTEXT_ERROR, g_set_error_literal (error, COGL_GLES2_CONTEXT_ERROR,
COGL_GLES2_CONTEXT_ERROR_DRIVER, COGL_GLES2_CONTEXT_ERROR_DRIVER,
"Driver failed to make GLES2 context current"); "Driver failed to make GLES2 context current");
return FALSE; return FALSE;

View File

@ -189,7 +189,7 @@ typedef enum /*< prefix=COGL_GLES2_CONTEXT_ERROR >*/
/** /**
* cogl_gles2_context_new: * cogl_gles2_context_new:
* @ctx: A #CoglContext * @ctx: A #CoglContext
* @error: A pointer to a #CoglError for returning exceptions * @error: A pointer to a #GError for returning exceptions
* *
* Allocates a new OpenGLES 2.0 context that can be used to render to * Allocates a new OpenGLES 2.0 context that can be used to render to
* #CoglOffscreen framebuffers (Rendering to #CoglOnscreen * #CoglOffscreen framebuffers (Rendering to #CoglOnscreen
@ -216,7 +216,7 @@ typedef enum /*< prefix=COGL_GLES2_CONTEXT_ERROR >*/
* Stability: unstable * Stability: unstable
*/ */
CoglGLES2Context * CoglGLES2Context *
cogl_gles2_context_new (CoglContext *ctx, CoglError **error); cogl_gles2_context_new (CoglContext *ctx, GError **error);
/** /**
* cogl_gles2_context_get_vtable: * cogl_gles2_context_get_vtable:
@ -248,7 +248,7 @@ cogl_gles2_context_get_vtable (CoglGLES2Context *gles2_ctx);
* @write_buffer: A #CoglFramebuffer to access for drawing operations * @write_buffer: A #CoglFramebuffer to access for drawing operations
* such as glDrawArrays. (must be a #CoglOffscreen * such as glDrawArrays. (must be a #CoglOffscreen
* framebuffer currently) * framebuffer currently)
* @error: A pointer to a #CoglError for returning exceptions * @error: A pointer to a #GError for returning exceptions
* *
* Pushes the given @gles2_ctx onto a stack associated with @ctx so * Pushes the given @gles2_ctx onto a stack associated with @ctx so
* that the OpenGLES 2.0 api can be used instead of the Cogl * that the OpenGLES 2.0 api can be used instead of the Cogl
@ -272,7 +272,7 @@ cogl_push_gles2_context (CoglContext *ctx,
CoglGLES2Context *gles2_ctx, CoglGLES2Context *gles2_ctx,
CoglFramebuffer *read_buffer, CoglFramebuffer *read_buffer,
CoglFramebuffer *write_buffer, CoglFramebuffer *write_buffer,
CoglError **error); GError **error);
/** /**
* cogl_pop_gles2_context: * cogl_pop_gles2_context:

View File

@ -91,7 +91,7 @@ cogl_indices_new (CoglContext *context,
CoglIndexBuffer *index_buffer = cogl_index_buffer_new (context, buffer_bytes); CoglIndexBuffer *index_buffer = cogl_index_buffer_new (context, buffer_bytes);
CoglBuffer *buffer = COGL_BUFFER (index_buffer); CoglBuffer *buffer = COGL_BUFFER (index_buffer);
CoglIndices *indices; CoglIndices *indices;
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
_cogl_buffer_set_data (buffer, _cogl_buffer_set_data (buffer,
0, 0,
@ -100,7 +100,7 @@ cogl_indices_new (CoglContext *context,
&ignore_error); &ignore_error);
if (ignore_error) if (ignore_error)
{ {
cogl_error_free (ignore_error); g_error_free (ignore_error);
cogl_object_unref (index_buffer); cogl_object_unref (index_buffer);
return NULL; return NULL;
} }

View File

@ -1786,7 +1786,7 @@ _cogl_journal_try_read_pixel (CoglJournal *journal,
float poly[16]; float poly[16];
CoglFramebuffer *framebuffer = journal->framebuffer; CoglFramebuffer *framebuffer = journal->framebuffer;
uint8_t *pixel; uint8_t *pixel;
CoglError *ignore_error; GError *ignore_error;
entry_to_screen_polygon (framebuffer, entry, vertices, poly); entry_to_screen_polygon (framebuffer, entry, vertices, poly);
@ -1831,7 +1831,7 @@ _cogl_journal_try_read_pixel (CoglJournal *journal,
&ignore_error); &ignore_error);
if (pixel == NULL) if (pixel == NULL)
{ {
cogl_error_free (ignore_error); g_error_free (ignore_error);
return FALSE; return FALSE;
} }

View File

@ -36,7 +36,6 @@
#include <cogl/cogl-texture.h> #include <cogl/cogl-texture.h>
#include <cogl/cogl-meta-texture.h> #include <cogl/cogl-meta-texture.h>
#include <cogl/cogl-error-private.h>
#include <cogl/cogl-frame-info-private.h> #include <cogl/cogl-frame-info-private.h>
#include <cogl/cogl-renderer-private.h> #include <cogl/cogl-renderer-private.h>
#if defined (COGL_HAS_EGL_SUPPORT) #if defined (COGL_HAS_EGL_SUPPORT)

View File

@ -90,7 +90,7 @@ GType cogl_offscreen_get_gtype (void);
* message. If you need to be able to catch such exceptions at runtime * message. If you need to be able to catch such exceptions at runtime
* then you can explicitly allocate your framebuffer when you have * then you can explicitly allocate your framebuffer when you have
* finished configuring it by calling cogl_framebuffer_allocate() and * finished configuring it by calling cogl_framebuffer_allocate() and
* passing in a #CoglError argument to catch any exceptions. * passing in a #GError argument to catch any exceptions.
* *
* Return value: (transfer full): a newly instantiated #CoglOffscreen * Return value: (transfer full): a newly instantiated #CoglOffscreen
* framebuffer. * framebuffer.

View File

@ -41,7 +41,6 @@
#include "cogl-snippet-private.h" #include "cogl-snippet-private.h"
#include "cogl-texture-private.h" #include "cogl-texture-private.h"
#include "cogl-pipeline-layer-state-private.h" #include "cogl-pipeline-layer-state-private.h"
#include "cogl-error-private.h"
#include "string.h" #include "string.h"
#if 0 #if 0
@ -602,7 +601,7 @@ gboolean
cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline, cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
int layer_index, int layer_index,
gboolean enable, gboolean enable,
CoglError **error) GError **error)
{ {
CoglPipelineLayerState change = CoglPipelineLayerState change =
COGL_PIPELINE_LAYER_STATE_POINT_SPRITE_COORDS; COGL_PIPELINE_LAYER_STATE_POINT_SPRITE_COORDS;
@ -620,7 +619,7 @@ cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
{ {
if (error) if (error)
{ {
_cogl_set_error (error, g_set_error_literal (error,
COGL_SYSTEM_ERROR, COGL_SYSTEM_ERROR,
COGL_SYSTEM_ERROR_UNSUPPORTED, COGL_SYSTEM_ERROR_UNSUPPORTED,
"Point sprite texture coordinates are enabled for " "Point sprite texture coordinates are enabled for "
@ -1029,7 +1028,7 @@ gboolean
cogl_pipeline_set_layer_combine (CoglPipeline *pipeline, cogl_pipeline_set_layer_combine (CoglPipeline *pipeline,
int layer_index, int layer_index,
const char *combine_description, const char *combine_description,
CoglError **error) GError **error)
{ {
CoglPipelineLayerState state = COGL_PIPELINE_LAYER_STATE_COMBINE; CoglPipelineLayerState state = COGL_PIPELINE_LAYER_STATE_COMBINE;
CoglPipelineLayer *authority; CoglPipelineLayer *authority;

View File

@ -209,7 +209,7 @@ cogl_pipeline_remove_layer (CoglPipeline *pipeline,
* @layer_index: Specifies the layer you want define a combine function for * @layer_index: Specifies the layer you want define a combine function for
* @blend_string: A <link linkend="cogl-Blend-Strings">Cogl blend string</link> * @blend_string: A <link linkend="cogl-Blend-Strings">Cogl blend string</link>
* describing the desired texture combine function. * describing the desired texture combine function.
* @error: A #CoglError that may report parse errors or lack of GPU/driver * @error: A #GError that may report parse errors or lack of GPU/driver
* support. May be %NULL, in which case a warning will be printed out if an * support. May be %NULL, in which case a warning will be printed out if an
* error is encountered. * error is encountered.
* *
@ -301,7 +301,7 @@ gboolean
cogl_pipeline_set_layer_combine (CoglPipeline *pipeline, cogl_pipeline_set_layer_combine (CoglPipeline *pipeline,
int layer_index, int layer_index,
const char *blend_string, const char *blend_string,
CoglError **error); GError **error);
/** /**
* cogl_pipeline_set_layer_combine_constant: * cogl_pipeline_set_layer_combine_constant:
@ -423,7 +423,7 @@ cogl_pipeline_get_layer_mag_filter (CoglPipeline *pipeline,
* @pipeline: A #CoglPipeline object * @pipeline: A #CoglPipeline object
* @layer_index: the layer number to change. * @layer_index: the layer number to change.
* @enable: whether to enable point sprite coord generation. * @enable: whether to enable point sprite coord generation.
* @error: A return location for a CoglError, or NULL to ignore errors. * @error: A return location for a #GError, or NULL to ignore errors.
* *
* When rendering points, if @enable is %TRUE then the texture * When rendering points, if @enable is %TRUE then the texture
* coordinates for this layer will be replaced with coordinates that * coordinates for this layer will be replaced with coordinates that
@ -444,7 +444,7 @@ gboolean
cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline, cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
int layer_index, int layer_index,
gboolean enable, gboolean enable,
CoglError **error); GError **error);
/** /**
* cogl_pipeline_get_layer_point_sprite_coords_enabled: * cogl_pipeline_get_layer_point_sprite_coords_enabled:

View File

@ -40,7 +40,6 @@
#include "cogl-depth-state-private.h" #include "cogl-depth-state-private.h"
#include "cogl-pipeline-state-private.h" #include "cogl-pipeline-state-private.h"
#include "cogl-snippet-private.h" #include "cogl-snippet-private.h"
#include "cogl-error-private.h"
#include <test-fixtures/test-unit.h> #include <test-fixtures/test-unit.h>
@ -946,7 +945,7 @@ setup_blend_state (CoglBlendStringStatement *statement,
gboolean gboolean
cogl_pipeline_set_blend (CoglPipeline *pipeline, cogl_pipeline_set_blend (CoglPipeline *pipeline,
const char *blend_description, const char *blend_description,
CoglError **error) GError **error)
{ {
CoglPipelineState state = COGL_PIPELINE_STATE_BLEND; CoglPipelineState state = COGL_PIPELINE_STATE_BLEND;
CoglPipeline *authority; CoglPipeline *authority;
@ -1144,7 +1143,7 @@ cogl_pipeline_set_user_program (CoglPipeline *pipeline,
gboolean gboolean
cogl_pipeline_set_depth_state (CoglPipeline *pipeline, cogl_pipeline_set_depth_state (CoglPipeline *pipeline,
const CoglDepthState *depth_state, const CoglDepthState *depth_state,
CoglError **error) GError **error)
{ {
CoglPipelineState state = COGL_PIPELINE_STATE_DEPTH; CoglPipelineState state = COGL_PIPELINE_STATE_DEPTH;
CoglPipeline *authority; CoglPipeline *authority;
@ -1389,7 +1388,7 @@ cogl_pipeline_set_point_size (CoglPipeline *pipeline,
gboolean gboolean
cogl_pipeline_set_per_vertex_point_size (CoglPipeline *pipeline, cogl_pipeline_set_per_vertex_point_size (CoglPipeline *pipeline,
gboolean enable, gboolean enable,
CoglError **error) GError **error)
{ {
CoglPipelineState state = COGL_PIPELINE_STATE_PER_VERTEX_POINT_SIZE; CoglPipelineState state = COGL_PIPELINE_STATE_PER_VERTEX_POINT_SIZE;
CoglPipeline *authority; CoglPipeline *authority;
@ -1406,7 +1405,7 @@ cogl_pipeline_set_per_vertex_point_size (CoglPipeline *pipeline,
if (enable && !cogl_has_feature (ctx, COGL_FEATURE_ID_PER_VERTEX_POINT_SIZE)) if (enable && !cogl_has_feature (ctx, COGL_FEATURE_ID_PER_VERTEX_POINT_SIZE))
{ {
_cogl_set_error (error, g_set_error_literal (error,
COGL_SYSTEM_ERROR, COGL_SYSTEM_ERROR,
COGL_SYSTEM_ERROR_UNSUPPORTED, COGL_SYSTEM_ERROR_UNSUPPORTED,
"Per-vertex point size is not supported"); "Per-vertex point size is not supported");

View File

@ -390,7 +390,7 @@ cogl_pipeline_get_alpha_test_reference (CoglPipeline *pipeline);
* @pipeline: A #CoglPipeline object * @pipeline: A #CoglPipeline object
* @blend_string: A <link linkend="cogl-Blend-Strings">Cogl blend string</link> * @blend_string: A <link linkend="cogl-Blend-Strings">Cogl blend string</link>
* describing the desired blend function. * describing the desired blend function.
* @error: return location for a #CoglError that may report lack of driver * @error: return location for a #GError that may report lack of driver
* support if you give separate blend string statements for the alpha * support if you give separate blend string statements for the alpha
* channel and RGB channels since some drivers, or backends such as * channel and RGB channels since some drivers, or backends such as
* GLES 1.1, don't support this feature. May be %NULL, in which case a * GLES 1.1, don't support this feature. May be %NULL, in which case a
@ -470,7 +470,7 @@ cogl_pipeline_get_alpha_test_reference (CoglPipeline *pipeline);
gboolean gboolean
cogl_pipeline_set_blend (CoglPipeline *pipeline, cogl_pipeline_set_blend (CoglPipeline *pipeline,
const char *blend_string, const char *blend_string,
CoglError **error); GError **error);
/** /**
* cogl_pipeline_set_blend_constant: * cogl_pipeline_set_blend_constant:
@ -531,7 +531,7 @@ cogl_pipeline_get_point_size (CoglPipeline *pipeline);
* cogl_pipeline_set_per_vertex_point_size: * cogl_pipeline_set_per_vertex_point_size:
* @pipeline: a #CoglPipeline pointer * @pipeline: a #CoglPipeline pointer
* @enable: whether to enable per-vertex point size * @enable: whether to enable per-vertex point size
* @error: a location to store a #CoglError if the change failed * @error: a location to store a #GError if the change failed
* *
* Sets whether to use a per-vertex point size or to use the value set * Sets whether to use a per-vertex point size or to use the value set
* by cogl_pipeline_set_point_size(). If per-vertex point size is * by cogl_pipeline_set_point_size(). If per-vertex point size is
@ -547,7 +547,7 @@ cogl_pipeline_get_point_size (CoglPipeline *pipeline);
* Note that enabling this will only work if the * Note that enabling this will only work if the
* %COGL_FEATURE_ID_PER_VERTEX_POINT_SIZE feature is available. If * %COGL_FEATURE_ID_PER_VERTEX_POINT_SIZE feature is available. If
* this is not available then the function will return %FALSE and set * this is not available then the function will return %FALSE and set
* a #CoglError. * a #GError.
* *
* Since: 2.0 * Since: 2.0
* Stability: Unstable * Stability: Unstable
@ -556,7 +556,7 @@ cogl_pipeline_get_point_size (CoglPipeline *pipeline);
gboolean gboolean
cogl_pipeline_set_per_vertex_point_size (CoglPipeline *pipeline, cogl_pipeline_set_per_vertex_point_size (CoglPipeline *pipeline,
gboolean enable, gboolean enable,
CoglError **error); GError **error);
/** /**
* cogl_pipeline_get_per_vertex_point_size: * cogl_pipeline_get_per_vertex_point_size:
@ -637,7 +637,7 @@ cogl_pipeline_set_user_program (CoglPipeline *pipeline,
* cogl_pipeline_set_depth_state: (skip) * cogl_pipeline_set_depth_state: (skip)
* @pipeline: A #CoglPipeline object * @pipeline: A #CoglPipeline object
* @state: A #CoglDepthState struct * @state: A #CoglDepthState struct
* @error: A #CoglError to report failures to setup the given @state. * @error: A #GError to report failures to setup the given @state.
* *
* This commits all the depth state configured in @state struct to the * This commits all the depth state configured in @state struct to the
* given @pipeline. The configuration values are copied into the * given @pipeline. The configuration values are copied into the
@ -656,7 +656,7 @@ cogl_pipeline_set_user_program (CoglPipeline *pipeline,
gboolean gboolean
cogl_pipeline_set_depth_state (CoglPipeline *pipeline, cogl_pipeline_set_depth_state (CoglPipeline *pipeline,
const CoglDepthState *state, const CoglDepthState *state,
CoglError **error); GError **error);
/** /**
* cogl_pipeline_get_depth_state: (skip) * cogl_pipeline_get_depth_state: (skip)

View File

@ -77,7 +77,7 @@ static CoglPixelBuffer *
_cogl_pixel_buffer_new (CoglContext *context, _cogl_pixel_buffer_new (CoglContext *context,
size_t size, size_t size,
const void *data, const void *data,
CoglError **error) GError **error)
{ {
CoglPixelBuffer *pixel_buffer = g_slice_new0 (CoglPixelBuffer); CoglPixelBuffer *pixel_buffer = g_slice_new0 (CoglPixelBuffer);
CoglBuffer *buffer = COGL_BUFFER (pixel_buffer); CoglBuffer *buffer = COGL_BUFFER (pixel_buffer);
@ -113,11 +113,11 @@ cogl_pixel_buffer_new (CoglContext *context,
size_t size, size_t size,
const void *data) const void *data)
{ {
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
CoglPixelBuffer *buffer = CoglPixelBuffer *buffer =
_cogl_pixel_buffer_new (context, size, data, &ignore_error); _cogl_pixel_buffer_new (context, size, data, &ignore_error);
if (!buffer)
cogl_error_free (ignore_error); g_clear_error (&ignore_error);
return buffer; return buffer;
} }

View File

@ -44,7 +44,6 @@
#include "cogl-renderer-private.h" #include "cogl-renderer-private.h"
#include "cogl-display-private.h" #include "cogl-display-private.h"
#include "cogl-config-private.h" #include "cogl-config-private.h"
#include "cogl-error-private.h"
#include "cogl-gtype-private.h" #include "cogl-gtype-private.h"
#include "driver/gl/cogl-util-gl-private.h" #include "driver/gl/cogl-util-gl-private.h"
@ -284,7 +283,7 @@ cogl_xlib_renderer_set_threaded_swap_wait_enabled (CoglRenderer *renderer,
gboolean gboolean
cogl_renderer_check_onscreen_template (CoglRenderer *renderer, cogl_renderer_check_onscreen_template (CoglRenderer *renderer,
CoglOnscreenTemplate *onscreen_template, CoglOnscreenTemplate *onscreen_template,
CoglError **error) GError **error)
{ {
CoglDisplay *display; CoglDisplay *display;
@ -432,7 +431,7 @@ satisfy_constraints (CoglDriverDescription *description,
static gboolean static gboolean
_cogl_renderer_choose_driver (CoglRenderer *renderer, _cogl_renderer_choose_driver (CoglRenderer *renderer,
CoglError **error) GError **error)
{ {
const char *driver_name = g_getenv ("COGL_DRIVER"); const char *driver_name = g_getenv ("COGL_DRIVER");
CoglDriver driver_override = COGL_DRIVER_ANY; CoglDriver driver_override = COGL_DRIVER_ANY;
@ -457,8 +456,7 @@ _cogl_renderer_choose_driver (CoglRenderer *renderer,
if (driver_override != COGL_DRIVER_ANY && if (driver_override != COGL_DRIVER_ANY &&
renderer->driver_override != driver_override) renderer->driver_override != driver_override)
{ {
_cogl_set_error (error, g_set_error (error, COGL_RENDERER_ERROR,
COGL_RENDERER_ERROR,
COGL_RENDERER_ERROR_BAD_CONSTRAINT, COGL_RENDERER_ERROR_BAD_CONSTRAINT,
"Application driver selection conflicts with driver " "Application driver selection conflicts with driver "
"specified in configuration"); "specified in configuration");
@ -487,8 +485,7 @@ _cogl_renderer_choose_driver (CoglRenderer *renderer,
if (invalid_override) if (invalid_override)
{ {
_cogl_set_error (error, g_set_error (error, COGL_RENDERER_ERROR,
COGL_RENDERER_ERROR,
COGL_RENDERER_ERROR_BAD_CONSTRAINT, COGL_RENDERER_ERROR_BAD_CONSTRAINT,
"Driver \"%s\" is not available", "Driver \"%s\" is not available",
invalid_override); invalid_override);
@ -504,8 +501,7 @@ _cogl_renderer_choose_driver (CoglRenderer *renderer,
if (!state.driver_description) if (!state.driver_description)
{ {
_cogl_set_error (error, g_set_error (error, COGL_RENDERER_ERROR,
COGL_RENDERER_ERROR,
COGL_RENDERER_ERROR_BAD_CONSTRAINT, COGL_RENDERER_ERROR_BAD_CONSTRAINT,
"No suitable driver found"); "No suitable driver found");
return FALSE; return FALSE;
@ -530,7 +526,7 @@ _cogl_renderer_choose_driver (CoglRenderer *renderer,
if (renderer->libgl_module == NULL) if (renderer->libgl_module == NULL)
{ {
_cogl_set_error (error, COGL_DRIVER_ERROR, g_set_error (error, COGL_DRIVER_ERROR,
COGL_DRIVER_ERROR_FAILED_TO_LOAD_LIBRARY, COGL_DRIVER_ERROR_FAILED_TO_LOAD_LIBRARY,
"Failed to dynamically open the GL library \"%s\"", "Failed to dynamically open the GL library \"%s\"",
libgl_name); libgl_name);
@ -554,10 +550,10 @@ cogl_renderer_set_custom_winsys (CoglRenderer *renderer,
static gboolean static gboolean
connect_custom_winsys (CoglRenderer *renderer, connect_custom_winsys (CoglRenderer *renderer,
CoglError **error) GError **error)
{ {
const CoglWinsysVtable *winsys; const CoglWinsysVtable *winsys;
CoglError *tmp_error = NULL; GError *tmp_error = NULL;
GString *error_message; GString *error_message;
winsys = renderer->custom_winsys_vtable_getter (renderer); winsys = renderer->custom_winsys_vtable_getter (renderer);
@ -568,7 +564,7 @@ connect_custom_winsys (CoglRenderer *renderer,
{ {
g_string_append_c (error_message, '\n'); g_string_append_c (error_message, '\n');
g_string_append (error_message, tmp_error->message); g_string_append (error_message, tmp_error->message);
cogl_error_free (tmp_error); g_error_free (tmp_error);
} }
else else
{ {
@ -578,16 +574,14 @@ connect_custom_winsys (CoglRenderer *renderer,
} }
renderer->winsys_vtable = NULL; renderer->winsys_vtable = NULL;
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR, COGL_WINSYS_ERROR_INIT,
COGL_WINSYS_ERROR_INIT, "Failed to connected to any renderer: %s", error_message->str);
"Failed to connected to any renderer: %s",
error_message->str);
g_string_free (error_message, TRUE); g_string_free (error_message, TRUE);
return FALSE; return FALSE;
} }
gboolean gboolean
cogl_renderer_connect (CoglRenderer *renderer, CoglError **error) cogl_renderer_connect (CoglRenderer *renderer, GError **error)
{ {
int i; int i;
GString *error_message; GString *error_message;
@ -609,7 +603,7 @@ cogl_renderer_connect (CoglRenderer *renderer, CoglError **error)
for (i = 0; i < G_N_ELEMENTS (_cogl_winsys_vtable_getters); i++) for (i = 0; i < G_N_ELEMENTS (_cogl_winsys_vtable_getters); i++)
{ {
const CoglWinsysVtable *winsys = _cogl_winsys_vtable_getters[i](); const CoglWinsysVtable *winsys = _cogl_winsys_vtable_getters[i]();
CoglError *tmp_error = NULL; GError *tmp_error = NULL;
GList *l; GList *l;
gboolean skip_due_to_constraints = FALSE; gboolean skip_due_to_constraints = FALSE;
@ -652,7 +646,7 @@ cogl_renderer_connect (CoglRenderer *renderer, CoglError **error)
{ {
g_string_append_c (error_message, '\n'); g_string_append_c (error_message, '\n');
g_string_append (error_message, tmp_error->message); g_string_append (error_message, tmp_error->message);
cogl_error_free (tmp_error); g_error_free (tmp_error);
} }
else else
{ {
@ -666,15 +660,14 @@ cogl_renderer_connect (CoglRenderer *renderer, CoglError **error)
{ {
if (constraints_failed) if (constraints_failed)
{ {
_cogl_set_error (error, COGL_RENDERER_ERROR, g_set_error (error, COGL_RENDERER_ERROR,
COGL_RENDERER_ERROR_BAD_CONSTRAINT, COGL_RENDERER_ERROR_BAD_CONSTRAINT,
"Failed to connected to any renderer due to constraints"); "Failed to connected to any renderer due to constraints");
return FALSE; return FALSE;
} }
renderer->winsys_vtable = NULL; renderer->winsys_vtable = NULL;
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR, COGL_WINSYS_ERROR_INIT,
COGL_WINSYS_ERROR_INIT,
"Failed to connected to any renderer: %s", "Failed to connected to any renderer: %s",
error_message->str); error_message->str);
g_string_free (error_message, TRUE); g_string_free (error_message, TRUE);

View File

@ -35,7 +35,6 @@
#include <cogl/cogl-types.h> #include <cogl/cogl-types.h>
#include <cogl/cogl-onscreen-template.h> #include <cogl/cogl-onscreen-template.h>
#include <cogl/cogl-error.h>
#include <cogl/cogl-output.h> #include <cogl/cogl-output.h>
#include <glib-object.h> #include <glib-object.h>
@ -221,7 +220,7 @@ cogl_renderer_get_n_fragment_texture_units (CoglRenderer *renderer);
* cogl_renderer_check_onscreen_template: (skip) * cogl_renderer_check_onscreen_template: (skip)
* @renderer: A #CoglRenderer * @renderer: A #CoglRenderer
* @onscreen_template: A #CoglOnscreenTemplate * @onscreen_template: A #CoglOnscreenTemplate
* @error: A pointer to a #CoglError for reporting exceptions * @error: A pointer to a #GError for reporting exceptions
* *
* Tests if a given @onscreen_template can be supported with the given * Tests if a given @onscreen_template can be supported with the given
* @renderer. * @renderer.
@ -234,14 +233,14 @@ cogl_renderer_get_n_fragment_texture_units (CoglRenderer *renderer);
gboolean gboolean
cogl_renderer_check_onscreen_template (CoglRenderer *renderer, cogl_renderer_check_onscreen_template (CoglRenderer *renderer,
CoglOnscreenTemplate *onscreen_template, CoglOnscreenTemplate *onscreen_template,
CoglError **error); GError **error);
/* Final connection API */ /* Final connection API */
/** /**
* cogl_renderer_connect: * cogl_renderer_connect:
* @renderer: An unconnected #CoglRenderer * @renderer: An unconnected #CoglRenderer
* @error: a pointer to a #CoglError for reporting exceptions * @error: a pointer to a #GError for reporting exceptions
* *
* Connects the configured @renderer. Renderer connection isn't a * Connects the configured @renderer. Renderer connection isn't a
* very active process, it basically just means validating that * very active process, it basically just means validating that
@ -254,7 +253,7 @@ cogl_renderer_check_onscreen_template (CoglRenderer *renderer,
* Stability: unstable * Stability: unstable
*/ */
gboolean gboolean
cogl_renderer_connect (CoglRenderer *renderer, CoglError **error); cogl_renderer_connect (CoglRenderer *renderer, GError **error);
/** /**
* CoglRendererConstraint: * CoglRendererConstraint:

View File

@ -233,7 +233,7 @@ cogl_sub_texture_new (CoglContext *ctx,
static gboolean static gboolean
_cogl_sub_texture_allocate (CoglTexture *tex, _cogl_sub_texture_allocate (CoglTexture *tex,
CoglError **error) GError **error)
{ {
CoglSubTexture *sub_tex = COGL_SUB_TEXTURE (tex); CoglSubTexture *sub_tex = COGL_SUB_TEXTURE (tex);
gboolean status = cogl_texture_allocate (sub_tex->full_texture, error); gboolean status = cogl_texture_allocate (sub_tex->full_texture, error);
@ -364,7 +364,7 @@ _cogl_sub_texture_set_region (CoglTexture *tex,
int dst_height, int dst_height,
int level, int level,
CoglBitmap *bmp, CoglBitmap *bmp,
CoglError **error) GError **error)
{ {
CoglSubTexture *sub_tex = COGL_SUB_TEXTURE (tex); CoglSubTexture *sub_tex = COGL_SUB_TEXTURE (tex);

View File

@ -50,7 +50,6 @@
#include "cogl-spans.h" #include "cogl-spans.h"
#include "cogl-journal-private.h" #include "cogl-journal-private.h"
#include "cogl-primitive-texture.h" #include "cogl-primitive-texture.h"
#include "cogl-error-private.h"
#include "cogl-gtype-private.h" #include "cogl-gtype-private.h"
#include "driver/gl/cogl-texture-gl-private.h" #include "driver/gl/cogl-texture-gl-private.h"
#include "driver/gl/cogl-pipeline-opengl-private.h" #include "driver/gl/cogl-pipeline-opengl-private.h"
@ -191,7 +190,7 @@ _cogl_texture_2d_sliced_set_waste (CoglTexture2DSliced *tex_2ds,
int src_y, int src_y,
int dst_x, int dst_x,
int dst_y, int dst_y,
CoglError **error) GError **error)
{ {
gboolean need_x, need_y; gboolean need_x, need_y;
CoglContext *ctx = COGL_TEXTURE (tex_2ds)->context; CoglContext *ctx = COGL_TEXTURE (tex_2ds)->context;
@ -342,7 +341,7 @@ _cogl_texture_2d_sliced_set_waste (CoglTexture2DSliced *tex_2ds,
static gboolean static gboolean
_cogl_texture_2d_sliced_upload_bitmap (CoglTexture2DSliced *tex_2ds, _cogl_texture_2d_sliced_upload_bitmap (CoglTexture2DSliced *tex_2ds,
CoglBitmap *bmp, CoglBitmap *bmp,
CoglError **error) GError **error)
{ {
CoglSpan *x_span; CoglSpan *x_span;
CoglSpan *y_span; CoglSpan *y_span;
@ -438,7 +437,7 @@ _cogl_texture_2d_sliced_upload_subregion (CoglTexture2DSliced *tex_2ds,
int width, int width,
int height, int height,
CoglBitmap *source_bmp, CoglBitmap *source_bmp,
CoglError **error) GError **error)
{ {
CoglTexture *tex = COGL_TEXTURE (tex_2ds); CoglTexture *tex = COGL_TEXTURE (tex_2ds);
CoglSpan *x_span; CoglSpan *x_span;
@ -631,7 +630,7 @@ setup_spans (CoglContext *ctx,
int height, int height,
int max_waste, int max_waste,
CoglPixelFormat internal_format, CoglPixelFormat internal_format,
CoglError **error) GError **error)
{ {
int max_width; int max_width;
int max_height; int max_height;
@ -656,9 +655,7 @@ setup_spans (CoglContext *ctx,
max_height, max_height,
internal_format)) internal_format))
{ {
_cogl_set_error (error, g_set_error (error, COGL_TEXTURE_ERROR, COGL_TEXTURE_ERROR_SIZE,
COGL_TEXTURE_ERROR,
COGL_TEXTURE_ERROR_SIZE,
"Sliced texture size of %d x %d not possible " "Sliced texture size of %d x %d not possible "
"with max waste set to -1", "with max waste set to -1",
width, width,
@ -706,9 +703,7 @@ setup_spans (CoglContext *ctx,
{ {
/* Maybe it would be ok to just g_warn_if_reached() for this /* Maybe it would be ok to just g_warn_if_reached() for this
* codepath */ * codepath */
_cogl_set_error (error, g_set_error (error, COGL_TEXTURE_ERROR, COGL_TEXTURE_ERROR_SIZE,
COGL_TEXTURE_ERROR,
COGL_TEXTURE_ERROR_SIZE,
"No suitable slice geometry found"); "No suitable slice geometry found");
free_spans (tex_2ds); free_spans (tex_2ds);
return FALSE; return FALSE;
@ -772,7 +767,7 @@ allocate_slices (CoglTexture2DSliced *tex_2ds,
int height, int height,
int max_waste, int max_waste,
CoglPixelFormat internal_format, CoglPixelFormat internal_format,
CoglError **error) GError **error)
{ {
CoglTexture *tex = COGL_TEXTURE (tex_2ds); CoglTexture *tex = COGL_TEXTURE (tex_2ds);
CoglContext *ctx = tex->context; CoglContext *ctx = tex->context;
@ -967,7 +962,7 @@ cogl_texture_2d_sliced_new_from_data (CoglContext *ctx,
CoglPixelFormat format, CoglPixelFormat format,
int rowstride, int rowstride,
const uint8_t *data, const uint8_t *data,
CoglError **error) GError **error)
{ {
CoglBitmap *bmp; CoglBitmap *bmp;
CoglTexture2DSliced *tex_2ds; CoglTexture2DSliced *tex_2ds;
@ -1004,7 +999,7 @@ CoglTexture2DSliced *
cogl_texture_2d_sliced_new_from_file (CoglContext *ctx, cogl_texture_2d_sliced_new_from_file (CoglContext *ctx,
const char *filename, const char *filename,
int max_waste, int max_waste,
CoglError **error) GError **error)
{ {
CoglBitmap *bmp; CoglBitmap *bmp;
CoglTexture2DSliced *tex_2ds = NULL; CoglTexture2DSliced *tex_2ds = NULL;
@ -1027,7 +1022,7 @@ cogl_texture_2d_sliced_new_from_file (CoglContext *ctx,
static gboolean static gboolean
allocate_with_size (CoglTexture2DSliced *tex_2ds, allocate_with_size (CoglTexture2DSliced *tex_2ds,
CoglTextureLoader *loader, CoglTextureLoader *loader,
CoglError **error) GError **error)
{ {
CoglTexture *tex = COGL_TEXTURE (tex_2ds); CoglTexture *tex = COGL_TEXTURE (tex_2ds);
CoglPixelFormat internal_format = CoglPixelFormat internal_format =
@ -1053,7 +1048,7 @@ allocate_with_size (CoglTexture2DSliced *tex_2ds,
static gboolean static gboolean
allocate_from_bitmap (CoglTexture2DSliced *tex_2ds, allocate_from_bitmap (CoglTexture2DSliced *tex_2ds,
CoglTextureLoader *loader, CoglTextureLoader *loader,
CoglError **error) GError **error)
{ {
CoglTexture *tex = COGL_TEXTURE (tex_2ds); CoglTexture *tex = COGL_TEXTURE (tex_2ds);
CoglBitmap *bmp = loader->src.bitmap.bitmap; CoglBitmap *bmp = loader->src.bitmap.bitmap;
@ -1106,7 +1101,7 @@ allocate_from_bitmap (CoglTexture2DSliced *tex_2ds,
static gboolean static gboolean
allocate_from_gl_foreign (CoglTexture2DSliced *tex_2ds, allocate_from_gl_foreign (CoglTexture2DSliced *tex_2ds,
CoglTextureLoader *loader, CoglTextureLoader *loader,
CoglError **error) GError **error)
{ {
CoglTexture *tex = COGL_TEXTURE (tex_2ds); CoglTexture *tex = COGL_TEXTURE (tex_2ds);
CoglContext *ctx = tex->context; CoglContext *ctx = tex->context;
@ -1170,7 +1165,7 @@ allocate_from_gl_foreign (CoglTexture2DSliced *tex_2ds,
static gboolean static gboolean
_cogl_texture_2d_sliced_allocate (CoglTexture *tex, _cogl_texture_2d_sliced_allocate (CoglTexture *tex,
CoglError **error) GError **error)
{ {
CoglTexture2DSliced *tex_2ds = COGL_TEXTURE_2D_SLICED (tex); CoglTexture2DSliced *tex_2ds = COGL_TEXTURE_2D_SLICED (tex);
CoglTextureLoader *loader = tex->loader; CoglTextureLoader *loader = tex->loader;
@ -1395,7 +1390,7 @@ _cogl_texture_2d_sliced_set_region (CoglTexture *tex,
int dst_height, int dst_height,
int level, int level,
CoglBitmap *bmp, CoglBitmap *bmp,
CoglError **error) GError **error)
{ {
CoglTexture2DSliced *tex_2ds = COGL_TEXTURE_2D_SLICED (tex); CoglTexture2DSliced *tex_2ds = COGL_TEXTURE_2D_SLICED (tex);
CoglBitmap *upload_bmp; CoglBitmap *upload_bmp;

View File

@ -132,7 +132,7 @@ cogl_texture_2d_sliced_new_with_size (CoglContext *ctx,
* are allowed along the right and bottom textures before * are allowed along the right and bottom textures before
* they must be sliced to reduce the amount of waste. A * they must be sliced to reduce the amount of waste. A
* negative can be passed to disable slicing. * negative can be passed to disable slicing.
* @error: A #CoglError to catch exceptional errors or %NULL * @error: A #GError to catch exceptional errors or %NULL
* *
* Creates a #CoglTexture2DSliced from an image file. * Creates a #CoglTexture2DSliced from an image file.
* *
@ -170,7 +170,7 @@ CoglTexture2DSliced *
cogl_texture_2d_sliced_new_from_file (CoglContext *ctx, cogl_texture_2d_sliced_new_from_file (CoglContext *ctx,
const char *filename, const char *filename,
int max_waste, int max_waste,
CoglError **error); GError **error);
/** /**
* cogl_texture_2d_sliced_new_from_data: (skip) * cogl_texture_2d_sliced_new_from_data: (skip)
@ -186,7 +186,7 @@ cogl_texture_2d_sliced_new_from_file (CoglContext *ctx,
* row in @data. A value of 0 will make Cogl automatically * row in @data. A value of 0 will make Cogl automatically
* calculate @rowstride from @width and @format. * calculate @rowstride from @width and @format.
* @data: pointer the memory region where the source buffer resides * @data: pointer the memory region where the source buffer resides
* @error: A #CoglError to catch exceptional errors or %NULL * @error: A #GError to catch exceptional errors or %NULL
* *
* Creates a new #CoglTexture2DSliced texture based on data residing * Creates a new #CoglTexture2DSliced texture based on data residing
* in memory. * in memory.
@ -235,7 +235,7 @@ cogl_texture_2d_sliced_new_from_data (CoglContext *ctx,
CoglPixelFormat format, CoglPixelFormat format,
int rowstride, int rowstride,
const uint8_t *data, const uint8_t *data,
CoglError **error); GError **error);
/** /**
* cogl_texture_2d_sliced_new_from_bitmap: * cogl_texture_2d_sliced_new_from_bitmap:

View File

@ -42,7 +42,6 @@
#include "cogl-object-private.h" #include "cogl-object-private.h"
#include "cogl-journal-private.h" #include "cogl-journal-private.h"
#include "cogl-framebuffer-private.h" #include "cogl-framebuffer-private.h"
#include "cogl-error-private.h"
#include "cogl-gtype-private.h" #include "cogl-gtype-private.h"
#include "driver/gl/cogl-texture-2d-gl-private.h" #include "driver/gl/cogl-texture-2d-gl-private.h"
#include "driver/gl/cogl-pipeline-opengl-private.h" #include "driver/gl/cogl-pipeline-opengl-private.h"
@ -135,7 +134,7 @@ cogl_texture_2d_new_with_size (CoglContext *ctx,
static gboolean static gboolean
_cogl_texture_2d_allocate (CoglTexture *tex, _cogl_texture_2d_allocate (CoglTexture *tex,
CoglError **error) GError **error)
{ {
CoglContext *ctx = tex->context; CoglContext *ctx = tex->context;
@ -172,7 +171,7 @@ cogl_texture_2d_new_from_bitmap (CoglBitmap *bmp)
CoglTexture2D * CoglTexture2D *
cogl_texture_2d_new_from_file (CoglContext *ctx, cogl_texture_2d_new_from_file (CoglContext *ctx,
const char *filename, const char *filename,
CoglError **error) GError **error)
{ {
CoglBitmap *bmp; CoglBitmap *bmp;
CoglTexture2D *tex_2d = NULL; CoglTexture2D *tex_2d = NULL;
@ -198,7 +197,7 @@ cogl_texture_2d_new_from_data (CoglContext *ctx,
CoglPixelFormat format, CoglPixelFormat format,
int rowstride, int rowstride,
const uint8_t *data, const uint8_t *data,
CoglError **error) GError **error)
{ {
CoglBitmap *bmp; CoglBitmap *bmp;
CoglTexture2D *tex_2d; CoglTexture2D *tex_2d;
@ -241,7 +240,7 @@ cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
int height, int height,
CoglPixelFormat format, CoglPixelFormat format,
EGLImageKHR image, EGLImageKHR image,
CoglError **error) GError **error)
{ {
CoglTextureLoader *loader; CoglTextureLoader *loader;
CoglTexture2D *tex; CoglTexture2D *tex;
@ -421,7 +420,7 @@ _cogl_texture_2d_set_region (CoglTexture *tex,
int height, int height,
int level, int level,
CoglBitmap *bmp, CoglBitmap *bmp,
CoglError **error) GError **error)
{ {
CoglContext *ctx = tex->context; CoglContext *ctx = tex->context;
CoglTexture2D *tex_2d = COGL_TEXTURE_2D (tex); CoglTexture2D *tex_2d = COGL_TEXTURE_2D (tex);

View File

@ -113,7 +113,7 @@ cogl_texture_2d_new_with_size (CoglContext *ctx,
* cogl_texture_2d_new_from_file: (skip) * cogl_texture_2d_new_from_file: (skip)
* @ctx: A #CoglContext * @ctx: A #CoglContext
* @filename: the file to load * @filename: the file to load
* @error: A #CoglError to catch exceptional errors or %NULL * @error: A #GError to catch exceptional errors or %NULL
* *
* Creates a low-level #CoglTexture2D texture from an image file. * Creates a low-level #CoglTexture2D texture from an image file.
* *
@ -136,7 +136,7 @@ cogl_texture_2d_new_with_size (CoglContext *ctx,
CoglTexture2D * CoglTexture2D *
cogl_texture_2d_new_from_file (CoglContext *ctx, cogl_texture_2d_new_from_file (CoglContext *ctx,
const char *filename, const char *filename,
CoglError **error); GError **error);
/** /**
* cogl_texture_2d_new_from_data: (skip) * cogl_texture_2d_new_from_data: (skip)
@ -148,7 +148,7 @@ cogl_texture_2d_new_from_file (CoglContext *ctx,
* scanlines in @data. A value of 0 will make Cogl automatically * scanlines in @data. A value of 0 will make Cogl automatically
* calculate @rowstride from @width and @format. * calculate @rowstride from @width and @format.
* @data: pointer the memory region where the source buffer resides * @data: pointer the memory region where the source buffer resides
* @error: A #CoglError for exceptions * @error: A #GError for exceptions
* *
* Creates a low-level #CoglTexture2D texture based on data residing * Creates a low-level #CoglTexture2D texture based on data residing
* in memory. * in memory.
@ -178,7 +178,7 @@ cogl_texture_2d_new_from_data (CoglContext *ctx,
CoglPixelFormat format, CoglPixelFormat format,
int rowstride, int rowstride,
const uint8_t *data, const uint8_t *data,
CoglError **error); GError **error);
/** /**
* cogl_texture_2d_new_from_bitmap: * cogl_texture_2d_new_from_bitmap:
@ -219,7 +219,7 @@ cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
int height, int height,
CoglPixelFormat format, CoglPixelFormat format,
EGLImageKHR image, EGLImageKHR image,
CoglError **error); GError **error);
typedef gboolean (*CoglTexture2DEGLImageExternalAlloc) (CoglTexture2D *tex_2d, typedef gboolean (*CoglTexture2DEGLImageExternalAlloc) (CoglTexture2D *tex_2d,
gpointer user_data, gpointer user_data,
@ -235,7 +235,7 @@ cogl_texture_2d_new_from_egl_image_external (CoglContext *ctx,
CoglTexture2DEGLImageExternalAlloc alloc, CoglTexture2DEGLImageExternalAlloc alloc,
gpointer user_data, gpointer user_data,
GDestroyNotify destroy, GDestroyNotify destroy,
CoglError **error); GError **error);
void void
cogl_texture_2d_egl_image_external_bind (CoglTexture2D *tex_2d); cogl_texture_2d_egl_image_external_bind (CoglTexture2D *tex_2d);

View File

@ -84,7 +84,7 @@ struct _CoglTextureDriver
CoglBitmap *source_bmp, CoglBitmap *source_bmp,
GLuint source_gl_format, GLuint source_gl_format,
GLuint source_gl_type, GLuint source_gl_type,
CoglError **error); GError **error);
/* /*
* Replaces the contents of the GL texture with the entire bitmap. On * Replaces the contents of the GL texture with the entire bitmap. On
@ -101,7 +101,7 @@ struct _CoglTextureDriver
GLint internal_gl_format, GLint internal_gl_format,
GLuint source_gl_format, GLuint source_gl_format,
GLuint source_gl_type, GLuint source_gl_type,
CoglError **error); GError **error);
/* /*
* This sets up the glPixelStore state for an download to a destination with * This sets up the glPixelStore state for an download to a destination with

View File

@ -75,7 +75,7 @@ struct _CoglTextureVtable
gboolean is_primitive; gboolean is_primitive;
gboolean (* allocate) (CoglTexture *tex, gboolean (* allocate) (CoglTexture *tex,
CoglError **error); GError **error);
/* This should update the specified sub region of the texture with a /* This should update the specified sub region of the texture with a
sub region of the given bitmap. The bitmap is not converted sub region of the given bitmap. The bitmap is not converted
@ -91,7 +91,7 @@ struct _CoglTextureVtable
int dst_height, int dst_height,
int level, int level,
CoglBitmap *bitmap, CoglBitmap *bitmap,
CoglError **error); GError **error);
gboolean (* is_get_data_supported) (CoglTexture *texture); gboolean (* is_get_data_supported) (CoglTexture *texture);
@ -362,7 +362,7 @@ _cogl_texture_set_region (CoglTexture *texture,
int dst_x, int dst_x,
int dst_y, int dst_y,
int level, int level,
CoglError **error); GError **error);
gboolean gboolean
_cogl_texture_set_region_from_bitmap (CoglTexture *texture, _cogl_texture_set_region_from_bitmap (CoglTexture *texture,
@ -374,7 +374,7 @@ _cogl_texture_set_region_from_bitmap (CoglTexture *texture,
int dst_x, int dst_x,
int dst_y, int dst_y,
int level, int level,
CoglError **error); GError **error);
gboolean gboolean
_cogl_texture_needs_premult_conversion (CoglPixelFormat src_format, _cogl_texture_needs_premult_conversion (CoglPixelFormat src_format,

View File

@ -58,7 +58,6 @@
#include "cogl1-context.h" #include "cogl1-context.h"
#include "cogl-sub-texture.h" #include "cogl-sub-texture.h"
#include "cogl-primitive-texture.h" #include "cogl-primitive-texture.h"
#include "cogl-error-private.h"
#include "cogl-gtype-private.h" #include "cogl-gtype-private.h"
#include <string.h> #include <string.h>
@ -363,7 +362,7 @@ _cogl_texture_set_region_from_bitmap (CoglTexture *texture,
int dst_x, int dst_x,
int dst_y, int dst_y,
int level, int level,
CoglError **error) GError **error)
{ {
g_return_val_if_fail (cogl_bitmap_get_width (bmp) - src_x >= width, FALSE); g_return_val_if_fail (cogl_bitmap_get_width (bmp) - src_x >= width, FALSE);
g_return_val_if_fail (cogl_bitmap_get_height (bmp) - src_y >= height, FALSE); g_return_val_if_fail (cogl_bitmap_get_height (bmp) - src_y >= height, FALSE);
@ -400,7 +399,7 @@ cogl_texture_set_region_from_bitmap (CoglTexture *texture,
unsigned int dst_height, unsigned int dst_height,
CoglBitmap *bitmap) CoglBitmap *bitmap)
{ {
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
gboolean status = gboolean status =
_cogl_texture_set_region_from_bitmap (texture, _cogl_texture_set_region_from_bitmap (texture,
src_x, src_y, src_x, src_y,
@ -410,8 +409,7 @@ cogl_texture_set_region_from_bitmap (CoglTexture *texture,
0, /* level */ 0, /* level */
&ignore_error); &ignore_error);
if (!status) g_clear_error (&ignore_error);
cogl_error_free (ignore_error);
return status; return status;
} }
@ -425,7 +423,7 @@ _cogl_texture_set_region (CoglTexture *texture,
int dst_x, int dst_x,
int dst_y, int dst_y,
int level, int level,
CoglError **error) GError **error)
{ {
CoglContext *ctx = texture->context; CoglContext *ctx = texture->context;
CoglBitmap *source_bmp; CoglBitmap *source_bmp;
@ -471,7 +469,7 @@ cogl_texture_set_region (CoglTexture *texture,
unsigned int rowstride, unsigned int rowstride,
const uint8_t *data) const uint8_t *data)
{ {
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
const uint8_t *first_pixel; const uint8_t *first_pixel;
int bytes_per_pixel = _cogl_pixel_format_get_bytes_per_pixel (format); int bytes_per_pixel = _cogl_pixel_format_get_bytes_per_pixel (format);
gboolean status; gboolean status;
@ -492,8 +490,7 @@ cogl_texture_set_region (CoglTexture *texture,
dst_y, dst_y,
0, 0,
&ignore_error); &ignore_error);
if (!status) g_clear_error (&ignore_error);
cogl_error_free (ignore_error);
return status; return status;
} }
@ -503,7 +500,7 @@ cogl_texture_set_data (CoglTexture *texture,
int rowstride, int rowstride,
const uint8_t *data, const uint8_t *data,
int level, int level,
CoglError **error) GError **error)
{ {
int level_width; int level_width;
int level_height; int level_height;
@ -541,7 +538,7 @@ get_texture_bits_via_offscreen (CoglTexture *meta_texture,
CoglFramebuffer *framebuffer; CoglFramebuffer *framebuffer;
CoglBitmap *bitmap; CoglBitmap *bitmap;
gboolean ret; gboolean ret;
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
CoglPixelFormat real_format; CoglPixelFormat real_format;
if (!cogl_has_feature (ctx, COGL_FEATURE_ID_OFFSCREEN)) if (!cogl_has_feature (ctx, COGL_FEATURE_ID_OFFSCREEN))
@ -555,7 +552,7 @@ get_texture_bits_via_offscreen (CoglTexture *meta_texture,
framebuffer = COGL_FRAMEBUFFER (offscreen); framebuffer = COGL_FRAMEBUFFER (offscreen);
if (!cogl_framebuffer_allocate (framebuffer, &ignore_error)) if (!cogl_framebuffer_allocate (framebuffer, &ignore_error))
{ {
cogl_error_free (ignore_error); g_error_free (ignore_error);
return FALSE; return FALSE;
} }
@ -584,8 +581,7 @@ get_texture_bits_via_offscreen (CoglTexture *meta_texture,
bitmap, bitmap,
&ignore_error); &ignore_error);
if (!ret) g_clear_error (&ignore_error);
cogl_error_free (ignore_error);
cogl_object_unref (bitmap); cogl_object_unref (bitmap);
@ -650,7 +646,7 @@ typedef struct
CoglBitmap *target_bmp; CoglBitmap *target_bmp;
uint8_t *target_bits; uint8_t *target_bits;
gboolean success; gboolean success;
CoglError *error; GError *error;
} CoglTextureGetData; } CoglTextureGetData;
static void static void
@ -738,7 +734,7 @@ cogl_texture_get_data (CoglTexture *texture,
int tex_width; int tex_width;
int tex_height; int tex_height;
CoglPixelFormat texture_format; CoglPixelFormat texture_format;
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
CoglTextureGetData tg_data; CoglTextureGetData tg_data;
@ -818,7 +814,7 @@ cogl_texture_get_data (CoglTexture *texture,
&ignore_error); &ignore_error);
if (!target_bmp) if (!target_bmp)
{ {
cogl_error_free (ignore_error); g_error_free (ignore_error);
return 0; return 0;
} }
} }
@ -855,7 +851,7 @@ cogl_texture_get_data (CoglTexture *texture,
} }
else else
{ {
cogl_error_free (ignore_error); g_error_free (ignore_error);
tg_data.success = FALSE; tg_data.success = FALSE;
} }
@ -873,7 +869,7 @@ cogl_texture_get_data (CoglTexture *texture,
{ {
CoglBitmap *new_bmp; CoglBitmap *new_bmp;
gboolean result; gboolean result;
CoglError *error = NULL; GError *error = NULL;
/* Convert to requested format directly into the user's buffer */ /* Convert to requested format directly into the user's buffer */
new_bmp = cogl_bitmap_new_for_data (ctx, new_bmp = cogl_bitmap_new_for_data (ctx,
@ -885,7 +881,7 @@ cogl_texture_get_data (CoglTexture *texture,
if (!result) if (!result)
{ {
cogl_error_free (error); g_error_free (error);
/* Return failure after cleaning up */ /* Return failure after cleaning up */
byte_size = 0; byte_size = 0;
} }
@ -1075,14 +1071,14 @@ _cogl_texture_set_allocated (CoglTexture *texture,
gboolean gboolean
cogl_texture_allocate (CoglTexture *texture, cogl_texture_allocate (CoglTexture *texture,
CoglError **error) GError **error)
{ {
if (texture->allocated) if (texture->allocated)
return TRUE; return TRUE;
if (texture->components == COGL_TEXTURE_COMPONENTS_RG && if (texture->components == COGL_TEXTURE_COMPONENTS_RG &&
!cogl_has_feature (texture->context, COGL_FEATURE_ID_TEXTURE_RG)) !cogl_has_feature (texture->context, COGL_FEATURE_ID_TEXTURE_RG))
_cogl_set_error (error, g_set_error (error,
COGL_TEXTURE_ERROR, COGL_TEXTURE_ERROR,
COGL_TEXTURE_ERROR_FORMAT, COGL_TEXTURE_ERROR_FORMAT,
"A red-green texture was requested but the driver " "A red-green texture was requested but the driver "

View File

@ -81,7 +81,7 @@ GType cogl_texture_get_gtype (void);
/** /**
* COGL_TEXTURE_ERROR: * COGL_TEXTURE_ERROR:
* *
* #CoglError domain for texture errors. * #GError domain for texture errors.
* *
* Since: 1.8 * Since: 1.8
* Stability: Unstable * Stability: Unstable
@ -387,7 +387,7 @@ cogl_texture_set_region (CoglTexture *texture,
* @data: the source data, pointing to the first top-left pixel to set * @data: the source data, pointing to the first top-left pixel to set
* @level: The mipmap level to update (Normally 0 for the largest, * @level: The mipmap level to update (Normally 0 for the largest,
* base texture) * base texture)
* @error: A #CoglError to return exceptional errors * @error: A #GError to return exceptional errors
* *
* Sets all the pixels for a given mipmap @level by copying the pixel * Sets all the pixels for a given mipmap @level by copying the pixel
* data pointed to by the @data argument into the given @texture. * data pointed to by the @data argument into the given @texture.
@ -436,7 +436,7 @@ cogl_texture_set_data (CoglTexture *texture,
int rowstride, int rowstride,
const uint8_t *data, const uint8_t *data,
int level, int level,
CoglError **error); GError **error);
/** /**
* cogl_texture_set_region_from_bitmap: * cogl_texture_set_region_from_bitmap:
@ -476,7 +476,7 @@ cogl_texture_set_region_from_bitmap (CoglTexture *texture,
/** /**
* cogl_texture_allocate: * cogl_texture_allocate:
* @texture: A #CoglTexture * @texture: A #CoglTexture
* @error: A #CoglError to return exceptional errors or %NULL * @error: A #GError to return exceptional errors or %NULL
* *
* Explicitly allocates the storage for the given @texture which * Explicitly allocates the storage for the given @texture which
* allows you to be sure that there is enough memory for the * allows you to be sure that there is enough memory for the
@ -493,7 +493,7 @@ cogl_texture_set_region_from_bitmap (CoglTexture *texture,
*/ */
gboolean gboolean
cogl_texture_allocate (CoglTexture *texture, cogl_texture_allocate (CoglTexture *texture,
CoglError **error); GError **error);
/** /**
* cogl_texture_is_get_data_supported: (skip) * cogl_texture_is_get_data_supported: (skip)

View File

@ -323,7 +323,7 @@ typedef enum
/** /**
* COGL_BLEND_STRING_ERROR: * COGL_BLEND_STRING_ERROR:
* *
* #CoglError domain for blend string parser errors * #GError domain for blend string parser errors
* *
* Since: 1.0 * Since: 1.0
*/ */

View File

@ -55,7 +55,7 @@ typedef struct _CoglXlibRenderer
} CoglXlibRenderer; } CoglXlibRenderer;
gboolean gboolean
_cogl_xlib_renderer_connect (CoglRenderer *renderer, CoglError **error); _cogl_xlib_renderer_connect (CoglRenderer *renderer, GError **error);
void void
_cogl_xlib_renderer_disconnect (CoglRenderer *renderer); _cogl_xlib_renderer_disconnect (CoglRenderer *renderer);

View File

@ -39,7 +39,6 @@
#include "cogl-renderer-private.h" #include "cogl-renderer-private.h"
#include "cogl-xlib-renderer-private.h" #include "cogl-xlib-renderer-private.h"
#include "cogl-x11-renderer-private.h" #include "cogl-x11-renderer-private.h"
#include "cogl-error-private.h"
#include "cogl-poll-private.h" #include "cogl-poll-private.h"
#include "winsys/cogl-winsys-private.h" #include "winsys/cogl-winsys-private.h"
@ -162,7 +161,7 @@ _cogl_xlib_renderer_untrap_errors (CoglRenderer *renderer,
} }
static Display * static Display *
assert_xlib_display (CoglRenderer *renderer, CoglError **error) assert_xlib_display (CoglRenderer *renderer, GError **error)
{ {
Display *xdpy = cogl_xlib_renderer_get_foreign_display (renderer); Display *xdpy = cogl_xlib_renderer_get_foreign_display (renderer);
CoglXlibRenderer *xlib_renderer = _cogl_xlib_renderer_get_data (renderer); CoglXlibRenderer *xlib_renderer = _cogl_xlib_renderer_get_data (renderer);
@ -177,7 +176,7 @@ assert_xlib_display (CoglRenderer *renderer, CoglError **error)
xdpy = XOpenDisplay (_cogl_x11_display_name); xdpy = XOpenDisplay (_cogl_x11_display_name);
if (xdpy == NULL) if (xdpy == NULL)
{ {
_cogl_set_error (error, g_set_error (error,
COGL_RENDERER_ERROR, COGL_RENDERER_ERROR,
COGL_RENDERER_ERROR_XLIB_DISPLAY_OPEN, COGL_RENDERER_ERROR_XLIB_DISPLAY_OPEN,
"Failed to open X Display %s", _cogl_x11_display_name); "Failed to open X Display %s", _cogl_x11_display_name);
@ -489,7 +488,7 @@ dispatch_xlib_events (void *user_data, int revents)
} }
gboolean gboolean
_cogl_xlib_renderer_connect (CoglRenderer *renderer, CoglError **error) _cogl_xlib_renderer_connect (CoglRenderer *renderer, GError **error)
{ {
CoglXlibRenderer *xlib_renderer = CoglXlibRenderer *xlib_renderer =
_cogl_xlib_renderer_get_data (renderer); _cogl_xlib_renderer_get_data (renderer);

View File

@ -55,8 +55,6 @@
#include <cogl/cogl-defines.h> #include <cogl/cogl-defines.h>
#include <cogl/cogl-macros.h> #include <cogl/cogl-macros.h>
#include <cogl/cogl-error.h>
#include <cogl/cogl-object.h> #include <cogl/cogl-object.h>
#include <cogl/cogl1-context.h> #include <cogl/cogl1-context.h>
#include <cogl/cogl-bitmap.h> #include <cogl/cogl-bitmap.h>

View File

@ -200,10 +200,6 @@ cogl_double_to_fixed
cogl_end_gl cogl_end_gl
cogl_error_copy
cogl_error_free
cogl_error_matches
cogl_euler_copy cogl_euler_copy
cogl_euler_equal cogl_euler_equal
cogl_euler_free cogl_euler_free

View File

@ -47,7 +47,6 @@
#include "cogl-object.h" #include "cogl-object.h"
#include "cogl-bitmap-private.h" #include "cogl-bitmap-private.h"
#include "cogl-atlas-texture-private.h" #include "cogl-atlas-texture-private.h"
#include "cogl-error-private.h"
#include "cogl-sub-texture.h" #include "cogl-sub-texture.h"
#include "cogl-texture-2d-gl.h" #include "cogl-texture-2d-gl.h"
@ -58,7 +57,7 @@ _cogl_texture_new_from_bitmap (CoglBitmap *bitmap,
CoglTextureFlags flags, CoglTextureFlags flags,
CoglPixelFormat internal_format, CoglPixelFormat internal_format,
gboolean can_convert_in_place, gboolean can_convert_in_place,
CoglError **error); GError **error);
static void static void
set_auto_mipmap_cb (CoglTexture *sub_texture, set_auto_mipmap_cb (CoglTexture *sub_texture,
@ -77,7 +76,7 @@ cogl_texture_new_with_size (unsigned int width,
CoglPixelFormat internal_format) CoglPixelFormat internal_format)
{ {
CoglTexture *tex; CoglTexture *tex;
CoglError *skip_error = NULL; GError *skip_error = NULL;
_COGL_GET_CONTEXT (ctx, NULL); _COGL_GET_CONTEXT (ctx, NULL);
@ -88,7 +87,7 @@ cogl_texture_new_with_size (unsigned int width,
if (!cogl_texture_allocate (tex, &skip_error)) if (!cogl_texture_allocate (tex, &skip_error))
{ {
cogl_error_free (skip_error); g_error_free (skip_error);
skip_error = NULL; skip_error = NULL;
cogl_object_unref (tex); cogl_object_unref (tex);
tex = NULL; tex = NULL;
@ -111,7 +110,7 @@ cogl_texture_new_with_size (unsigned int width,
* semantics and return NULL if allocation fails... */ * semantics and return NULL if allocation fails... */
if (!cogl_texture_allocate (tex, &skip_error)) if (!cogl_texture_allocate (tex, &skip_error))
{ {
cogl_error_free (skip_error); g_error_free (skip_error);
cogl_object_unref (tex); cogl_object_unref (tex);
return NULL; return NULL;
} }
@ -139,7 +138,7 @@ _cogl_texture_new_from_data (CoglContext *ctx,
CoglPixelFormat internal_format, CoglPixelFormat internal_format,
int rowstride, int rowstride,
const uint8_t *data, const uint8_t *data,
CoglError **error) GError **error)
{ {
CoglBitmap *bmp; CoglBitmap *bmp;
CoglTexture *tex; CoglTexture *tex;
@ -178,7 +177,7 @@ cogl_texture_new_from_data (int width,
int rowstride, int rowstride,
const uint8_t *data) const uint8_t *data)
{ {
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
CoglTexture *tex; CoglTexture *tex;
_COGL_GET_CONTEXT (ctx, NULL); _COGL_GET_CONTEXT (ctx, NULL);
@ -191,7 +190,7 @@ cogl_texture_new_from_data (int width,
data, data,
&ignore_error); &ignore_error);
if (!tex) if (!tex)
cogl_error_free (ignore_error); g_error_free (ignore_error);
return tex; return tex;
} }
@ -200,10 +199,10 @@ _cogl_texture_new_from_bitmap (CoglBitmap *bitmap,
CoglTextureFlags flags, CoglTextureFlags flags,
CoglPixelFormat internal_format, CoglPixelFormat internal_format,
gboolean can_convert_in_place, gboolean can_convert_in_place,
CoglError **error) GError **error)
{ {
CoglTexture *tex; CoglTexture *tex;
CoglError *internal_error = NULL; GError *internal_error = NULL;
if (!flags && if (!flags &&
!COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_ATLAS)) !COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_ATLAS))
@ -219,7 +218,7 @@ _cogl_texture_new_from_bitmap (CoglBitmap *bitmap,
if (cogl_texture_allocate (COGL_TEXTURE (atlas_tex), &internal_error)) if (cogl_texture_allocate (COGL_TEXTURE (atlas_tex), &internal_error))
return COGL_TEXTURE (atlas_tex); return COGL_TEXTURE (atlas_tex);
cogl_error_free (internal_error); g_error_free (internal_error);
internal_error = NULL; internal_error = NULL;
cogl_object_unref (atlas_tex); cogl_object_unref (atlas_tex);
} }
@ -232,7 +231,7 @@ _cogl_texture_new_from_bitmap (CoglBitmap *bitmap,
if (!cogl_texture_allocate (tex, &internal_error)) if (!cogl_texture_allocate (tex, &internal_error))
{ {
cogl_error_free (internal_error); g_error_free (internal_error);
internal_error = NULL; internal_error = NULL;
cogl_object_unref (tex); cogl_object_unref (tex);
tex = NULL; tex = NULL;
@ -274,7 +273,7 @@ cogl_texture_new_from_bitmap (CoglBitmap *bitmap,
CoglTextureFlags flags, CoglTextureFlags flags,
CoglPixelFormat internal_format) CoglPixelFormat internal_format)
{ {
CoglError *ignore_error = NULL; GError *ignore_error = NULL;
CoglTexture *tex = CoglTexture *tex =
_cogl_texture_new_from_bitmap (bitmap, _cogl_texture_new_from_bitmap (bitmap,
flags, flags,
@ -282,7 +281,7 @@ cogl_texture_new_from_bitmap (CoglBitmap *bitmap,
FALSE, /* can't convert in-place */ FALSE, /* can't convert in-place */
&ignore_error); &ignore_error);
if (!tex) if (!tex)
cogl_error_free (ignore_error); g_error_free (ignore_error);
return tex; return tex;
} }
@ -290,7 +289,7 @@ CoglTexture *
cogl_texture_new_from_file (const char *filename, cogl_texture_new_from_file (const char *filename,
CoglTextureFlags flags, CoglTextureFlags flags,
CoglPixelFormat internal_format, CoglPixelFormat internal_format,
CoglError **error) GError **error)
{ {
CoglBitmap *bmp; CoglBitmap *bmp;
CoglTexture *texture = NULL; CoglTexture *texture = NULL;

View File

@ -70,7 +70,7 @@ cogl_texture_new_with_size (unsigned int width,
* have non-premultiplied source data and are going to adjust the blend * have non-premultiplied source data and are going to adjust the blend
* mode (see cogl_material_set_blend()) or use the data for something * mode (see cogl_material_set_blend()) or use the data for something
* other than straight blending. * other than straight blending.
* @error: return location for a #CoglError or %NULL * @error: return location for a #GError or %NULL
* *
* Creates a #CoglTexture from an image file. * Creates a #CoglTexture from an image file.
* *
@ -86,7 +86,7 @@ CoglTexture *
cogl_texture_new_from_file (const char *filename, cogl_texture_new_from_file (const char *filename,
CoglTextureFlags flags, CoglTextureFlags flags,
CoglPixelFormat internal_format, CoglPixelFormat internal_format,
CoglError **error); GError **error);
/** /**
* cogl_texture_new_from_data: * cogl_texture_new_from_data:

View File

@ -200,7 +200,7 @@ cogl_material_set_alpha_test_function (CoglMaterial *material,
gboolean gboolean
cogl_material_set_blend (CoglMaterial *material, cogl_material_set_blend (CoglMaterial *material,
const char *blend_string, const char *blend_string,
CoglError **error) GError **error)
{ {
return cogl_pipeline_set_blend (COGL_PIPELINE (material), return cogl_pipeline_set_blend (COGL_PIPELINE (material),
blend_string, blend_string,
@ -260,7 +260,7 @@ gboolean
cogl_material_set_layer_combine (CoglMaterial *material, cogl_material_set_layer_combine (CoglMaterial *material,
int layer_index, int layer_index,
const char *blend_string, const char *blend_string,
CoglError **error) GError **error)
{ {
return cogl_pipeline_set_layer_combine (COGL_PIPELINE (material), return cogl_pipeline_set_layer_combine (COGL_PIPELINE (material),
layer_index, layer_index,
@ -339,7 +339,7 @@ gboolean
cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material, cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
int layer_index, int layer_index,
gboolean enable, gboolean enable,
CoglError **error) GError **error)
{ {
CoglPipeline *pipeline = COGL_PIPELINE (material); CoglPipeline *pipeline = COGL_PIPELINE (material);
return cogl_pipeline_set_layer_point_sprite_coords_enabled (pipeline, return cogl_pipeline_set_layer_point_sprite_coords_enabled (pipeline,
@ -447,7 +447,7 @@ cogl_material_foreach_layer (CoglMaterial *material,
gboolean gboolean
cogl_material_set_depth_state (CoglMaterial *material, cogl_material_set_depth_state (CoglMaterial *material,
const CoglDepthState *state, const CoglDepthState *state,
CoglError **error) GError **error)
{ {
return cogl_pipeline_set_depth_state (COGL_PIPELINE (material), return cogl_pipeline_set_depth_state (COGL_PIPELINE (material),
state, error); state, error);

View File

@ -38,7 +38,6 @@
#include <cogl/cogl-types.h> #include <cogl/cogl-types.h>
#include <cogl/cogl-matrix.h> #include <cogl/cogl-matrix.h>
#include <cogl/cogl-depth-state.h> #include <cogl/cogl-depth-state.h>
#include <cogl/cogl-error.h>
#include <cogl/cogl-macros.h> #include <cogl/cogl-macros.h>
#include <cogl/cogl-object.h> #include <cogl/cogl-object.h>
@ -560,7 +559,7 @@ cogl_material_set_alpha_test_function (CoglMaterial *material,
* @material: A #CoglMaterial object * @material: A #CoglMaterial object
* @blend_string: A <link linkend="cogl-Blend-Strings">Cogl blend string</link> * @blend_string: A <link linkend="cogl-Blend-Strings">Cogl blend string</link>
* describing the desired blend function. * describing the desired blend function.
* @error: return location for a #CoglError that may report lack of driver * @error: return location for a #GError that may report lack of driver
* support if you give separate blend string statements for the alpha * support if you give separate blend string statements for the alpha
* channel and RGB channels since some drivers, or backends such as * channel and RGB channels since some drivers, or backends such as
* GLES 1.1, don't support this feature. May be %NULL, in which case a * GLES 1.1, don't support this feature. May be %NULL, in which case a
@ -644,7 +643,7 @@ COGL_DEPRECATED_FOR (cogl_pipeline_set_blend)
gboolean gboolean
cogl_material_set_blend (CoglMaterial *material, cogl_material_set_blend (CoglMaterial *material,
const char *blend_string, const char *blend_string,
CoglError **error); GError **error);
/** /**
* cogl_material_set_blend_constant: * cogl_material_set_blend_constant:
@ -810,7 +809,7 @@ cogl_material_remove_layer (CoglMaterial *material,
* @layer_index: Specifies the layer you want define a combine function for * @layer_index: Specifies the layer you want define a combine function for
* @blend_string: A <link linkend="cogl-Blend-Strings">Cogl blend string</link> * @blend_string: A <link linkend="cogl-Blend-Strings">Cogl blend string</link>
* describing the desired texture combine function. * describing the desired texture combine function.
* @error: A #CoglError that may report parse errors or lack of GPU/driver * @error: A #GError that may report parse errors or lack of GPU/driver
* support. May be %NULL, in which case a warning will be printed out if an * support. May be %NULL, in which case a warning will be printed out if an
* error is encountered. * error is encountered.
* *
@ -902,7 +901,7 @@ gboolean
cogl_material_set_layer_combine (CoglMaterial *material, cogl_material_set_layer_combine (CoglMaterial *material,
int layer_index, int layer_index,
const char *blend_string, const char *blend_string,
CoglError **error); GError **error);
/** /**
* cogl_material_set_layer_combine_constant: * cogl_material_set_layer_combine_constant:
@ -1083,7 +1082,7 @@ cogl_material_set_layer_filters (CoglMaterial *material,
* @material: a #CoglHandle to a material. * @material: a #CoglHandle to a material.
* @layer_index: the layer number to change. * @layer_index: the layer number to change.
* @enable: whether to enable point sprite coord generation. * @enable: whether to enable point sprite coord generation.
* @error: A return location for a CoglError, or NULL to ignore errors. * @error: A return location for a GError, or NULL to ignore errors.
* *
* When rendering points, if @enable is %TRUE then the texture * When rendering points, if @enable is %TRUE then the texture
* coordinates for this layer will be replaced with coordinates that * coordinates for this layer will be replaced with coordinates that
@ -1106,7 +1105,7 @@ gboolean
cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material, cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
int layer_index, int layer_index,
gboolean enable, gboolean enable,
CoglError **error); GError **error);
/** /**
* cogl_material_get_layer_point_sprite_coords_enabled: * cogl_material_get_layer_point_sprite_coords_enabled:
@ -1310,7 +1309,7 @@ cogl_material_layer_get_wrap_mode_p (CoglMaterialLayer *layer);
* cogl_material_set_depth_state: (skip) * cogl_material_set_depth_state: (skip)
* @material: A #CoglMaterial object * @material: A #CoglMaterial object
* @state: A #CoglDepthState struct * @state: A #CoglDepthState struct
* @error: A #CoglError to report failures to setup the given @state. * @error: A #GError to report failures to setup the given @state.
* *
* This commits all the depth state configured in @state struct to the * This commits all the depth state configured in @state struct to the
* given @material. The configuration values are copied into the * given @material. The configuration values are copied into the
@ -1331,7 +1330,7 @@ COGL_DEPRECATED_FOR (cogl_pipeline_set_depth_state)
gboolean gboolean
cogl_material_set_depth_state (CoglMaterial *material, cogl_material_set_depth_state (CoglMaterial *material,
const CoglDepthState *state, const CoglDepthState *state,
CoglError **error); GError **error);
/** /**
* cogl_material_get_depth_state: (skip) * cogl_material_get_depth_state: (skip)

View File

@ -37,7 +37,6 @@
#include <string.h> #include <string.h>
#include "cogl-private.h" #include "cogl-private.h"
#include "cogl-error-private.h"
#include "cogl-context-private.h" #include "cogl-context-private.h"
#include "cogl-attribute.h" #include "cogl-attribute.h"
#include "cogl-attribute-private.h" #include "cogl-attribute-private.h"

View File

@ -51,7 +51,7 @@ _cogl_buffer_gl_map_range (CoglBuffer *buffer,
size_t size, size_t size,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints, CoglBufferMapHint hints,
CoglError **error); GError **error);
void void
_cogl_buffer_gl_unmap (CoglBuffer *buffer); _cogl_buffer_gl_unmap (CoglBuffer *buffer);
@ -61,12 +61,12 @@ _cogl_buffer_gl_set_data (CoglBuffer *buffer,
unsigned int offset, unsigned int offset,
const void *data, const void *data,
unsigned int size, unsigned int size,
CoglError **error); GError **error);
void * void *
_cogl_buffer_gl_bind (CoglBuffer *buffer, _cogl_buffer_gl_bind (CoglBuffer *buffer,
CoglBufferBindTarget target, CoglBufferBindTarget target,
CoglError **error); GError **error);
void void
_cogl_buffer_gl_unbind (CoglBuffer *buffer); _cogl_buffer_gl_unbind (CoglBuffer *buffer);

View File

@ -36,7 +36,6 @@
#include "cogl-context-private.h" #include "cogl-context-private.h"
#include "driver/gl/cogl-buffer-gl-private.h" #include "driver/gl/cogl-buffer-gl-private.h"
#include "cogl-error-private.h"
#include "driver/gl/cogl-util-gl-private.h" #include "driver/gl/cogl-util-gl-private.h"
/* /*
@ -135,7 +134,7 @@ convert_bind_target_to_gl_target (CoglBufferBindTarget target)
static gboolean static gboolean
recreate_store (CoglBuffer *buffer, recreate_store (CoglBuffer *buffer,
CoglError **error) GError **error)
{ {
CoglContext *ctx = buffer->context; CoglContext *ctx = buffer->context;
GLenum gl_target; GLenum gl_target;
@ -206,7 +205,7 @@ _cogl_buffer_gl_map_range (CoglBuffer *buffer,
size_t size, size_t size,
CoglBufferAccess access, CoglBufferAccess access,
CoglBufferMapHint hints, CoglBufferMapHint hints,
CoglError **error) GError **error)
{ {
uint8_t *data; uint8_t *data;
CoglBufferBindTarget target; CoglBufferBindTarget target;
@ -218,7 +217,7 @@ _cogl_buffer_gl_map_range (CoglBuffer *buffer,
((access & COGL_BUFFER_ACCESS_WRITE) && ((access & COGL_BUFFER_ACCESS_WRITE) &&
!cogl_has_feature (ctx, COGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE))) !cogl_has_feature (ctx, COGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE)))
{ {
_cogl_set_error (error, g_set_error_literal (error,
COGL_SYSTEM_ERROR, COGL_SYSTEM_ERROR,
COGL_SYSTEM_ERROR_UNSUPPORTED, COGL_SYSTEM_ERROR_UNSUPPORTED,
"Tried to map a buffer with unsupported access mode"); "Tried to map a buffer with unsupported access mode");
@ -351,13 +350,13 @@ _cogl_buffer_gl_set_data (CoglBuffer *buffer,
unsigned int offset, unsigned int offset,
const void *data, const void *data,
unsigned int size, unsigned int size,
CoglError **error) GError **error)
{ {
CoglBufferBindTarget target; CoglBufferBindTarget target;
GLenum gl_target; GLenum gl_target;
CoglContext *ctx = buffer->context; CoglContext *ctx = buffer->context;
gboolean status = TRUE; gboolean status = TRUE;
CoglError *internal_error = NULL; GError *internal_error = NULL;
target = buffer->last_target; target = buffer->last_target;
@ -369,7 +368,7 @@ _cogl_buffer_gl_set_data (CoglBuffer *buffer,
*/ */
if (internal_error) if (internal_error)
{ {
_cogl_propagate_error (error, internal_error); g_propagate_error (error, internal_error);
return FALSE; return FALSE;
} }
@ -391,7 +390,7 @@ _cogl_buffer_gl_set_data (CoglBuffer *buffer,
void * void *
_cogl_buffer_gl_bind (CoglBuffer *buffer, _cogl_buffer_gl_bind (CoglBuffer *buffer,
CoglBufferBindTarget target, CoglBufferBindTarget target,
CoglError **error) GError **error)
{ {
void *ret; void *ret;

View File

@ -36,7 +36,7 @@
gboolean gboolean
_cogl_offscreen_gl_allocate (CoglOffscreen *offscreen, _cogl_offscreen_gl_allocate (CoglOffscreen *offscreen,
CoglError **error); GError **error);
void void
_cogl_offscreen_gl_free (CoglOffscreen *offscreen); _cogl_offscreen_gl_free (CoglOffscreen *offscreen);
@ -95,7 +95,7 @@ _cogl_framebuffer_gl_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
int y, int y,
CoglReadPixelsFlags source, CoglReadPixelsFlags source,
CoglBitmap *bitmap, CoglBitmap *bitmap,
CoglError **error); GError **error);
#endif /* __COGL_FRAMEBUFFER_GL_PRIVATE_H__ */ #endif /* __COGL_FRAMEBUFFER_GL_PRIVATE_H__ */

View File

@ -33,7 +33,6 @@
#include "cogl-context-private.h" #include "cogl-context-private.h"
#include "cogl-framebuffer-private.h" #include "cogl-framebuffer-private.h"
#include "cogl-error-private.h"
#include "cogl-texture-private.h" #include "cogl-texture-private.h"
#include "driver/gl/cogl-util-gl-private.h" #include "driver/gl/cogl-util-gl-private.h"
#include "driver/gl/cogl-framebuffer-gl-private.h" #include "driver/gl/cogl-framebuffer-gl-private.h"
@ -770,7 +769,7 @@ _cogl_framebuffer_try_creating_gl_fbo (CoglContext *ctx,
gboolean gboolean
_cogl_offscreen_gl_allocate (CoglOffscreen *offscreen, _cogl_offscreen_gl_allocate (CoglOffscreen *offscreen,
CoglError **error) GError **error)
{ {
CoglFramebuffer *fb = COGL_FRAMEBUFFER (offscreen); CoglFramebuffer *fb = COGL_FRAMEBUFFER (offscreen);
CoglContext *ctx = fb->context; CoglContext *ctx = fb->context;
@ -919,7 +918,7 @@ _cogl_offscreen_gl_allocate (CoglOffscreen *offscreen,
} }
else else
{ {
_cogl_set_error (error, COGL_FRAMEBUFFER_ERROR, g_set_error (error, COGL_FRAMEBUFFER_ERROR,
COGL_FRAMEBUFFER_ERROR_ALLOCATE, COGL_FRAMEBUFFER_ERROR_ALLOCATE,
"Failed to create an OpenGL framebuffer object"); "Failed to create an OpenGL framebuffer object");
return FALSE; return FALSE;
@ -1216,7 +1215,7 @@ _cogl_framebuffer_gl_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
int y, int y,
CoglReadPixelsFlags source, CoglReadPixelsFlags source,
CoglBitmap *bitmap, CoglBitmap *bitmap,
CoglError **error) GError **error)
{ {
CoglContext *ctx = framebuffer->context; CoglContext *ctx = framebuffer->context;
int framebuffer_height = cogl_framebuffer_get_height (framebuffer); int framebuffer_height = cogl_framebuffer_get_height (framebuffer);
@ -1340,7 +1339,7 @@ _cogl_framebuffer_gl_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
int bpp, rowstride; int bpp, rowstride;
gboolean succeeded = FALSE; gboolean succeeded = FALSE;
uint8_t *pixels; uint8_t *pixels;
CoglError *internal_error = NULL; GError *internal_error = NULL;
rowstride = cogl_bitmap_get_rowstride (bitmap); rowstride = cogl_bitmap_get_rowstride (bitmap);
@ -1378,7 +1377,7 @@ _cogl_framebuffer_gl_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
if (internal_error) if (internal_error)
{ {
cogl_object_unref (shared_bmp); cogl_object_unref (shared_bmp);
_cogl_propagate_error (error, internal_error); g_propagate_error (error, internal_error);
goto EXIT; goto EXIT;
} }

View File

@ -52,13 +52,13 @@ _cogl_texture_2d_gl_init (CoglTexture2D *tex_2d);
gboolean gboolean
_cogl_texture_2d_gl_allocate (CoglTexture *tex, _cogl_texture_2d_gl_allocate (CoglTexture *tex,
CoglError **error); GError **error);
CoglTexture2D * CoglTexture2D *
_cogl_texture_2d_gl_new_from_bitmap (CoglBitmap *bmp, _cogl_texture_2d_gl_new_from_bitmap (CoglBitmap *bmp,
CoglPixelFormat internal_format, CoglPixelFormat internal_format,
gboolean can_convert_in_place, gboolean can_convert_in_place,
CoglError **error); GError **error);
#if defined (COGL_HAS_EGL_SUPPORT) && defined (EGL_KHR_image_base) #if defined (COGL_HAS_EGL_SUPPORT) && defined (EGL_KHR_image_base)
CoglTexture2D * CoglTexture2D *
@ -67,7 +67,7 @@ _cogl_egl_texture_2d_gl_new_from_image (CoglContext *ctx,
int height, int height,
CoglPixelFormat format, CoglPixelFormat format,
EGLImageKHR image, EGLImageKHR image,
CoglError **error); GError **error);
#endif #endif
void void
@ -108,7 +108,7 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
int dst_x, int dst_x,
int dst_y, int dst_y,
int level, int level,
CoglError **error); GError **error);
gboolean gboolean
_cogl_texture_2d_gl_is_get_data_supported (CoglTexture2D *tex_2d); _cogl_texture_2d_gl_is_get_data_supported (CoglTexture2D *tex_2d);

View File

@ -40,7 +40,6 @@
#include "cogl-texture-private.h" #include "cogl-texture-private.h"
#include "cogl-texture-2d-gl.h" #include "cogl-texture-2d-gl.h"
#include "cogl-texture-2d-private.h" #include "cogl-texture-2d-private.h"
#include "cogl-error-private.h"
#include "driver/gl/cogl-texture-2d-gl-private.h" #include "driver/gl/cogl-texture-2d-gl-private.h"
#include "driver/gl/cogl-texture-gl-private.h" #include "driver/gl/cogl-texture-gl-private.h"
#include "driver/gl/cogl-pipeline-opengl-private.h" #include "driver/gl/cogl-pipeline-opengl-private.h"
@ -122,7 +121,7 @@ _cogl_texture_2d_gl_init (CoglTexture2D *tex_2d)
static gboolean static gboolean
allocate_with_size (CoglTexture2D *tex_2d, allocate_with_size (CoglTexture2D *tex_2d,
CoglTextureLoader *loader, CoglTextureLoader *loader,
CoglError **error) GError **error)
{ {
CoglTexture *tex = COGL_TEXTURE (tex_2d); CoglTexture *tex = COGL_TEXTURE (tex_2d);
CoglPixelFormat internal_format; CoglPixelFormat internal_format;
@ -142,7 +141,7 @@ allocate_with_size (CoglTexture2D *tex_2d,
height, height,
internal_format)) internal_format))
{ {
_cogl_set_error (error, COGL_TEXTURE_ERROR, g_set_error_literal (error, COGL_TEXTURE_ERROR,
COGL_TEXTURE_ERROR_SIZE, COGL_TEXTURE_ERROR_SIZE,
"Failed to create texture 2d due to size/format" "Failed to create texture 2d due to size/format"
" constraints"); " constraints");
@ -188,7 +187,7 @@ allocate_with_size (CoglTexture2D *tex_2d,
static gboolean static gboolean
allocate_from_bitmap (CoglTexture2D *tex_2d, allocate_from_bitmap (CoglTexture2D *tex_2d,
CoglTextureLoader *loader, CoglTextureLoader *loader,
CoglError **error) GError **error)
{ {
CoglTexture *tex = COGL_TEXTURE (tex_2d); CoglTexture *tex = COGL_TEXTURE (tex_2d);
CoglBitmap *bmp = loader->src.bitmap.bitmap; CoglBitmap *bmp = loader->src.bitmap.bitmap;
@ -210,7 +209,7 @@ allocate_from_bitmap (CoglTexture2D *tex_2d,
height, height,
internal_format)) internal_format))
{ {
_cogl_set_error (error, COGL_TEXTURE_ERROR, g_set_error_literal (error, COGL_TEXTURE_ERROR,
COGL_TEXTURE_ERROR_SIZE, COGL_TEXTURE_ERROR_SIZE,
"Failed to create texture 2d due to size/format" "Failed to create texture 2d due to size/format"
" constraints"); " constraints");
@ -239,7 +238,7 @@ allocate_from_bitmap (CoglTexture2D *tex_2d,
supported we can fallback to using GL_GENERATE_MIPMAP */ supported we can fallback to using GL_GENERATE_MIPMAP */
if (!cogl_has_feature (ctx, COGL_FEATURE_ID_OFFSCREEN)) if (!cogl_has_feature (ctx, COGL_FEATURE_ID_OFFSCREEN))
{ {
CoglError *ignore = NULL; GError *ignore = NULL;
uint8_t *data = _cogl_bitmap_map (upload_bmp, uint8_t *data = _cogl_bitmap_map (upload_bmp,
COGL_BUFFER_ACCESS_READ, 0, COGL_BUFFER_ACCESS_READ, 0,
&ignore); &ignore);
@ -258,7 +257,7 @@ allocate_from_bitmap (CoglTexture2D *tex_2d,
{ {
g_warning ("Failed to read first pixel of bitmap for " g_warning ("Failed to read first pixel of bitmap for "
"glGenerateMipmap fallback"); "glGenerateMipmap fallback");
cogl_error_free (ignore); g_error_free (ignore);
memset (tex_2d->first_pixel.data, 0, memset (tex_2d->first_pixel.data, 0,
_cogl_pixel_format_get_bytes_per_pixel (format)); _cogl_pixel_format_get_bytes_per_pixel (format));
} }
@ -295,7 +294,7 @@ allocate_from_bitmap (CoglTexture2D *tex_2d,
static gboolean static gboolean
allocate_from_egl_image (CoglTexture2D *tex_2d, allocate_from_egl_image (CoglTexture2D *tex_2d,
CoglTextureLoader *loader, CoglTextureLoader *loader,
CoglError **error) GError **error)
{ {
CoglTexture *tex = COGL_TEXTURE (tex_2d); CoglTexture *tex = COGL_TEXTURE (tex_2d);
CoglContext *ctx = tex->context; CoglContext *ctx = tex->context;
@ -311,7 +310,7 @@ allocate_from_egl_image (CoglTexture2D *tex_2d,
ctx->glEGLImageTargetTexture2D (GL_TEXTURE_2D, loader->src.egl_image.image); ctx->glEGLImageTargetTexture2D (GL_TEXTURE_2D, loader->src.egl_image.image);
if (_cogl_gl_util_get_error (ctx) != GL_NO_ERROR) if (_cogl_gl_util_get_error (ctx) != GL_NO_ERROR)
{ {
_cogl_set_error (error, g_set_error_literal (error,
COGL_TEXTURE_ERROR, COGL_TEXTURE_ERROR,
COGL_TEXTURE_ERROR_BAD_PARAMETER, COGL_TEXTURE_ERROR_BAD_PARAMETER,
"Could not create a CoglTexture2D from a given " "Could not create a CoglTexture2D from a given "
@ -334,7 +333,7 @@ allocate_from_egl_image (CoglTexture2D *tex_2d,
static gboolean static gboolean
allocate_from_gl_foreign (CoglTexture2D *tex_2d, allocate_from_gl_foreign (CoglTexture2D *tex_2d,
CoglTextureLoader *loader, CoglTextureLoader *loader,
CoglError **error) GError **error)
{ {
CoglTexture *tex = COGL_TEXTURE (tex_2d); CoglTexture *tex = COGL_TEXTURE (tex_2d);
CoglContext *ctx = tex->context; CoglContext *ctx = tex->context;
@ -344,7 +343,7 @@ allocate_from_gl_foreign (CoglTexture2D *tex_2d,
if (!ctx->texture_driver->allows_foreign_gl_target (ctx, GL_TEXTURE_2D)) if (!ctx->texture_driver->allows_foreign_gl_target (ctx, GL_TEXTURE_2D))
{ {
_cogl_set_error (error, g_set_error_literal (error,
COGL_SYSTEM_ERROR, COGL_SYSTEM_ERROR,
COGL_SYSTEM_ERROR_UNSUPPORTED, COGL_SYSTEM_ERROR_UNSUPPORTED,
"Foreign GL_TEXTURE_2D textures are not " "Foreign GL_TEXTURE_2D textures are not "
@ -359,7 +358,7 @@ allocate_from_gl_foreign (CoglTexture2D *tex_2d,
loader->src.gl_foreign.gl_handle, TRUE); loader->src.gl_foreign.gl_handle, TRUE);
if (_cogl_gl_util_get_error (ctx) != GL_NO_ERROR) if (_cogl_gl_util_get_error (ctx) != GL_NO_ERROR)
{ {
_cogl_set_error (error, g_set_error_literal (error,
COGL_SYSTEM_ERROR, COGL_SYSTEM_ERROR,
COGL_SYSTEM_ERROR_UNSUPPORTED, COGL_SYSTEM_ERROR_UNSUPPORTED,
"Failed to bind foreign GL_TEXTURE_2D texture"); "Failed to bind foreign GL_TEXTURE_2D texture");
@ -393,10 +392,11 @@ allocate_from_gl_foreign (CoglTexture2D *tex_2d,
gl_int_format, gl_int_format,
&format)) &format))
{ {
_cogl_set_error (error, g_set_error_literal (error,
COGL_SYSTEM_ERROR, COGL_SYSTEM_ERROR,
COGL_SYSTEM_ERROR_UNSUPPORTED, COGL_SYSTEM_ERROR_UNSUPPORTED,
"Unsupported internal format for foreign texture"); "Unsupported internal format for foreign "
"texture");
return FALSE; return FALSE;
} }
} }
@ -415,10 +415,11 @@ allocate_from_gl_foreign (CoglTexture2D *tex_2d,
/* Compressed texture images not supported */ /* Compressed texture images not supported */
if (gl_compressed == GL_TRUE) if (gl_compressed == GL_TRUE)
{ {
_cogl_set_error (error, g_set_error_literal (error,
COGL_SYSTEM_ERROR, COGL_SYSTEM_ERROR,
COGL_SYSTEM_ERROR_UNSUPPORTED, COGL_SYSTEM_ERROR_UNSUPPORTED,
"Compressed foreign textures aren't currently supported"); "Compressed foreign textures aren't currently"
" supported");
return FALSE; return FALSE;
} }
@ -459,7 +460,7 @@ allocate_from_gl_foreign (CoglTexture2D *tex_2d,
static gboolean static gboolean
allocate_custom_egl_image_external (CoglTexture2D *tex_2d, allocate_custom_egl_image_external (CoglTexture2D *tex_2d,
CoglTextureLoader *loader, CoglTextureLoader *loader,
CoglError **error) GError **error)
{ {
CoglTexture *tex = COGL_TEXTURE (tex_2d); CoglTexture *tex = COGL_TEXTURE (tex_2d);
CoglContext *ctx = tex->context; CoglContext *ctx = tex->context;
@ -480,7 +481,7 @@ allocate_custom_egl_image_external (CoglTexture2D *tex_2d,
if (_cogl_gl_util_get_error (ctx) != GL_NO_ERROR) if (_cogl_gl_util_get_error (ctx) != GL_NO_ERROR)
{ {
_cogl_set_error (error, g_set_error_literal (error,
COGL_TEXTURE_ERROR, COGL_TEXTURE_ERROR,
COGL_TEXTURE_ERROR_BAD_PARAMETER, COGL_TEXTURE_ERROR_BAD_PARAMETER,
"Could not create a CoglTexture2D from a given " "Could not create a CoglTexture2D from a given "
@ -518,7 +519,7 @@ cogl_texture_2d_new_from_egl_image_external (CoglContext *ctx,
CoglTexture2DEGLImageExternalAlloc alloc, CoglTexture2DEGLImageExternalAlloc alloc,
gpointer user_data, gpointer user_data,
GDestroyNotify destroy, GDestroyNotify destroy,
CoglError **error) GError **error)
{ {
CoglTextureLoader *loader; CoglTextureLoader *loader;
CoglTexture2D *tex_2d; CoglTexture2D *tex_2d;
@ -552,7 +553,7 @@ cogl_texture_2d_new_from_egl_image_external (CoglContext *ctx,
gboolean gboolean
_cogl_texture_2d_gl_allocate (CoglTexture *tex, _cogl_texture_2d_gl_allocate (CoglTexture *tex,
CoglError **error) GError **error)
{ {
CoglTexture2D *tex_2d = COGL_TEXTURE_2D (tex); CoglTexture2D *tex_2d = COGL_TEXTURE_2D (tex);
CoglTextureLoader *loader = tex->loader; CoglTextureLoader *loader = tex->loader;
@ -754,7 +755,7 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
int dst_x, int dst_x,
int dst_y, int dst_y,
int level, int level,
CoglError **error) GError **error)
{ {
CoglTexture *tex = COGL_TEXTURE (tex_2d); CoglTexture *tex = COGL_TEXTURE (tex_2d);
CoglContext *ctx = tex->context; CoglContext *ctx = tex->context;
@ -784,7 +785,7 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
if (dst_x == 0 && dst_y == 0 && if (dst_x == 0 && dst_y == 0 &&
!cogl_has_feature (ctx, COGL_FEATURE_ID_OFFSCREEN)) !cogl_has_feature (ctx, COGL_FEATURE_ID_OFFSCREEN))
{ {
CoglError *ignore = NULL; GError *ignore = NULL;
uint8_t *data = uint8_t *data =
_cogl_bitmap_map (upload_bmp, COGL_BUFFER_ACCESS_READ, 0, &ignore); _cogl_bitmap_map (upload_bmp, COGL_BUFFER_ACCESS_READ, 0, &ignore);
CoglPixelFormat bpp = CoglPixelFormat bpp =
@ -806,7 +807,7 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
{ {
g_warning ("Failed to read first bitmap pixel for " g_warning ("Failed to read first bitmap pixel for "
"glGenerateMipmap fallback"); "glGenerateMipmap fallback");
cogl_error_free (ignore); g_error_free (ignore);
memset (tex_2d->first_pixel.data, 0, bpp); memset (tex_2d->first_pixel.data, 0, bpp);
} }
} }

View File

@ -83,7 +83,7 @@ void
_cogl_gl_util_clear_gl_errors (CoglContext *ctx); _cogl_gl_util_clear_gl_errors (CoglContext *ctx);
gboolean gboolean
_cogl_gl_util_catch_out_of_memory (CoglContext *ctx, CoglError **error); _cogl_gl_util_catch_out_of_memory (CoglContext *ctx, GError **error);
/* Parses a GL version number stored in a string. @version_string must /* Parses a GL version number stored in a string. @version_string must
* point to the beginning of the version number (ie, it can't point to * point to the beginning of the version number (ie, it can't point to

View File

@ -34,7 +34,6 @@
#include "cogl-types.h" #include "cogl-types.h"
#include "cogl-context-private.h" #include "cogl-context-private.h"
#include "cogl-error-private.h"
#include "driver/gl/cogl-util-gl-private.h" #include "driver/gl/cogl-util-gl-private.h"
#ifdef COGL_GL_DEBUG #ifdef COGL_GL_DEBUG
@ -96,7 +95,7 @@ _cogl_gl_util_clear_gl_errors (CoglContext *ctx)
} }
gboolean gboolean
_cogl_gl_util_catch_out_of_memory (CoglContext *ctx, CoglError **error) _cogl_gl_util_catch_out_of_memory (CoglContext *ctx, GError **error)
{ {
GLenum gl_error; GLenum gl_error;
gboolean out_of_memory = FALSE; gboolean out_of_memory = FALSE;
@ -118,7 +117,7 @@ _cogl_gl_util_catch_out_of_memory (CoglContext *ctx, CoglError **error)
if (out_of_memory) if (out_of_memory)
{ {
_cogl_set_error (error, COGL_SYSTEM_ERROR, g_set_error_literal (error, COGL_SYSTEM_ERROR,
COGL_SYSTEM_ERROR_NO_MEMORY, COGL_SYSTEM_ERROR_NO_MEMORY,
"Out of memory"); "Out of memory");
return TRUE; return TRUE;

View File

@ -36,7 +36,6 @@
#include "cogl-context-private.h" #include "cogl-context-private.h"
#include "cogl-feature-private.h" #include "cogl-feature-private.h"
#include "cogl-renderer-private.h" #include "cogl-renderer-private.h"
#include "cogl-error-private.h"
#include "driver/gl/cogl-util-gl-private.h" #include "driver/gl/cogl-util-gl-private.h"
#include "driver/gl/cogl-framebuffer-gl-private.h" #include "driver/gl/cogl-framebuffer-gl-private.h"
#include "driver/gl/cogl-texture-2d-gl-private.h" #include "driver/gl/cogl-texture-2d-gl-private.h"
@ -304,13 +303,13 @@ _cogl_get_gl_version (CoglContext *ctx,
static gboolean static gboolean
check_gl_version (CoglContext *ctx, check_gl_version (CoglContext *ctx,
char **gl_extensions, char **gl_extensions,
CoglError **error) GError **error)
{ {
int major, minor; int major, minor;
if (!_cogl_get_gl_version (ctx, &major, &minor)) if (!_cogl_get_gl_version (ctx, &major, &minor))
{ {
_cogl_set_error (error, g_set_error (error,
COGL_DRIVER_ERROR, COGL_DRIVER_ERROR,
COGL_DRIVER_ERROR_UNKNOWN_VERSION, COGL_DRIVER_ERROR_UNKNOWN_VERSION,
"The OpenGL version could not be determined"); "The OpenGL version could not be determined");
@ -320,7 +319,7 @@ check_gl_version (CoglContext *ctx,
/* We require GLSL 1.20, which is implied by OpenGL 2.1. */ /* We require GLSL 1.20, which is implied by OpenGL 2.1. */
if (!COGL_CHECK_GL_VERSION (major, minor, 2, 1)) if (!COGL_CHECK_GL_VERSION (major, minor, 2, 1))
{ {
_cogl_set_error (error, g_set_error (error,
COGL_DRIVER_ERROR, COGL_DRIVER_ERROR,
COGL_DRIVER_ERROR_INVALID_VERSION, COGL_DRIVER_ERROR_INVALID_VERSION,
"OpenGL 2.1 or better is required"); "OpenGL 2.1 or better is required");
@ -332,7 +331,7 @@ check_gl_version (CoglContext *ctx,
static gboolean static gboolean
_cogl_driver_update_features (CoglContext *ctx, _cogl_driver_update_features (CoglContext *ctx,
CoglError **error) GError **error)
{ {
CoglFeatureFlags flags = 0; CoglFeatureFlags flags = 0;
unsigned long private_features unsigned long private_features
@ -527,7 +526,7 @@ _cogl_driver_update_features (CoglContext *ctx,
if (!COGL_FLAGS_GET (private_features, COGL_PRIVATE_FEATURE_ALPHA_TEXTURES) && if (!COGL_FLAGS_GET (private_features, COGL_PRIVATE_FEATURE_ALPHA_TEXTURES) &&
!COGL_FLAGS_GET (private_features, COGL_PRIVATE_FEATURE_TEXTURE_SWIZZLE)) !COGL_FLAGS_GET (private_features, COGL_PRIVATE_FEATURE_TEXTURE_SWIZZLE))
{ {
_cogl_set_error (error, g_set_error (error,
COGL_DRIVER_ERROR, COGL_DRIVER_ERROR,
COGL_DRIVER_ERROR_NO_SUITABLE_DRIVER_FOUND, COGL_DRIVER_ERROR_NO_SUITABLE_DRIVER_FOUND,
"The GL_ARB_texture_swizzle extension is required " "The GL_ARB_texture_swizzle extension is required "

View File

@ -44,7 +44,6 @@
#include "cogl-context-private.h" #include "cogl-context-private.h"
#include "cogl-object-private.h" #include "cogl-object-private.h"
#include "cogl-primitives.h" #include "cogl-primitives.h"
#include "cogl-error-private.h"
#include "driver/gl/cogl-pipeline-opengl-private.h" #include "driver/gl/cogl-pipeline-opengl-private.h"
#include "driver/gl/cogl-util-gl-private.h" #include "driver/gl/cogl-util-gl-private.h"
#include "driver/gl/cogl-texture-gl-private.h" #include "driver/gl/cogl-texture-gl-private.h"
@ -191,7 +190,7 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
CoglBitmap *source_bmp, CoglBitmap *source_bmp,
GLuint source_gl_format, GLuint source_gl_format,
GLuint source_gl_type, GLuint source_gl_type,
CoglError **error) GError **error)
{ {
GLenum gl_target; GLenum gl_target;
GLuint gl_handle; GLuint gl_handle;
@ -199,7 +198,7 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
CoglPixelFormat source_format = cogl_bitmap_get_format (source_bmp); CoglPixelFormat source_format = cogl_bitmap_get_format (source_bmp);
int bpp = _cogl_pixel_format_get_bytes_per_pixel (source_format); int bpp = _cogl_pixel_format_get_bytes_per_pixel (source_format);
gboolean status = TRUE; gboolean status = TRUE;
CoglError *internal_error = NULL; GError *internal_error = NULL;
int level_width; int level_width;
int level_height; int level_height;
@ -212,7 +211,7 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
* problems... */ * problems... */
if (internal_error) if (internal_error)
{ {
_cogl_propagate_error (error, internal_error); g_propagate_error (error, internal_error);
return FALSE; return FALSE;
} }
@ -299,13 +298,13 @@ _cogl_texture_driver_upload_to_gl (CoglContext *ctx,
GLint internal_gl_format, GLint internal_gl_format,
GLuint source_gl_format, GLuint source_gl_format,
GLuint source_gl_type, GLuint source_gl_type,
CoglError **error) GError **error)
{ {
uint8_t *data; uint8_t *data;
CoglPixelFormat source_format = cogl_bitmap_get_format (source_bmp); CoglPixelFormat source_format = cogl_bitmap_get_format (source_bmp);
int bpp = _cogl_pixel_format_get_bytes_per_pixel (source_format); int bpp = _cogl_pixel_format_get_bytes_per_pixel (source_format);
gboolean status = TRUE; gboolean status = TRUE;
CoglError *internal_error = NULL; GError *internal_error = NULL;
data = _cogl_bitmap_gl_bind (source_bmp, data = _cogl_bitmap_gl_bind (source_bmp,
COGL_BUFFER_ACCESS_READ, COGL_BUFFER_ACCESS_READ,
@ -317,7 +316,7 @@ _cogl_texture_driver_upload_to_gl (CoglContext *ctx,
* problems... */ * problems... */
if (internal_error) if (internal_error)
{ {
_cogl_propagate_error (error, internal_error); g_propagate_error (error, internal_error);
return FALSE; return FALSE;
} }

View File

@ -33,7 +33,6 @@
#include <string.h> #include <string.h>
#include "cogl-context-private.h" #include "cogl-context-private.h"
#include "cogl-error-private.h"
#include "cogl-feature-private.h" #include "cogl-feature-private.h"
#include "cogl-renderer-private.h" #include "cogl-renderer-private.h"
#include "cogl-private.h" #include "cogl-private.h"
@ -239,7 +238,7 @@ _cogl_get_gl_version (CoglContext *ctx,
static gboolean static gboolean
_cogl_driver_update_features (CoglContext *context, _cogl_driver_update_features (CoglContext *context,
CoglError **error) GError **error)
{ {
unsigned long private_features unsigned long private_features
[COGL_FLAGS_N_LONGS_FOR_SIZE (COGL_N_PRIVATE_FEATURES)] = { 0 }; [COGL_FLAGS_N_LONGS_FOR_SIZE (COGL_N_PRIVATE_FEATURES)] = { 0 };
@ -290,7 +289,7 @@ _cogl_driver_update_features (CoglContext *context,
if (!COGL_CHECK_GL_VERSION (gl_major, gl_minor, 2, 0)) if (!COGL_CHECK_GL_VERSION (gl_major, gl_minor, 2, 0))
{ {
_cogl_set_error (error, g_set_error (error,
COGL_DRIVER_ERROR, COGL_DRIVER_ERROR,
COGL_DRIVER_ERROR_INVALID_VERSION, COGL_DRIVER_ERROR_INVALID_VERSION,
"OpenGL ES 2.0 or better is required"); "OpenGL ES 2.0 or better is required");

View File

@ -44,7 +44,6 @@
#include "cogl-context-private.h" #include "cogl-context-private.h"
#include "cogl-object-private.h" #include "cogl-object-private.h"
#include "cogl-primitives.h" #include "cogl-primitives.h"
#include "cogl-error-private.h"
#include "driver/gl/cogl-pipeline-opengl-private.h" #include "driver/gl/cogl-pipeline-opengl-private.h"
#include "driver/gl/cogl-util-gl-private.h" #include "driver/gl/cogl-util-gl-private.h"
#include "driver/gl/cogl-texture-gl-private.h" #include "driver/gl/cogl-texture-gl-private.h"
@ -150,7 +149,7 @@ _cogl_texture_driver_prep_gl_for_pixels_download (CoglContext *ctx,
static CoglBitmap * static CoglBitmap *
prepare_bitmap_alignment_for_upload (CoglContext *ctx, prepare_bitmap_alignment_for_upload (CoglContext *ctx,
CoglBitmap *src_bmp, CoglBitmap *src_bmp,
CoglError **error) GError **error)
{ {
CoglPixelFormat format = cogl_bitmap_get_format (src_bmp); CoglPixelFormat format = cogl_bitmap_get_format (src_bmp);
int bpp = _cogl_pixel_format_get_bytes_per_pixel (format); int bpp = _cogl_pixel_format_get_bytes_per_pixel (format);
@ -190,7 +189,7 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
CoglBitmap *source_bmp, CoglBitmap *source_bmp,
GLuint source_gl_format, GLuint source_gl_format,
GLuint source_gl_type, GLuint source_gl_type,
CoglError **error) GError **error)
{ {
GLenum gl_target; GLenum gl_target;
GLuint gl_handle; GLuint gl_handle;
@ -200,7 +199,7 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
CoglBitmap *slice_bmp; CoglBitmap *slice_bmp;
int rowstride; int rowstride;
gboolean status = TRUE; gboolean status = TRUE;
CoglError *internal_error = NULL; GError *internal_error = NULL;
int level_width; int level_width;
int level_height; int level_height;
@ -254,7 +253,7 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
* problems... */ * problems... */
if (internal_error) if (internal_error)
{ {
_cogl_propagate_error (error, internal_error); g_propagate_error (error, internal_error);
cogl_object_unref (slice_bmp); cogl_object_unref (slice_bmp);
return FALSE; return FALSE;
} }
@ -335,7 +334,7 @@ _cogl_texture_driver_upload_to_gl (CoglContext *ctx,
GLint internal_gl_format, GLint internal_gl_format,
GLuint source_gl_format, GLuint source_gl_format,
GLuint source_gl_type, GLuint source_gl_type,
CoglError **error) GError **error)
{ {
CoglPixelFormat source_format = cogl_bitmap_get_format (source_bmp); CoglPixelFormat source_format = cogl_bitmap_get_format (source_bmp);
int bpp = _cogl_pixel_format_get_bytes_per_pixel (source_format); int bpp = _cogl_pixel_format_get_bytes_per_pixel (source_format);
@ -344,7 +343,7 @@ _cogl_texture_driver_upload_to_gl (CoglContext *ctx,
int bmp_height = cogl_bitmap_get_height (source_bmp); int bmp_height = cogl_bitmap_get_height (source_bmp);
CoglBitmap *bmp; CoglBitmap *bmp;
uint8_t *data; uint8_t *data;
CoglError *internal_error = NULL; GError *internal_error = NULL;
gboolean status = TRUE; gboolean status = TRUE;
bmp = prepare_bitmap_alignment_for_upload (ctx, source_bmp, error); bmp = prepare_bitmap_alignment_for_upload (ctx, source_bmp, error);
@ -369,7 +368,7 @@ _cogl_texture_driver_upload_to_gl (CoglContext *ctx,
if (internal_error) if (internal_error)
{ {
cogl_object_unref (bmp); cogl_object_unref (bmp);
_cogl_propagate_error (error, internal_error); g_propagate_error (error, internal_error);
return FALSE; return FALSE;
} }

View File

@ -36,7 +36,6 @@
#include "cogl-context-private.h" #include "cogl-context-private.h"
#include "cogl-feature-private.h" #include "cogl-feature-private.h"
#include "cogl-renderer-private.h" #include "cogl-renderer-private.h"
#include "cogl-error-private.h"
#include "cogl-framebuffer-nop-private.h" #include "cogl-framebuffer-nop-private.h"
#include "cogl-texture-2d-nop-private.h" #include "cogl-texture-2d-nop-private.h"
#include "cogl-attribute-nop-private.h" #include "cogl-attribute-nop-private.h"
@ -44,7 +43,7 @@
static gboolean static gboolean
_cogl_driver_update_features (CoglContext *ctx, _cogl_driver_update_features (CoglContext *ctx,
CoglError **error) GError **error)
{ {
/* _cogl_gpu_info_init (ctx, &ctx->gpu); */ /* _cogl_gpu_info_init (ctx, &ctx->gpu); */

View File

@ -39,7 +39,7 @@
gboolean gboolean
_cogl_offscreen_nop_allocate (CoglOffscreen *offscreen, _cogl_offscreen_nop_allocate (CoglOffscreen *offscreen,
CoglError **error); GError **error);
void void
_cogl_offscreen_nop_free (CoglOffscreen *offscreen); _cogl_offscreen_nop_free (CoglOffscreen *offscreen);
@ -95,6 +95,6 @@ _cogl_framebuffer_nop_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
int y, int y,
CoglReadPixelsFlags source, CoglReadPixelsFlags source,
CoglBitmap *bitmap, CoglBitmap *bitmap,
CoglError **error); GError **error);
#endif /* _COGL_FRAMEBUFFER_NOP_PRIVATE_H_ */ #endif /* _COGL_FRAMEBUFFER_NOP_PRIVATE_H_ */

View File

@ -44,7 +44,7 @@ _cogl_framebuffer_nop_flush_state (CoglFramebuffer *draw_buffer,
gboolean gboolean
_cogl_offscreen_nop_allocate (CoglOffscreen *offscreen, _cogl_offscreen_nop_allocate (CoglOffscreen *offscreen,
CoglError **error) GError **error)
{ {
return TRUE; return TRUE;
} }
@ -113,7 +113,7 @@ _cogl_framebuffer_nop_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
int y, int y,
CoglReadPixelsFlags source, CoglReadPixelsFlags source,
CoglBitmap *bitmap, CoglBitmap *bitmap,
CoglError **error) GError **error)
{ {
return TRUE; return TRUE;
} }

View File

@ -52,7 +52,7 @@ _cogl_texture_2d_nop_init (CoglTexture2D *tex_2d);
gboolean gboolean
_cogl_texture_2d_nop_allocate (CoglTexture *tex, _cogl_texture_2d_nop_allocate (CoglTexture *tex,
CoglError **error); GError **error);
void void
_cogl_texture_2d_nop_flush_legacy_texobj_filters (CoglTexture *tex, _cogl_texture_2d_nop_flush_legacy_texobj_filters (CoglTexture *tex,
@ -92,7 +92,7 @@ _cogl_texture_2d_nop_copy_from_bitmap (CoglTexture2D *tex_2d,
int dst_x, int dst_x,
int dst_y, int dst_y,
int level, int level,
CoglError **error); GError **error);
void void
_cogl_texture_2d_nop_get_data (CoglTexture2D *tex_2d, _cogl_texture_2d_nop_get_data (CoglTexture2D *tex_2d,

View File

@ -39,7 +39,6 @@
#include "cogl-private.h" #include "cogl-private.h"
#include "cogl-texture-2d-nop-private.h" #include "cogl-texture-2d-nop-private.h"
#include "cogl-texture-2d-private.h" #include "cogl-texture-2d-private.h"
#include "cogl-error-private.h"
void void
_cogl_texture_2d_nop_free (CoglTexture2D *tex_2d) _cogl_texture_2d_nop_free (CoglTexture2D *tex_2d)
@ -62,7 +61,7 @@ _cogl_texture_2d_nop_init (CoglTexture2D *tex_2d)
gboolean gboolean
_cogl_texture_2d_nop_allocate (CoglTexture *tex, _cogl_texture_2d_nop_allocate (CoglTexture *tex,
CoglError **error) GError **error)
{ {
return TRUE; return TRUE;
} }
@ -116,7 +115,7 @@ _cogl_texture_2d_nop_copy_from_bitmap (CoglTexture2D *tex_2d,
int dst_x, int dst_x,
int dst_y, int dst_y,
int level, int level,
CoglError **error) GError **error)
{ {
return TRUE; return TRUE;
} }

View File

@ -37,7 +37,6 @@ global:
_cogl_onscreen_notify_frame_sync; _cogl_onscreen_notify_frame_sync;
_cogl_winsys_egl_renderer_connect_common; _cogl_winsys_egl_renderer_connect_common;
_cogl_winsys_error_quark; _cogl_winsys_error_quark;
_cogl_set_error;
_cogl_poll_renderer_add_fd; _cogl_poll_renderer_add_fd;
_cogl_poll_renderer_add_idle; _cogl_poll_renderer_add_idle;
_cogl_framebuffer_winsys_update_size; _cogl_framebuffer_winsys_update_size;

View File

@ -131,7 +131,6 @@ cogl_nonintrospected_headers = [
'cogl-macros.h', 'cogl-macros.h',
'cogl-fence.h', 'cogl-fence.h',
'cogl-version.h', 'cogl-version.h',
'cogl-error.h',
'cogl-gtype-private.h', 'cogl-gtype-private.h',
'cogl-glib-source.h', 'cogl-glib-source.h',
] ]
@ -365,8 +364,6 @@ cogl_sources = [
'cogl-magazine.c', 'cogl-magazine.c',
'cogl-gles2-context-private.h', 'cogl-gles2-context-private.h',
'cogl-gles2-context.c', 'cogl-gles2-context.c',
'cogl-error-private.h',
'cogl-error.c',
'cogl-closure-list-private.h', 'cogl-closure-list-private.h',
'cogl-closure-list.c', 'cogl-closure-list.c',
'cogl-fence.c', 'cogl-fence.c',

View File

@ -49,7 +49,6 @@
#include "cogl-renderer-private.h" #include "cogl-renderer-private.h"
#include "cogl-object-private.h" #include "cogl-object-private.h"
#include "cogl-xlib.h" #include "cogl-xlib.h"
#include "cogl-error-private.h"
#include "cogl-private.h" #include "cogl-private.h"
#include "cogl-gtype-private.h" #include "cogl-gtype-private.h"
#include "driver/gl/cogl-pipeline-opengl-private.h" #include "driver/gl/cogl-pipeline-opengl-private.h"
@ -287,7 +286,7 @@ _cogl_texture_pixmap_x11_new (CoglContext *ctxt,
uint32_t pixmap, uint32_t pixmap,
gboolean automatic_updates, gboolean automatic_updates,
CoglTexturePixmapStereoMode stereo_mode, CoglTexturePixmapStereoMode stereo_mode,
CoglError **error) GError **error)
{ {
CoglTexturePixmapX11 *tex_pixmap = g_new (CoglTexturePixmapX11, 1); CoglTexturePixmapX11 *tex_pixmap = g_new (CoglTexturePixmapX11, 1);
Display *display = cogl_xlib_renderer_get_display (ctxt->display->renderer); Display *display = cogl_xlib_renderer_get_display (ctxt->display->renderer);
@ -307,7 +306,7 @@ _cogl_texture_pixmap_x11_new (CoglContext *ctxt,
&pixmap_border_width, &tex_pixmap->depth)) &pixmap_border_width, &tex_pixmap->depth))
{ {
g_free (tex_pixmap); g_free (tex_pixmap);
_cogl_set_error (error, g_set_error_literal (error,
COGL_TEXTURE_PIXMAP_X11_ERROR, COGL_TEXTURE_PIXMAP_X11_ERROR,
COGL_TEXTURE_PIXMAP_X11_ERROR_X11, COGL_TEXTURE_PIXMAP_X11_ERROR_X11,
"Unable to query pixmap size"); "Unable to query pixmap size");
@ -339,7 +338,7 @@ _cogl_texture_pixmap_x11_new (CoglContext *ctxt,
if (!XGetWindowAttributes (display, pixmap_root_window, &window_attributes)) if (!XGetWindowAttributes (display, pixmap_root_window, &window_attributes))
{ {
g_free (tex_pixmap); g_free (tex_pixmap);
_cogl_set_error (error, g_set_error_literal (error,
COGL_TEXTURE_PIXMAP_X11_ERROR, COGL_TEXTURE_PIXMAP_X11_ERROR,
COGL_TEXTURE_PIXMAP_X11_ERROR_X11, COGL_TEXTURE_PIXMAP_X11_ERROR_X11,
"Unable to query root window attributes"); "Unable to query root window attributes");
@ -392,7 +391,7 @@ CoglTexturePixmapX11 *
cogl_texture_pixmap_x11_new (CoglContext *ctxt, cogl_texture_pixmap_x11_new (CoglContext *ctxt,
uint32_t pixmap, uint32_t pixmap,
gboolean automatic_updates, gboolean automatic_updates,
CoglError **error) GError **error)
{ {
return _cogl_texture_pixmap_x11_new (ctxt, pixmap, return _cogl_texture_pixmap_x11_new (ctxt, pixmap,
@ -404,7 +403,7 @@ CoglTexturePixmapX11 *
cogl_texture_pixmap_x11_new_left (CoglContext *ctxt, cogl_texture_pixmap_x11_new_left (CoglContext *ctxt,
uint32_t pixmap, uint32_t pixmap,
gboolean automatic_updates, gboolean automatic_updates,
CoglError **error) GError **error)
{ {
return _cogl_texture_pixmap_x11_new (ctxt, pixmap, return _cogl_texture_pixmap_x11_new (ctxt, pixmap,
automatic_updates, COGL_TEXTURE_PIXMAP_LEFT, automatic_updates, COGL_TEXTURE_PIXMAP_LEFT,
@ -443,7 +442,7 @@ cogl_texture_pixmap_x11_new_right (CoglTexturePixmapX11 *tfp_left)
static gboolean static gboolean
_cogl_texture_pixmap_x11_allocate (CoglTexture *tex, _cogl_texture_pixmap_x11_allocate (CoglTexture *tex,
CoglError **error) GError **error)
{ {
return TRUE; return TRUE;
} }
@ -579,7 +578,7 @@ create_fallback_texture (CoglContext *ctx,
CoglPixelFormat internal_format) CoglPixelFormat internal_format)
{ {
CoglTexture *tex; CoglTexture *tex;
CoglError *skip_error = NULL; GError *skip_error = NULL;
/* First try creating a fast-path non-sliced texture */ /* First try creating a fast-path non-sliced texture */
tex = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, width, height)); tex = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, width, height));
@ -592,7 +591,7 @@ create_fallback_texture (CoglContext *ctx,
* lazily when uploading data. */ * lazily when uploading data. */
if (!cogl_texture_allocate (tex, &skip_error)) if (!cogl_texture_allocate (tex, &skip_error))
{ {
cogl_error_free (skip_error); g_error_free (skip_error);
cogl_object_unref (tex); cogl_object_unref (tex);
tex = NULL; tex = NULL;
} }
@ -624,7 +623,7 @@ _cogl_texture_pixmap_x11_update_image_texture (CoglTexturePixmapX11 *tex_pixmap)
int x, y, width, height; int x, y, width, height;
int bpp; int bpp;
int offset; int offset;
CoglError *ignore = NULL; GError *ignore = NULL;
_COGL_GET_CONTEXT (ctx, NO_RETVAL); _COGL_GET_CONTEXT (ctx, NO_RETVAL);
@ -846,14 +845,15 @@ _cogl_texture_pixmap_x11_set_region (CoglTexture *tex,
int dst_height, int dst_height,
int level, int level,
CoglBitmap *bmp, CoglBitmap *bmp,
CoglError **error) GError **error)
{ {
/* This doesn't make much sense for texture from pixmap so it's not /* This doesn't make much sense for texture from pixmap so it's not
supported */ supported */
_cogl_set_error (error, g_set_error_literal (error,
COGL_SYSTEM_ERROR, COGL_SYSTEM_ERROR,
COGL_SYSTEM_ERROR_UNSUPPORTED, COGL_SYSTEM_ERROR_UNSUPPORTED,
"Explicitly setting a region of a TFP texture unsupported"); "Explicitly setting a region of a TFP texture "
"unsupported");
return FALSE; return FALSE;
} }

View File

@ -86,7 +86,7 @@ typedef enum
/** /**
* COGL_TEXTURE_PIXMAP_X11_ERROR: * COGL_TEXTURE_PIXMAP_X11_ERROR:
* *
* #CoglError domain for texture-pixmap-x11 errors. * #GError domain for texture-pixmap-x11 errors.
* *
* Since: 1.10 * Since: 1.10
*/ */
@ -114,7 +114,7 @@ uint32_t cogl_texture_pixmap_x11_error_quark (void);
* @pixmap: A X11 pixmap ID * @pixmap: A X11 pixmap ID
* @automatic_updates: Whether to automatically copy the contents of * @automatic_updates: Whether to automatically copy the contents of
* the pixmap to the texture. * the pixmap to the texture.
* @error: A #CoglError for exceptions * @error: A #GError for exceptions
* *
* Creates a texture that contains the contents of @pixmap. If * Creates a texture that contains the contents of @pixmap. If
* @automatic_updates is %TRUE then Cogl will attempt to listen for * @automatic_updates is %TRUE then Cogl will attempt to listen for
@ -130,7 +130,7 @@ CoglTexturePixmapX11 *
cogl_texture_pixmap_x11_new (CoglContext *context, cogl_texture_pixmap_x11_new (CoglContext *context,
uint32_t pixmap, uint32_t pixmap,
gboolean automatic_updates, gboolean automatic_updates,
CoglError **error); GError **error);
/** /**
* cogl_texture_pixmap_x11_new_left: * cogl_texture_pixmap_x11_new_left:
@ -138,7 +138,7 @@ cogl_texture_pixmap_x11_new (CoglContext *context,
* @pixmap: A X11 pixmap ID * @pixmap: A X11 pixmap ID
* @automatic_updates: Whether to automatically copy the contents of * @automatic_updates: Whether to automatically copy the contents of
* the pixmap to the texture. * the pixmap to the texture.
* @error: A #CoglError for exceptions * @error: A #GError for exceptions
* *
* Creates one of a pair of textures to contain the contents of @pixmap, * Creates one of a pair of textures to contain the contents of @pixmap,
* which has stereo content. (Different images for the right and left eyes.) * which has stereo content. (Different images for the right and left eyes.)
@ -169,7 +169,7 @@ CoglTexturePixmapX11 *
cogl_texture_pixmap_x11_new_left (CoglContext *context, cogl_texture_pixmap_x11_new_left (CoglContext *context,
uint32_t pixmap, uint32_t pixmap,
gboolean automatic_updates, gboolean automatic_updates,
CoglError **error); GError **error);
/** /**
* cogl_texture_pixmap_x11_new_right: * cogl_texture_pixmap_x11_new_right:

View File

@ -62,19 +62,19 @@ typedef struct _CoglWinsysEGLVtable
{ {
gboolean gboolean
(* display_setup) (CoglDisplay *display, (* display_setup) (CoglDisplay *display,
CoglError **error); GError **error);
void void
(* display_destroy) (CoglDisplay *display); (* display_destroy) (CoglDisplay *display);
gboolean gboolean
(* context_created) (CoglDisplay *display, (* context_created) (CoglDisplay *display,
CoglError **error); GError **error);
void void
(* cleanup_context) (CoglDisplay *display); (* cleanup_context) (CoglDisplay *display);
gboolean gboolean
(* context_init) (CoglContext *context, CoglError **error); (* context_init) (CoglContext *context, GError **error);
void void
(* context_deinit) (CoglContext *context); (* context_deinit) (CoglContext *context);
@ -82,7 +82,7 @@ typedef struct _CoglWinsysEGLVtable
gboolean gboolean
(* onscreen_init) (CoglOnscreen *onscreen, (* onscreen_init) (CoglOnscreen *onscreen,
EGLConfig config, EGLConfig config,
CoglError **error); GError **error);
void void
(* onscreen_deinit) (CoglOnscreen *onscreen); (* onscreen_deinit) (CoglOnscreen *onscreen);
@ -94,7 +94,7 @@ typedef struct _CoglWinsysEGLVtable
(* choose_config) (CoglDisplay *display, (* choose_config) (CoglDisplay *display,
EGLint *attributes, EGLint *attributes,
EGLConfig *out_config, EGLConfig *out_config,
CoglError **error); GError **error);
} CoglWinsysEGLVtable; } CoglWinsysEGLVtable;
typedef enum _CoglEGLWinsysFeature typedef enum _CoglEGLWinsysFeature
@ -207,6 +207,6 @@ _cogl_egl_query_wayland_buffer (CoglContext *ctx,
gboolean gboolean
_cogl_winsys_egl_renderer_connect_common (CoglRenderer *renderer, _cogl_winsys_egl_renderer_connect_common (CoglRenderer *renderer,
CoglError **error); GError **error);
#endif /* __COGL_WINSYS_EGL_PRIVATE_H */ #endif /* __COGL_WINSYS_EGL_PRIVATE_H */

View File

@ -44,7 +44,6 @@
#include "cogl-texture-pixmap-x11-private.h" #include "cogl-texture-pixmap-x11-private.h"
#include "cogl-texture-2d-private.h" #include "cogl-texture-2d-private.h"
#include "cogl-texture-2d.h" #include "cogl-texture-2d.h"
#include "cogl-error-private.h"
#include "cogl-poll-private.h" #include "cogl-poll-private.h"
#include "winsys/cogl-winsys-egl-x11-private.h" #include "winsys/cogl-winsys-egl-x11-private.h"
#include "winsys/cogl-winsys-egl-private.h" #include "winsys/cogl-winsys-egl-private.h"
@ -294,7 +293,7 @@ _cogl_winsys_egl_get_display (void *native)
static gboolean static gboolean
_cogl_winsys_renderer_connect (CoglRenderer *renderer, _cogl_winsys_renderer_connect (CoglRenderer *renderer,
CoglError **error) GError **error)
{ {
CoglRendererEGL *egl_renderer; CoglRendererEGL *egl_renderer;
CoglXlibRenderer *xlib_renderer; CoglXlibRenderer *xlib_renderer;
@ -337,7 +336,7 @@ static gboolean
_cogl_winsys_egl_choose_config (CoglDisplay *display, _cogl_winsys_egl_choose_config (CoglDisplay *display,
EGLint *attributes, EGLint *attributes,
EGLConfig *out_config, EGLConfig *out_config,
CoglError **error) GError **error)
{ {
CoglRenderer *renderer = display->renderer; CoglRenderer *renderer = display->renderer;
CoglRendererEGL *egl_renderer = renderer->winsys; CoglRendererEGL *egl_renderer = renderer->winsys;
@ -350,7 +349,7 @@ _cogl_winsys_egl_choose_config (CoglDisplay *display,
&config_count); &config_count);
if (status != EGL_TRUE || config_count == 0) if (status != EGL_TRUE || config_count == 0)
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_CONTEXT, COGL_WINSYS_ERROR_CREATE_CONTEXT,
"No compatible EGL configs found"); "No compatible EGL configs found");
return FALSE; return FALSE;
@ -361,7 +360,7 @@ _cogl_winsys_egl_choose_config (CoglDisplay *display,
static gboolean static gboolean
_cogl_winsys_egl_display_setup (CoglDisplay *display, _cogl_winsys_egl_display_setup (CoglDisplay *display,
CoglError **error) GError **error)
{ {
CoglDisplayEGL *egl_display = display->winsys; CoglDisplayEGL *egl_display = display->winsys;
CoglDisplayXlib *xlib_display; CoglDisplayXlib *xlib_display;
@ -382,7 +381,7 @@ _cogl_winsys_egl_display_destroy (CoglDisplay *display)
static gboolean static gboolean
_cogl_winsys_egl_context_init (CoglContext *context, _cogl_winsys_egl_context_init (CoglContext *context,
CoglError **error) GError **error)
{ {
cogl_xlib_renderer_add_filter (context->display->renderer, cogl_xlib_renderer_add_filter (context->display->renderer,
event_filter_cb, event_filter_cb,
@ -415,7 +414,7 @@ _cogl_winsys_egl_context_deinit (CoglContext *context)
static gboolean static gboolean
_cogl_winsys_egl_onscreen_init (CoglOnscreen *onscreen, _cogl_winsys_egl_onscreen_init (CoglOnscreen *onscreen,
EGLConfig egl_config, EGLConfig egl_config,
CoglError **error) GError **error)
{ {
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen); CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
CoglContext *context = framebuffer->context; CoglContext *context = framebuffer->context;
@ -456,7 +455,7 @@ _cogl_winsys_egl_onscreen_init (CoglOnscreen *onscreen,
char message[1000]; char message[1000];
XGetErrorText (xlib_renderer->xdpy, xerror, XGetErrorText (xlib_renderer->xdpy, xerror,
message, sizeof (message)); message, sizeof (message));
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_ONSCREEN, COGL_WINSYS_ERROR_CREATE_ONSCREEN,
"Unable to query geometry of foreign " "Unable to query geometry of foreign "
"xid 0x%08lX: %s", "xid 0x%08lX: %s",
@ -491,7 +490,7 @@ _cogl_winsys_egl_onscreen_init (CoglOnscreen *onscreen,
xvisinfo = get_visual_info (display, egl_config); xvisinfo = get_visual_info (display, egl_config);
if (xvisinfo == NULL) if (xvisinfo == NULL)
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_ONSCREEN, COGL_WINSYS_ERROR_CREATE_ONSCREEN,
"Unable to retrieve the X11 visual of context's " "Unable to retrieve the X11 visual of context's "
"fbconfig"); "fbconfig");
@ -533,7 +532,7 @@ _cogl_winsys_egl_onscreen_init (CoglOnscreen *onscreen,
char message[1000]; char message[1000];
XGetErrorText (xlib_renderer->xdpy, xerror, XGetErrorText (xlib_renderer->xdpy, xerror,
message, sizeof (message)); message, sizeof (message));
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_ONSCREEN, COGL_WINSYS_ERROR_CREATE_ONSCREEN,
"X error while creating Window for CoglOnscreen: %s", "X error while creating Window for CoglOnscreen: %s",
message); message);
@ -654,7 +653,7 @@ _cogl_winsys_onscreen_x11_get_window_xid (CoglOnscreen *onscreen)
static gboolean static gboolean
_cogl_winsys_egl_context_created (CoglDisplay *display, _cogl_winsys_egl_context_created (CoglDisplay *display,
CoglError **error) GError **error)
{ {
CoglRenderer *renderer = display->renderer; CoglRenderer *renderer = display->renderer;
CoglDisplayEGL *egl_display = display->winsys; CoglDisplayEGL *egl_display = display->winsys;
@ -727,7 +726,7 @@ _cogl_winsys_egl_context_created (CoglDisplay *display,
return TRUE; return TRUE;
fail: fail:
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_CONTEXT, COGL_WINSYS_ERROR_CREATE_CONTEXT,
"%s", error_message); "%s", error_message);
return FALSE; return FALSE;

View File

@ -42,7 +42,6 @@
#include "cogl-renderer-private.h" #include "cogl-renderer-private.h"
#include "cogl-onscreen-template-private.h" #include "cogl-onscreen-template-private.h"
#include "cogl-gles2-context-private.h" #include "cogl-gles2-context-private.h"
#include "cogl-error-private.h"
#include "cogl-egl.h" #include "cogl-egl.h"
#include "cogl-private.h" #include "cogl-private.h"
#include "winsys/cogl-winsys-egl-private.h" #include "winsys/cogl-winsys-egl-private.h"
@ -201,7 +200,7 @@ check_egl_extensions (CoglRenderer *renderer)
gboolean gboolean
_cogl_winsys_egl_renderer_connect_common (CoglRenderer *renderer, _cogl_winsys_egl_renderer_connect_common (CoglRenderer *renderer,
CoglError **error) GError **error)
{ {
CoglRendererEGL *egl_renderer = renderer->winsys; CoglRendererEGL *egl_renderer = renderer->winsys;
@ -209,7 +208,7 @@ _cogl_winsys_egl_renderer_connect_common (CoglRenderer *renderer,
&egl_renderer->egl_version_major, &egl_renderer->egl_version_major,
&egl_renderer->egl_version_minor)) &egl_renderer->egl_version_minor))
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_INIT, COGL_WINSYS_ERROR_INIT,
"Couldn't initialize EGL"); "Couldn't initialize EGL");
return FALSE; return FALSE;
@ -222,7 +221,7 @@ _cogl_winsys_egl_renderer_connect_common (CoglRenderer *renderer,
static gboolean static gboolean
_cogl_winsys_renderer_connect (CoglRenderer *renderer, _cogl_winsys_renderer_connect (CoglRenderer *renderer,
CoglError **error) GError **error)
{ {
/* This function must be overridden by a platform winsys */ /* This function must be overridden by a platform winsys */
g_assert_not_reached (); g_assert_not_reached ();
@ -346,7 +345,7 @@ cleanup_context (CoglDisplay *display)
static gboolean static gboolean
try_create_context (CoglDisplay *display, try_create_context (CoglDisplay *display,
CoglError **error) GError **error)
{ {
CoglRenderer *renderer = display->renderer; CoglRenderer *renderer = display->renderer;
CoglDisplayEGL *egl_display = display->winsys; CoglDisplayEGL *egl_display = display->winsys;
@ -376,7 +375,7 @@ try_create_context (CoglDisplay *display,
&config, &config,
&config_error)) &config_error))
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_CONTEXT, COGL_WINSYS_ERROR_CREATE_CONTEXT,
"Couldn't choose config: %s", config_error->message); "Couldn't choose config: %s", config_error->message);
g_error_free (config_error); g_error_free (config_error);
@ -451,7 +450,7 @@ try_create_context (CoglDisplay *display,
return TRUE; return TRUE;
fail: fail:
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_CONTEXT, COGL_WINSYS_ERROR_CREATE_CONTEXT,
"%s", error_message); "%s", error_message);
@ -480,7 +479,7 @@ _cogl_winsys_display_destroy (CoglDisplay *display)
static gboolean static gboolean
_cogl_winsys_display_setup (CoglDisplay *display, _cogl_winsys_display_setup (CoglDisplay *display,
CoglError **error) GError **error)
{ {
CoglDisplayEGL *egl_display; CoglDisplayEGL *egl_display;
CoglRenderer *renderer = display->renderer; CoglRenderer *renderer = display->renderer;
@ -520,7 +519,7 @@ error:
} }
static gboolean static gboolean
_cogl_winsys_context_init (CoglContext *context, CoglError **error) _cogl_winsys_context_init (CoglContext *context, GError **error)
{ {
CoglRenderer *renderer = context->display->renderer; CoglRenderer *renderer = context->display->renderer;
CoglDisplayEGL *egl_display = context->display->winsys; CoglDisplayEGL *egl_display = context->display->winsys;
@ -591,7 +590,7 @@ typedef struct _CoglGLES2ContextEGL
} CoglGLES2ContextEGL; } CoglGLES2ContextEGL;
static void * static void *
_cogl_winsys_context_create_gles2_context (CoglContext *ctx, CoglError **error) _cogl_winsys_context_create_gles2_context (CoglContext *ctx, GError **error)
{ {
CoglRendererEGL *egl_renderer = ctx->display->renderer->winsys; CoglRendererEGL *egl_renderer = ctx->display->renderer->winsys;
CoglDisplayEGL *egl_display = ctx->display->winsys; CoglDisplayEGL *egl_display = ctx->display->winsys;
@ -608,7 +607,7 @@ _cogl_winsys_context_create_gles2_context (CoglContext *ctx, CoglError **error)
attribs); attribs);
if (egl_context == EGL_NO_CONTEXT) if (egl_context == EGL_NO_CONTEXT)
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_GLES2_CONTEXT, COGL_WINSYS_ERROR_CREATE_GLES2_CONTEXT,
"%s", get_error_string ()); "%s", get_error_string ());
return NULL; return NULL;
@ -634,7 +633,7 @@ _cogl_winsys_destroy_gles2_context (CoglGLES2Context *gles2_ctx)
static gboolean static gboolean
_cogl_winsys_onscreen_init (CoglOnscreen *onscreen, _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
CoglError **error) GError **error)
{ {
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen); CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
CoglContext *context = framebuffer->context; CoglContext *context = framebuffer->context;
@ -659,7 +658,7 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
&config_count); &config_count);
if (status != EGL_TRUE || config_count == 0) if (status != EGL_TRUE || config_count == 0)
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_ONSCREEN, COGL_WINSYS_ERROR_CREATE_ONSCREEN,
"Failed to find a suitable EGL configuration"); "Failed to find a suitable EGL configuration");
return FALSE; return FALSE;
@ -890,7 +889,7 @@ _cogl_winsys_save_context (CoglContext *ctx)
} }
static gboolean static gboolean
_cogl_winsys_set_gles2_context (CoglGLES2Context *gles2_ctx, CoglError **error) _cogl_winsys_set_gles2_context (CoglGLES2Context *gles2_ctx, GError **error)
{ {
CoglContext *ctx = gles2_ctx->context; CoglContext *ctx = gles2_ctx->context;
CoglDisplayEGL *egl_display = ctx->display->winsys; CoglDisplayEGL *egl_display = ctx->display->winsys;
@ -909,7 +908,7 @@ _cogl_winsys_set_gles2_context (CoglGLES2Context *gles2_ctx, CoglError **error)
if (!status) if (!status)
{ {
_cogl_set_error (error, g_set_error (error,
COGL_WINSYS_ERROR, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_MAKE_CURRENT, COGL_WINSYS_ERROR_MAKE_CURRENT,
"Failed to make gles2 context current"); "Failed to make gles2 context current");

View File

@ -50,7 +50,6 @@
#include "cogl-swap-chain-private.h" #include "cogl-swap-chain-private.h"
#include "cogl-xlib-renderer.h" #include "cogl-xlib-renderer.h"
#include "cogl-util.h" #include "cogl-util.h"
#include "cogl-error-private.h"
#include "cogl-poll-private.h" #include "cogl-poll-private.h"
#include "cogl-version.h" #include "cogl-version.h"
#include "cogl-glx.h" #include "cogl-glx.h"
@ -660,7 +659,7 @@ _cogl_winsys_renderer_outputs_changed (CoglRenderer *renderer)
static gboolean static gboolean
resolve_core_glx_functions (CoglRenderer *renderer, resolve_core_glx_functions (CoglRenderer *renderer,
CoglError **error) GError **error)
{ {
CoglGLXRenderer *glx_renderer; CoglGLXRenderer *glx_renderer;
@ -679,7 +678,7 @@ resolve_core_glx_functions (CoglRenderer *renderer,
!g_module_symbol (glx_renderer->libgl_module, "glXQueryDrawable", !g_module_symbol (glx_renderer->libgl_module, "glXQueryDrawable",
(void **) &glx_renderer->glXQueryDrawable)) (void **) &glx_renderer->glXQueryDrawable))
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error_literal (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_INIT, COGL_WINSYS_ERROR_INIT,
"Failed to resolve required GLX symbol"); "Failed to resolve required GLX symbol");
return FALSE; return FALSE;
@ -753,7 +752,7 @@ update_base_winsys_features (CoglRenderer *renderer)
static gboolean static gboolean
_cogl_winsys_renderer_connect (CoglRenderer *renderer, _cogl_winsys_renderer_connect (CoglRenderer *renderer,
CoglError **error) GError **error)
{ {
CoglGLXRenderer *glx_renderer; CoglGLXRenderer *glx_renderer;
CoglXlibRenderer *xlib_renderer; CoglXlibRenderer *xlib_renderer;
@ -769,7 +768,7 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer,
if (renderer->driver != COGL_DRIVER_GL && if (renderer->driver != COGL_DRIVER_GL &&
renderer->driver != COGL_DRIVER_GL3) renderer->driver != COGL_DRIVER_GL3)
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error_literal (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_INIT, COGL_WINSYS_ERROR_INIT,
"GLX Backend can only be used in conjunction with OpenGL"); "GLX Backend can only be used in conjunction with OpenGL");
goto error; goto error;
@ -780,7 +779,7 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer,
if (glx_renderer->libgl_module == NULL) if (glx_renderer->libgl_module == NULL)
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error_literal (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_INIT, COGL_WINSYS_ERROR_INIT,
"Failed to dynamically open the OpenGL library"); "Failed to dynamically open the OpenGL library");
goto error; goto error;
@ -793,7 +792,7 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer,
&glx_renderer->glx_error_base, &glx_renderer->glx_error_base,
&glx_renderer->glx_event_base)) &glx_renderer->glx_event_base))
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error_literal (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_INIT, COGL_WINSYS_ERROR_INIT,
"XServer appears to lack required GLX support"); "XServer appears to lack required GLX support");
goto error; goto error;
@ -807,7 +806,7 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer,
&glx_renderer->glx_minor) &glx_renderer->glx_minor)
|| !(glx_renderer->glx_major == 1 && glx_renderer->glx_minor >= 2)) || !(glx_renderer->glx_major == 1 && glx_renderer->glx_minor >= 2))
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error_literal (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_INIT, COGL_WINSYS_ERROR_INIT,
"XServer appears to lack required GLX 1.2 support"); "XServer appears to lack required GLX 1.2 support");
goto error; goto error;
@ -825,7 +824,7 @@ error:
} }
static gboolean static gboolean
update_winsys_features (CoglContext *context, CoglError **error) update_winsys_features (CoglContext *context, GError **error)
{ {
CoglGLXDisplay *glx_display = context->display->winsys; CoglGLXDisplay *glx_display = context->display->winsys;
CoglGLXRenderer *glx_renderer = context->display->renderer->winsys; CoglGLXRenderer *glx_renderer = context->display->renderer->winsys;
@ -986,7 +985,7 @@ static gboolean
find_fbconfig (CoglDisplay *display, find_fbconfig (CoglDisplay *display,
CoglFramebufferConfig *config, CoglFramebufferConfig *config,
GLXFBConfig *config_ret, GLXFBConfig *config_ret,
CoglError **error) GError **error)
{ {
CoglXlibRenderer *xlib_renderer = CoglXlibRenderer *xlib_renderer =
_cogl_xlib_renderer_get_data (display->renderer); _cogl_xlib_renderer_get_data (display->renderer);
@ -1006,7 +1005,7 @@ find_fbconfig (CoglDisplay *display,
if (!configs || n_configs == 0) if (!configs || n_configs == 0)
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error_literal (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_CONTEXT, COGL_WINSYS_ERROR_CREATE_CONTEXT,
"Failed to find any compatible fbconfigs"); "Failed to find any compatible fbconfigs");
ret = FALSE; ret = FALSE;
@ -1036,7 +1035,7 @@ find_fbconfig (CoglDisplay *display,
} }
} }
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error_literal (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_CONTEXT, COGL_WINSYS_ERROR_CREATE_CONTEXT,
"Unable to find fbconfig with rgba visual"); "Unable to find fbconfig with rgba visual");
ret = FALSE; ret = FALSE;
@ -1122,7 +1121,7 @@ create_gl3_context (CoglDisplay *display,
} }
static gboolean static gboolean
create_context (CoglDisplay *display, CoglError **error) create_context (CoglDisplay *display, GError **error)
{ {
CoglGLXDisplay *glx_display = display->winsys; CoglGLXDisplay *glx_display = display->winsys;
CoglXlibRenderer *xlib_renderer = CoglXlibRenderer *xlib_renderer =
@ -1131,7 +1130,7 @@ create_context (CoglDisplay *display, CoglError **error)
gboolean support_transparent_windows = gboolean support_transparent_windows =
display->onscreen_template->config.swap_chain->has_alpha; display->onscreen_template->config.swap_chain->has_alpha;
GLXFBConfig config; GLXFBConfig config;
CoglError *fbconfig_error = NULL; GError *fbconfig_error = NULL;
XSetWindowAttributes attrs; XSetWindowAttributes attrs;
XVisualInfo *xvisinfo; XVisualInfo *xvisinfo;
GLXDrawable dummy_drawable; GLXDrawable dummy_drawable;
@ -1144,11 +1143,11 @@ create_context (CoglDisplay *display, CoglError **error)
&fbconfig_error); &fbconfig_error);
if (!glx_display->found_fbconfig) if (!glx_display->found_fbconfig)
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_CONTEXT, COGL_WINSYS_ERROR_CREATE_CONTEXT,
"Unable to find suitable fbconfig for the GLX context: %s", "Unable to find suitable fbconfig for the GLX context: %s",
fbconfig_error->message); fbconfig_error->message);
cogl_error_free (fbconfig_error); g_error_free (fbconfig_error);
return FALSE; return FALSE;
} }
@ -1173,7 +1172,7 @@ create_context (CoglDisplay *display, CoglError **error)
if (_cogl_xlib_renderer_untrap_errors (display->renderer, &old_state) || if (_cogl_xlib_renderer_untrap_errors (display->renderer, &old_state) ||
glx_display->glx_context == NULL) glx_display->glx_context == NULL)
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error_literal (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_CONTEXT, COGL_WINSYS_ERROR_CREATE_CONTEXT,
"Unable to create suitable GL context"); "Unable to create suitable GL context");
return FALSE; return FALSE;
@ -1196,7 +1195,7 @@ create_context (CoglDisplay *display, CoglError **error)
config); config);
if (xvisinfo == NULL) if (xvisinfo == NULL)
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error_literal (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_CONTEXT, COGL_WINSYS_ERROR_CREATE_CONTEXT,
"Unable to retrieve the X11 visual"); "Unable to retrieve the X11 visual");
return FALSE; return FALSE;
@ -1251,7 +1250,7 @@ create_context (CoglDisplay *display, CoglError **error)
if (_cogl_xlib_renderer_untrap_errors (display->renderer, &old_state)) if (_cogl_xlib_renderer_untrap_errors (display->renderer, &old_state))
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error_literal (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_CONTEXT, COGL_WINSYS_ERROR_CREATE_CONTEXT,
"Unable to select the newly created GLX context"); "Unable to select the newly created GLX context");
return FALSE; return FALSE;
@ -1298,7 +1297,7 @@ _cogl_winsys_display_destroy (CoglDisplay *display)
static gboolean static gboolean
_cogl_winsys_display_setup (CoglDisplay *display, _cogl_winsys_display_setup (CoglDisplay *display,
CoglError **error) GError **error)
{ {
CoglGLXDisplay *glx_display; CoglGLXDisplay *glx_display;
int i; int i;
@ -1322,7 +1321,7 @@ error:
} }
static gboolean static gboolean
_cogl_winsys_context_init (CoglContext *context, CoglError **error) _cogl_winsys_context_init (CoglContext *context, GError **error)
{ {
context->winsys = g_new0 (CoglContextGLX, 1); context->winsys = g_new0 (CoglContextGLX, 1);
@ -1343,7 +1342,7 @@ _cogl_winsys_context_deinit (CoglContext *context)
static gboolean static gboolean
_cogl_winsys_onscreen_init (CoglOnscreen *onscreen, _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
CoglError **error) GError **error)
{ {
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen); CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
CoglContext *context = framebuffer->context; CoglContext *context = framebuffer->context;
@ -1356,7 +1355,7 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
CoglOnscreenXlib *xlib_onscreen; CoglOnscreenXlib *xlib_onscreen;
CoglOnscreenGLX *glx_onscreen; CoglOnscreenGLX *glx_onscreen;
GLXFBConfig fbconfig; GLXFBConfig fbconfig;
CoglError *fbconfig_error = NULL; GError *fbconfig_error = NULL;
g_return_val_if_fail (glx_display->glx_context, FALSE); g_return_val_if_fail (glx_display->glx_context, FALSE);
@ -1364,11 +1363,11 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
&fbconfig, &fbconfig,
&fbconfig_error)) &fbconfig_error))
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_CONTEXT, COGL_WINSYS_ERROR_CREATE_CONTEXT,
"Unable to find suitable fbconfig for the GLX context: %s", "Unable to find suitable fbconfig for the GLX context: %s",
fbconfig_error->message); fbconfig_error->message);
cogl_error_free (fbconfig_error); g_error_free (fbconfig_error);
return FALSE; return FALSE;
} }
@ -1412,7 +1411,7 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
{ {
char message[1000]; char message[1000];
XGetErrorText (xlib_renderer->xdpy, xerror, message, sizeof(message)); XGetErrorText (xlib_renderer->xdpy, xerror, message, sizeof(message));
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_ONSCREEN, COGL_WINSYS_ERROR_CREATE_ONSCREEN,
"Unable to query geometry of foreign xid 0x%08lX: %s", "Unable to query geometry of foreign xid 0x%08lX: %s",
xwin, message); xwin, message);
@ -1446,7 +1445,7 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
fbconfig); fbconfig);
if (xvisinfo == NULL) if (xvisinfo == NULL)
{ {
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error_literal (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_ONSCREEN, COGL_WINSYS_ERROR_CREATE_ONSCREEN,
"Unable to retrieve the X11 visual of context's " "Unable to retrieve the X11 visual of context's "
"fbconfig"); "fbconfig");
@ -1485,7 +1484,7 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
char message[1000]; char message[1000];
XGetErrorText (xlib_renderer->xdpy, xerror, XGetErrorText (xlib_renderer->xdpy, xerror,
message, sizeof (message)); message, sizeof (message));
_cogl_set_error (error, COGL_WINSYS_ERROR, g_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_ONSCREEN, COGL_WINSYS_ERROR_CREATE_ONSCREEN,
"X error while creating Window for CoglOnscreen: %s", "X error while creating Window for CoglOnscreen: %s",
message); message);
@ -1688,8 +1687,7 @@ _cogl_winsys_onscreen_bind (CoglOnscreen *onscreen)
XSync (xlib_renderer->xdpy, False); XSync (xlib_renderer->xdpy, False);
/* FIXME: We should be reporting a CoglError here /* FIXME: We should be reporting a GError here */
*/
if (_cogl_xlib_renderer_untrap_errors (context->display->renderer, if (_cogl_xlib_renderer_untrap_errors (context->display->renderer,
&old_state)) &old_state))
{ {
@ -2757,7 +2755,7 @@ _cogl_winsys_texture_pixmap_x11_update (CoglTexturePixmapX11 *tex_pixmap,
if (texture_info->glx_tex == NULL) if (texture_info->glx_tex == NULL)
{ {
CoglPixelFormat texture_format; CoglPixelFormat texture_format;
CoglError *error = NULL; GError *error = NULL;
texture_format = (tex_pixmap->depth >= 32 ? texture_format = (tex_pixmap->depth >= 32 ?
COGL_PIXEL_FORMAT_RGBA_8888_PRE : COGL_PIXEL_FORMAT_RGBA_8888_PRE :
@ -2775,7 +2773,7 @@ _cogl_winsys_texture_pixmap_x11_update (CoglTexturePixmapX11 *tex_pixmap,
COGL_NOTE (TEXTURE_PIXMAP, "Falling back for %p because a " COGL_NOTE (TEXTURE_PIXMAP, "Falling back for %p because a "
"texture 2d could not be created: %s", "texture 2d could not be created: %s",
tex_pixmap, error->message); tex_pixmap, error->message);
cogl_error_free (error); g_error_free (error);
free_glx_pixmap (ctx, glx_tex_pixmap); free_glx_pixmap (ctx, glx_tex_pixmap);
return FALSE; return FALSE;
} }

View File

@ -79,7 +79,7 @@ typedef struct _CoglWinsysVtable
gboolean in_core); gboolean in_core);
gboolean gboolean
(*renderer_connect) (CoglRenderer *renderer, CoglError **error); (*renderer_connect) (CoglRenderer *renderer, GError **error);
void void
(*renderer_disconnect) (CoglRenderer *renderer); (*renderer_disconnect) (CoglRenderer *renderer);
@ -88,22 +88,22 @@ typedef struct _CoglWinsysVtable
(*renderer_outputs_changed) (CoglRenderer *renderer); (*renderer_outputs_changed) (CoglRenderer *renderer);
gboolean gboolean
(*display_setup) (CoglDisplay *display, CoglError **error); (*display_setup) (CoglDisplay *display, GError **error);
void void
(*display_destroy) (CoglDisplay *display); (*display_destroy) (CoglDisplay *display);
gboolean gboolean
(*context_init) (CoglContext *context, CoglError **error); (*context_init) (CoglContext *context, GError **error);
void void
(*context_deinit) (CoglContext *context); (*context_deinit) (CoglContext *context);
void * void *
(*context_create_gles2_context) (CoglContext *ctx, CoglError **error); (*context_create_gles2_context) (CoglContext *ctx, GError **error);
gboolean gboolean
(*onscreen_init) (CoglOnscreen *onscreen, CoglError **error); (*onscreen_init) (CoglOnscreen *onscreen, GError **error);
void void
(*onscreen_deinit) (CoglOnscreen *onscreen); (*onscreen_deinit) (CoglOnscreen *onscreen);
@ -162,7 +162,7 @@ typedef struct _CoglWinsysVtable
(*save_context) (CoglContext *ctx); (*save_context) (CoglContext *ctx);
gboolean gboolean
(*set_gles2_context) (CoglGLES2Context *gles2_ctx, CoglError **error); (*set_gles2_context) (CoglGLES2Context *gles2_ctx, GError **error);
void void
(*restore_context) (CoglContext *ctx); (*restore_context) (CoglContext *ctx);

View File

@ -80,7 +80,7 @@ _cogl_winsys_renderer_disconnect (CoglRenderer *renderer)
static gboolean static gboolean
_cogl_winsys_renderer_connect (CoglRenderer *renderer, _cogl_winsys_renderer_connect (CoglRenderer *renderer,
CoglError **error) GError **error)
{ {
renderer->winsys = &_cogl_winsys_stub_dummy_ptr; renderer->winsys = &_cogl_winsys_stub_dummy_ptr;
return TRUE; return TRUE;
@ -94,14 +94,14 @@ _cogl_winsys_display_destroy (CoglDisplay *display)
static gboolean static gboolean
_cogl_winsys_display_setup (CoglDisplay *display, _cogl_winsys_display_setup (CoglDisplay *display,
CoglError **error) GError **error)
{ {
display->winsys = &_cogl_winsys_stub_dummy_ptr; display->winsys = &_cogl_winsys_stub_dummy_ptr;
return TRUE; return TRUE;
} }
static gboolean static gboolean
_cogl_winsys_context_init (CoglContext *context, CoglError **error) _cogl_winsys_context_init (CoglContext *context, GError **error)
{ {
context->winsys = &_cogl_winsys_stub_dummy_ptr; context->winsys = &_cogl_winsys_stub_dummy_ptr;
@ -121,7 +121,7 @@ _cogl_winsys_context_deinit (CoglContext *context)
static gboolean static gboolean
_cogl_winsys_onscreen_init (CoglOnscreen *onscreen, _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
CoglError **error) GError **error)
{ {
return TRUE; return TRUE;
} }

View File

@ -106,7 +106,7 @@ test_utils_init (TestFlags requirement_flags,
TestFlags known_failure_flags) TestFlags known_failure_flags)
{ {
static int counter = 0; static int counter = 0;
CoglError *error = NULL; GError *error = NULL;
CoglOnscreen *onscreen = NULL; CoglOnscreen *onscreen = NULL;
CoglDisplay *display; CoglDisplay *display;
CoglRenderer *renderer; CoglRenderer *renderer;
@ -347,7 +347,7 @@ test_utils_texture_new_with_size (CoglContext *ctx,
CoglTextureComponents components) CoglTextureComponents components)
{ {
CoglTexture *tex; CoglTexture *tex;
CoglError *skip_error = NULL; GError *skip_error = NULL;
/* First try creating a fast-path non-sliced texture */ /* First try creating a fast-path non-sliced texture */
tex = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, width, height)); tex = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, width, height));
@ -356,7 +356,7 @@ test_utils_texture_new_with_size (CoglContext *ctx,
if (!cogl_texture_allocate (tex, &skip_error)) if (!cogl_texture_allocate (tex, &skip_error))
{ {
cogl_error_free (skip_error); g_error_free (skip_error);
cogl_object_unref (tex); cogl_object_unref (tex);
tex = NULL; tex = NULL;
} }
@ -402,7 +402,7 @@ test_utils_texture_new_from_bitmap (CoglBitmap *bitmap,
{ {
CoglAtlasTexture *atlas_tex; CoglAtlasTexture *atlas_tex;
CoglTexture *tex; CoglTexture *tex;
CoglError *internal_error = NULL; GError *internal_error = NULL;
if (!flags) if (!flags)
{ {
@ -414,17 +414,17 @@ test_utils_texture_new_from_bitmap (CoglBitmap *bitmap,
if (cogl_texture_allocate (COGL_TEXTURE (atlas_tex), &internal_error)) if (cogl_texture_allocate (COGL_TEXTURE (atlas_tex), &internal_error))
return COGL_TEXTURE (atlas_tex); return COGL_TEXTURE (atlas_tex);
cogl_error_free (internal_error);
cogl_object_unref (atlas_tex); cogl_object_unref (atlas_tex);
internal_error = NULL;
} }
g_clear_error (&internal_error);
/* If that doesn't work try a fast path 2D texture */ /* If that doesn't work try a fast path 2D texture */
tex = COGL_TEXTURE (cogl_texture_2d_new_from_bitmap (bitmap)); tex = COGL_TEXTURE (cogl_texture_2d_new_from_bitmap (bitmap));
cogl_texture_set_premultiplied (tex, premultiplied); cogl_texture_set_premultiplied (tex, premultiplied);
if (cogl_error_matches (internal_error, if (g_error_matches (internal_error,
COGL_SYSTEM_ERROR, COGL_SYSTEM_ERROR,
COGL_SYSTEM_ERROR_NO_MEMORY)) COGL_SYSTEM_ERROR_NO_MEMORY))
{ {
@ -432,11 +432,7 @@ test_utils_texture_new_from_bitmap (CoglBitmap *bitmap,
return NULL; return NULL;
} }
if (!tex) g_clear_error (&internal_error);
{
cogl_error_free (internal_error);
internal_error = NULL;
}
if (!tex) if (!tex)
{ {

View File

@ -112,7 +112,7 @@ test_utils_texture_new_with_size (CoglContext *ctx,
* @rowstride: the memory offset in bytes between the starts of * @rowstride: the memory offset in bytes between the starts of
* scanlines in @data * scanlines in @data
* @data: pointer the memory region where the source buffer resides * @data: pointer the memory region where the source buffer resides
* @error: A #CoglError to catch exceptional errors or %NULL * @error: A #GError to catch exceptional errors or %NULL
* *
* Creates a new #CoglTexture based on data residing in memory. * Creates a new #CoglTexture based on data residing in memory.
* *

View File

@ -56,7 +56,7 @@ test_blend_paint (TestState *state,
CoglHandle material; CoglHandle material;
CoglPipeline *pipeline; CoglPipeline *pipeline;
gboolean status; gboolean status;
CoglError *error = NULL; GError *error = NULL;
int y_off; int y_off;
int x_off; int x_off;
@ -231,7 +231,7 @@ test_tex_combine (TestState *state,
CoglHandle material; CoglHandle material;
gboolean status; gboolean status;
CoglError *error = NULL; GError *error = NULL;
int y_off; int y_off;
int x_off; int x_off;

View File

@ -22,7 +22,7 @@ test_push_pop_single_context (void)
CoglPipeline *pipeline; CoglPipeline *pipeline;
CoglGLES2Context *gles2_ctx; CoglGLES2Context *gles2_ctx;
const CoglGLES2Vtable *gles2; const CoglGLES2Vtable *gles2;
CoglError *error = NULL; GError *error = NULL;
offscreen_texture = offscreen_texture =
cogl_texture_2d_new_with_size (test_ctx, cogl_texture_2d_new_with_size (test_ctx,
@ -145,7 +145,7 @@ create_gles2_context (CoglTexture **offscreen_texture,
CoglGLES2Context **gles2_ctx, CoglGLES2Context **gles2_ctx,
const CoglGLES2Vtable **gles2) const CoglGLES2Vtable **gles2)
{ {
CoglError *error = NULL; GError *error = NULL;
*offscreen_texture = *offscreen_texture =
cogl_texture_2d_new_with_size (test_ctx, cogl_texture_2d_new_with_size (test_ctx,
@ -176,7 +176,7 @@ test_push_pop_multi_context (void)
CoglPipeline *pipeline1; CoglPipeline *pipeline1;
CoglGLES2Context *gles2_ctx1; CoglGLES2Context *gles2_ctx1;
const CoglGLES2Vtable *gles21; const CoglGLES2Vtable *gles21;
CoglError *error = NULL; GError *error = NULL;
create_gles2_context (&offscreen_texture0, create_gles2_context (&offscreen_texture0,
&offscreen0, &offscreen0,
@ -275,7 +275,7 @@ test_gles2_read_pixels (void)
CoglPipeline *pipeline; CoglPipeline *pipeline;
CoglGLES2Context *gles2_ctx; CoglGLES2Context *gles2_ctx;
const CoglGLES2Vtable *gles2; const CoglGLES2Vtable *gles2;
CoglError *error = NULL; GError *error = NULL;
GLubyte pixel[4]; GLubyte pixel[4];
GLuint fbo_handle; GLuint fbo_handle;
@ -671,7 +671,7 @@ test_gles2_context_fbo (void)
CoglPipeline *pipeline; CoglPipeline *pipeline;
CoglGLES2Context *gles2_ctx; CoglGLES2Context *gles2_ctx;
GLuint program; GLuint program;
CoglError *error = NULL; GError *error = NULL;
create_gles2_context (&offscreen_texture, create_gles2_context (&offscreen_texture,
&offscreen, &offscreen,
@ -801,7 +801,7 @@ test_gles2_context_copy_tex_image (void)
CoglPipeline *pipeline; CoglPipeline *pipeline;
CoglGLES2Context *gles2_ctx; CoglGLES2Context *gles2_ctx;
const CoglGLES2Vtable *gles2; const CoglGLES2Vtable *gles2;
CoglError *error = NULL; GError *error = NULL;
GLuint tex; GLuint tex;
GLint tex_uniform_location; GLint tex_uniform_location;
GLint pos_location; GLint pos_location;

View File

@ -33,7 +33,7 @@ paint_legacy (TestState *state)
CoglHandle material = cogl_material_new (); CoglHandle material = cogl_material_new ();
CoglTexture *tex; CoglTexture *tex;
CoglColor color; CoglColor color;
CoglError *error = NULL; GError *error = NULL;
CoglHandle shader, program; CoglHandle shader, program;
cogl_color_init_from_4ub (&color, 0, 0, 0, 255); cogl_color_init_from_4ub (&color, 0, 0, 0, 255);
@ -103,7 +103,7 @@ paint (TestState *state)
CoglPipeline *pipeline = cogl_pipeline_new (test_ctx); CoglPipeline *pipeline = cogl_pipeline_new (test_ctx);
CoglTexture *tex; CoglTexture *tex;
CoglColor color; CoglColor color;
CoglError *error = NULL; GError *error = NULL;
CoglHandle shader, program; CoglHandle shader, program;
cogl_color_init_from_4ub (&color, 0, 0, 0, 255); cogl_color_init_from_4ub (&color, 0, 0, 0, 255);

View File

@ -104,7 +104,7 @@ on_paint (ClutterActor *actor, TestState *state)
CoglHandle tex0, tex1; CoglHandle tex0, tex1;
CoglHandle material; CoglHandle material;
gboolean status; gboolean status;
CoglError *error = NULL; GError *error = NULL;
float tex_coords[] = { float tex_coords[] = {
0, 0, 0.5, 0.5, /* tex0 */ 0, 0, 0.5, 0.5, /* tex0 */
0.5, 0.5, 1, 1 /* tex1 */ 0.5, 0.5, 1, 1 /* tex1 */

View File

@ -55,7 +55,7 @@ paint (TestState *state)
CoglTexture *tex0, *tex1; CoglTexture *tex0, *tex1;
CoglPipeline *pipeline; CoglPipeline *pipeline;
CoglMatrix matrix; CoglMatrix matrix;
CoglError *error = NULL; GError *error = NULL;
cogl_framebuffer_orthographic (test_fb, cogl_framebuffer_orthographic (test_fb,
0, 0, 0, 0,

View File

@ -26,7 +26,7 @@ do_test (gboolean check_orientation,
int fb_width = cogl_framebuffer_get_width (test_fb); int fb_width = cogl_framebuffer_get_width (test_fb);
int fb_height = cogl_framebuffer_get_height (test_fb); int fb_height = cogl_framebuffer_get_height (test_fb);
CoglPrimitive *prim; CoglPrimitive *prim;
CoglError *error = NULL; GError *error = NULL;
CoglTexture2D *tex_2d; CoglTexture2D *tex_2d;
CoglPipeline *pipeline, *solid_pipeline; CoglPipeline *pipeline, *solid_pipeline;
int tex_height; int tex_height;

View File

@ -44,7 +44,7 @@ test_texture_no_allocate (void)
* crash */ * crash */
if (texture == NULL) if (texture == NULL)
cogl_error_free (error); g_error_free (error);
else else
cogl_object_unref (texture); cogl_object_unref (texture);

View File

@ -123,7 +123,7 @@ load_from_current_xcursor_image (MetaCursorSpriteXcursor *sprite_xcursor)
ClutterBackend *clutter_backend; ClutterBackend *clutter_backend;
CoglContext *cogl_context; CoglContext *cogl_context;
CoglTexture2D *texture; CoglTexture2D *texture;
CoglError *error = NULL; GError *error = NULL;
g_assert (!meta_cursor_sprite_get_cogl_texture (sprite)); g_assert (!meta_cursor_sprite_get_cogl_texture (sprite));
@ -149,7 +149,7 @@ load_from_current_xcursor_image (MetaCursorSpriteXcursor *sprite_xcursor)
if (!texture) if (!texture)
{ {
g_warning ("Failed to allocate cursor texture: %s\n", error->message); g_warning ("Failed to allocate cursor texture: %s\n", error->message);
cogl_error_free (error); g_error_free (error);
} }
meta_cursor_sprite_set_texture (sprite, meta_cursor_sprite_set_texture (sprite,

View File

@ -100,10 +100,10 @@ meta_create_texture (int width,
/* To find out if we need to slice the texture, we have to go ahead and force storage /* To find out if we need to slice the texture, we have to go ahead and force storage
* to be allocated * to be allocated
*/ */
CoglError *catch_error = NULL; GError *catch_error = NULL;
if (!cogl_texture_allocate (texture, &catch_error)) if (!cogl_texture_allocate (texture, &catch_error))
{ {
cogl_error_free (catch_error); g_error_free (catch_error);
cogl_object_unref (texture); cogl_object_unref (texture);
texture = COGL_TEXTURE (cogl_texture_2d_sliced_new_with_size (ctx, width, height, COGL_TEXTURE_MAX_WASTE)); texture = COGL_TEXTURE (cogl_texture_2d_sliced_new_with_size (ctx, width, height, COGL_TEXTURE_MAX_WASTE));
cogl_texture_set_components (texture, components); cogl_texture_set_components (texture, components);

View File

@ -156,7 +156,7 @@ file_loaded (GObject *source_object,
{ {
MetaBackgroundImage *image = META_BACKGROUND_IMAGE (source_object); MetaBackgroundImage *image = META_BACKGROUND_IMAGE (source_object);
GError *error = NULL; GError *error = NULL;
CoglError *catch_error = NULL; GError *catch_error = NULL;
GTask *task; GTask *task;
CoglTexture *texture; CoglTexture *texture;
GdkPixbuf *pixbuf, *rotated; GdkPixbuf *pixbuf, *rotated;
@ -201,7 +201,7 @@ file_loaded (GObject *source_object,
&catch_error)) &catch_error))
{ {
g_warning ("Failed to create texture for background"); g_warning ("Failed to create texture for background");
cogl_error_free (catch_error); g_error_free (catch_error);
cogl_object_unref (texture); cogl_object_unref (texture);
} }

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