[cogl/wip/standalone: 5/6] error: Merge CoglError into CoglRendererError



commit 44df1ac9653da2722fd4d68996bf3e511ef95f93
Author: Damien Lespiau <damien lespiau intel com>
Date:   Wed Feb 22 19:07:42 2012 +0000

    error: Merge CoglError into CoglRendererError
    
    We want to rename GError to CoglError and this conflicts with an
    existing CoglError domain. Also, it'll be nice to not have a global
    domain error for Cogl as it encourages lazyness to add whatever error in
    there.
    
    This is an (experimental) API change as we just removed the CoglError
    GError domain.

 cogl/cogl-pipeline-layer-state.c |    4 +-
 cogl/cogl-pipeline-state.c       |    4 +-
 cogl/cogl-texture-2d-sliced.c    |    4 +-
 cogl/cogl-texture-3d.c           |   12 +++---
 cogl/cogl-types.h                |   76 +++++++++++++++++--------------------
 5 files changed, 48 insertions(+), 52 deletions(-)
---
diff --git a/cogl/cogl-pipeline-layer-state.c b/cogl/cogl-pipeline-layer-state.c
index 4540dc6..910215a 100644
--- a/cogl/cogl-pipeline-layer-state.c
+++ b/cogl/cogl-pipeline-layer-state.c
@@ -711,7 +711,9 @@ cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
     {
       if (error)
         {
-          g_set_error (error, COGL_ERROR, COGL_ERROR_UNSUPPORTED,
+          g_set_error (error,
+                       COGL_RENDERER_ERROR,
+                       COGL_RENDERER_ERROR_UNSUPPORTED,
                        "Point sprite texture coordinates are enabled "
                        "for a layer but the GL driver does not support it.");
         }
diff --git a/cogl/cogl-pipeline-state.c b/cogl/cogl-pipeline-state.c
index a79494a..313e57f 100644
--- a/cogl/cogl-pipeline-state.c
+++ b/cogl/cogl-pipeline-state.c
@@ -1187,8 +1187,8 @@ cogl_pipeline_set_depth_state (CoglPipeline *pipeline,
        depth_state->range_far != 1))
     {
       g_set_error (error,
-                   COGL_ERROR,
-                   COGL_ERROR_UNSUPPORTED,
+                   COGL_RENDERER_ERROR,
+                   COGL_RENDERER_ERROR_UNSUPPORTED,
                    "glDepthRange not available on GLES 1");
       return FALSE;
     }
diff --git a/cogl/cogl-texture-2d-sliced.c b/cogl/cogl-texture-2d-sliced.c
index 7a01df7..1ec9ed4 100644
--- a/cogl/cogl-texture-2d-sliced.c
+++ b/cogl/cogl-texture-2d-sliced.c
@@ -859,8 +859,8 @@ cogl_texture_2d_sliced_new_with_size (CoglContext *ctx,
     {
       _cogl_texture_2d_sliced_free (tex_2ds);
       g_set_error (error,
-                   COGL_ERROR,
-                   COGL_ERROR_NO_MEMORY,
+                   COGL_RENDERER_ERROR,
+                   COGL_RENDERER_ERROR_NO_MEMORY,
                    "Not enough memory to allocate texture slices");
       return NULL;
     }
diff --git a/cogl/cogl-texture-3d.c b/cogl/cogl-texture-3d.c
index ee80d62..46a1172 100644
--- a/cogl/cogl-texture-3d.c
+++ b/cogl/cogl-texture-3d.c
@@ -146,8 +146,8 @@ _cogl_texture_3d_can_create (CoglContext *ctx,
   if (!cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_3D))
     {
       g_set_error (error,
-                   COGL_ERROR,
-                   COGL_ERROR_UNSUPPORTED,
+                   COGL_RENDERER_ERROR,
+                   COGL_RENDERER_ERROR_UNSUPPORTED,
                    "3D textures are not supported by the GPU");
       return FALSE;
     }
@@ -160,8 +160,8 @@ _cogl_texture_3d_can_create (CoglContext *ctx,
        !_cogl_util_is_pot (depth)))
     {
       g_set_error (error,
-                   COGL_ERROR,
-                   COGL_ERROR_UNSUPPORTED,
+                   COGL_RENDERER_ERROR,
+                   COGL_RENDERER_ERROR_UNSUPPORTED,
                    "A non-power-of-two size was requested but this is not "
                    "supported by the GPU");
       return FALSE;
@@ -181,8 +181,8 @@ _cogl_texture_3d_can_create (CoglContext *ctx,
                                                depth))
     {
       g_set_error (error,
-                   COGL_ERROR,
-                   COGL_ERROR_UNSUPPORTED,
+                   COGL_RENDERER_ERROR,
+                   COGL_RENDERER_ERROR_UNSUPPORTED,
                    "The requested dimensions are not supported by the GPU");
       return FALSE;
     }
diff --git a/cogl/cogl-types.h b/cogl/cogl-types.h
index fea2aec..0bb18b5 100644
--- a/cogl/cogl-types.h
+++ b/cogl/cogl-types.h
@@ -543,46 +543,6 @@ typedef enum { /*< prefix=COGL_BLEND_STRING_ERROR >*/
 GQuark
 cogl_blend_string_error_quark (void);
 
-#define COGL_ERROR (_cogl_error_quark ())
-
-/**
- * CoglError:
- * @COGL_ERROR_UNSUPPORTED: You tried to use a feature or
- *    configuration not currently available.
- * @COGL_ERROR_NO_MEMORY: You tried to allocate a resource
- *    such as a texture and there wasn't enough memory.
- *
- * Error enumeration for Cogl
- *
- * The @COGL_ERROR_UNSUPPORTED error can be thrown for a variety of
- * reasons. For example:
- *
- * <itemizedlist>
- *  <listitem><para>You've tried to use a feature that is not
- *   advertised by cogl_get_features(). This could happen if you create
- *   a 2d texture with a non-power-of-two size when
- *   %COGL_FEATURE_TEXTURE_NPOT is not advertised.</para></listitem>
- *  <listitem><para>The GPU can not handle the configuration you have
- *   requested. An example might be if you try to use too many texture
- *   layers in a single #CoglPipeline</para></listitem>
- *  <listitem><para>The driver does not support some
- *   configuration.</para></listiem>
- * </itemizedlist>
- *
- * Currently this is only used by Cogl API marked as experimental so
- * this enum should also be considered experimental.
- *
- * Since: 1.4
- * Stability: unstable
- */
-typedef enum { /*< prefix=COGL_ERROR >*/
-  COGL_ERROR_UNSUPPORTED,
-  COGL_ERROR_NO_MEMORY
-} CoglError;
-
-GQuark
-_cogl_error_quark (void);
-
 /**
  * CoglAttributeType:
  * @COGL_ATTRIBUTE_TYPE_BYTE: Data is the same size of a byte
@@ -696,8 +656,42 @@ typedef enum
 } CoglDepthTestFunction;
 /* NB: The above definitions are taken from gl.h equivalents */
 
+/**
+ * CoglRendererError:
+ * @COGL_RENDERER_ERROR_UNSUPPORTED: You tried to use a feature or
+ *    configuration not currently available.
+ * @COGL_RENDERER_ERROR_NO_MEMORY: You tried to allocate a resource
+ *    such as a texture and there wasn't enough memory.
+ * @COGL_RENDERER_ERROR_XLIB_DISPLAY_OPEN: You tried to use a X server
+ *    but cogl wasn't able to establish a connection.
+ *
+ * Error enumeration for Cogl
+ *
+ * The @COGL_RENDERER_ERROR_UNSUPPORTED error can be thrown for a variety of
+ * reasons. For example:
+ *
+ * <itemizedlist>
+ *  <listitem><para>You've tried to use a feature that is not
+ *   advertised by cogl_get_features(). This could happen if you create
+ *   a 2d texture with a non-power-of-two size when
+ *   %COGL_FEATURE_TEXTURE_NPOT is not advertised.</para></listitem>
+ *  <listitem><para>The GPU can not handle the configuration you have
+ *   requested. An example might be if you try to use too many texture
+ *   layers in a single #CoglPipeline</para></listitem>
+ *  <listitem><para>The driver does not support some
+ *   configuration.</para></listiem>
+ * </itemizedlist>
+ *
+ * Currently this is only used by Cogl API marked as experimental so
+ * this enum should also be considered experimental.
+ *
+ * Since: 1.10
+ * Stability: unstable
+ */
 typedef enum { /*< prefix=COGL_RENDERER_ERROR >*/
-  COGL_RENDERER_ERROR_XLIB_DISPLAY_OPEN
+  COGL_RENDERER_ERROR_UNSUPPORTED,
+  COGL_RENDERER_ERROR_XLIB_DISPLAY_OPEN,
+  COGL_RENDERER_ERROR_NO_MEMORY
 } CoglRendererError;
 
 /*



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]