[Cogl] [PATCH] Remove all experimental API guards

Robert Bragg robert at sixbynine.org
Tue Aug 28 08:53:19 PDT 2012


From: Robert Bragg <robert at linux.intel.com>

This promotes all api marked as experimental into the 2.0 API by
removing all the #ifdef COGL_ENABLE_EXPERIMENTAL[_2_0]_API guards.
---
 cogl/cogl-bitmap.h                    |    4 ----
 cogl/cogl-context.h                   |    8 --------
 cogl/cogl-framebuffer.h               |   14 +-------------
 cogl/cogl-matrix.h                    |   14 --------------
 cogl/cogl-object.h                    |    4 ----
 cogl/cogl-pango.h                     |    5 -----
 cogl/cogl-pipeline-layer-state.h      |    4 ----
 cogl/cogl-pipeline-state.h            |    4 ----
 cogl/cogl-pipeline.h                  |    4 ----
 cogl/cogl-texture.h                   |    5 -----
 cogl/cogl.h                           |   19 ++-----------------
 cogl/winsys/cogl-texture-pixmap-x11.h |    4 ----
 examples/android/hello/jni/Android.mk |    1 -
 13 files changed, 3 insertions(+), 87 deletions(-)

diff --git a/cogl/cogl-bitmap.h b/cogl/cogl-bitmap.h
index 574f508..e54ac31 100644
--- a/cogl/cogl-bitmap.h
+++ b/cogl/cogl-bitmap.h
@@ -93,8 +93,6 @@ cogl_android_bitmap_new_from_asset (CoglContext *context,
                                     GError **error);
 #endif
 
-#if defined (COGL_ENABLE_EXPERIMENTAL_API)
-
 /**
  * cogl_bitmap_new_from_buffer:
  * @buffer: A #CoglBuffer containing image data
@@ -245,8 +243,6 @@ cogl_bitmap_get_rowstride (CoglBitmap *bitmap);
 CoglPixelBuffer *
 cogl_bitmap_get_buffer (CoglBitmap *bitmap);
 
-#endif /* COGL_ENABLE_EXPERIMENTAL_API */
-
 /**
  * cogl_bitmap_get_size_from_file:
  * @filename: the file to check
diff --git a/cogl/cogl-context.h b/cogl/cogl-context.h
index 719b6ca..17a04c9 100644
--- a/cogl/cogl-context.h
+++ b/cogl/cogl-context.h
@@ -68,8 +68,6 @@ G_BEGIN_DECLS
  * what state other components have left you with.
  */
 
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
-
 #define COGL_CONTEXT(OBJECT) ((CoglContext *)OBJECT)
 
 /**
@@ -138,8 +136,6 @@ cogl_android_set_native_window (ANativeWindow *window);
 CoglBool
 cogl_is_context (void *object);
 
-#endif /* COGL_ENABLE_EXPERIMENTAL_2_0_API */
-
 /* XXX: not guarded by the EXPERIMENTAL_API defines to avoid
  * upsetting glib-mkenums, but this can still be considered implicitly
  * experimental since it's only useable with experimental API... */
@@ -222,8 +218,6 @@ typedef enum _CoglFeatureID
 } CoglFeatureID;
 
 
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
-
 /**
  * cogl_has_feature:
  * @context: A #CoglContext pointer
@@ -295,8 +289,6 @@ cogl_foreach_feature (CoglContext *context,
                       CoglFeatureCallback callback,
                       void *user_data);
 
-#endif /* COGL_ENABLE_EXPERIMENTAL_API */
-
 G_END_DECLS
 
 #endif /* __COGL_CONTEXT_H__ */
diff --git a/cogl/cogl-framebuffer.h b/cogl/cogl-framebuffer.h
index 43fc8d5..6869be7 100644
--- a/cogl/cogl-framebuffer.h
+++ b/cogl/cogl-framebuffer.h
@@ -38,10 +38,9 @@
 #include <cogl/cogl-pipeline.h>
 #include <cogl/cogl-indices.h>
 #include <cogl/cogl-bitmap.h>
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
+#include <cogl/cogl-texture.h>
 #include <cogl/cogl-quaternion.h>
 #include <cogl/cogl-euler.h>
-#endif
 
 G_BEGIN_DECLS
 
@@ -85,8 +84,6 @@ G_BEGIN_DECLS
 
 typedef struct _CoglFramebuffer CoglFramebuffer;
 
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
-
 #define COGL_FRAMEBUFFER(X) ((CoglFramebuffer *)(X))
 
 /**
@@ -346,8 +343,6 @@ cogl_framebuffer_rotate (CoglFramebuffer *framebuffer,
                          float y,
                          float z);
 
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
-
 /**
  * cogl_framebuffer_rotate_quaternion:
  * @framebuffer: A #CoglFramebuffer pointer
@@ -378,8 +373,6 @@ void
 cogl_framebuffer_rotate_euler (CoglFramebuffer *framebuffer,
                                const CoglEuler *euler);
 
-#endif /* COGL_ENABLE_EXPERIMENTAL_API */
-
 /**
  * cogl_framebuffer_transform:
  * @framebuffer: A #CoglFramebuffer pointer
@@ -1696,11 +1689,6 @@ cogl_framebuffer_read_pixels (CoglFramebuffer *framebuffer,
 CoglFramebuffer *
 cogl_get_draw_framebuffer (void);
 
-#endif /* COGL_ENABLE_EXPERIMENTAL_API */
-
-/* XXX: Note these are defined outside the COGL_ENABLE_EXPERIMENTAL_API guard since
- * otherwise the glib-mkenums stuff will get upset. */
-
 GQuark
 cogl_framebuffer_error_quark (void);
 
diff --git a/cogl/cogl-matrix.h b/cogl/cogl-matrix.h
index 62e5243..5a93219 100644
--- a/cogl/cogl-matrix.h
+++ b/cogl/cogl-matrix.h
@@ -29,10 +29,7 @@
 
 #include <glib.h>
 #include "cogl-types.h"
-
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
 #include "cogl-quaternion.h"
-#endif
 
 G_BEGIN_DECLS
 
@@ -180,7 +177,6 @@ cogl_matrix_rotate (CoglMatrix *matrix,
 		    float y,
 		    float z);
 
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
 /**
  * cogl_matrix_rotate_quaternion:
  * @matrix: A 4x4 transformation matrix
@@ -208,7 +204,6 @@ cogl_matrix_rotate_quaternion (CoglMatrix *matrix,
 void
 cogl_matrix_rotate_euler (CoglMatrix *matrix,
                           const CoglEuler *euler);
-#endif
 
 /**
  * cogl_matrix_translate:
@@ -345,7 +340,6 @@ cogl_matrix_perspective (CoglMatrix *matrix,
                          float       z_near,
                          float       z_far);
 
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
 /**
  * cogl_matrix_orthographic:
  * @matrix: A 4x4 transformation matrix
@@ -373,7 +367,6 @@ cogl_matrix_orthographic (CoglMatrix *matrix,
                           float y_2,
                           float near,
                           float far);
-#endif
 
 /**
  * cogl_matrix_ortho:
@@ -402,7 +395,6 @@ cogl_matrix_ortho (CoglMatrix *matrix,
                    float       near,
                    float       far);
 
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
 /**
  * cogl_matrix_view_2d_in_frustum:
  * @matrix: A 4x4 transformation matrix
@@ -481,7 +473,6 @@ cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
                                     float width_2d,
                                     float height_2d);
 
-#endif
 
 /**
  * cogl_matrix_init_from_array:
@@ -505,7 +496,6 @@ cogl_matrix_init_from_array (CoglMatrix *matrix,
 const float *
 cogl_matrix_get_array (const CoglMatrix *matrix);
 
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
 /**
  * cogl_matrix_init_from_quaternion:
  * @matrix: A 4x4 transformation matrix
@@ -527,7 +517,6 @@ cogl_matrix_init_from_quaternion (CoglMatrix *matrix,
 void
 cogl_matrix_init_from_euler (CoglMatrix *matrix,
                              const CoglEuler *euler);
-#endif
 
 /**
  * cogl_matrix_equal:
@@ -617,7 +606,6 @@ cogl_matrix_transform_point (const CoglMatrix *matrix,
                              float *z,
                              float *w);
 
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
 /**
  * cogl_matrix_transform_points:
  * @matrix: A transformation matrix
@@ -731,8 +719,6 @@ cogl_matrix_project_points (const CoglMatrix *matrix,
                             void *points_out,
                             int n_points);
 
-#endif /* COGL_ENABLE_EXPERIMENTAL_API */
-
 /**
  * cogl_matrix_is_identity:
  * @matrix: A #CoglMatrix
diff --git a/cogl/cogl-object.h b/cogl/cogl-object.h
index f948c7f..5cd44f6 100644
--- a/cogl/cogl-object.h
+++ b/cogl/cogl-object.h
@@ -155,8 +155,6 @@ void *
 cogl_object_get_user_data (CoglObject *object,
                            CoglUserDataKey *key);
 
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
-
 #define cogl_debug_object_foreach_type \
   cogl_debug_object_foreach_type_EXP
 
@@ -194,7 +192,5 @@ cogl_debug_object_foreach_type (CoglDebugObjectForeachTypeCallback func,
 void
 cogl_debug_object_print_instances (void);
 
-#endif /* COGL_ENABLE_EXPERIMENTAL_API */
-
 #endif /* __COGL_OBJECT_H */
 
diff --git a/cogl/cogl-pango.h b/cogl/cogl-pango.h
index 703b5db..3209045 100644
--- a/cogl/cogl-pango.h
+++ b/cogl/cogl-pango.h
@@ -23,11 +23,6 @@
 #ifndef __COGL_PANGO_H_COMPAT__
 #define __COGL_PANGO_H_COMPAT__
 
-#ifdef COGL_ENABLE_EXPERIMENTAL_2_0_API
 #error "#include <cogl/cogl-pango.h> is unsupported; please #include <cogl-pango/cogl-pango.h>"
-#else
-#warning "#include <cogl/cogl-pango.h> is deprecated; please #include <cogl-pango/cogl-pango.h>"
-#include <cogl-pango/cogl-pango.h>
-#endif
 
 #endif /* __COGL_PANGO_H_COMPAT__ */
diff --git a/cogl/cogl-pipeline-layer-state.h b/cogl/cogl-pipeline-layer-state.h
index 682cb32..66eeb4e 100644
--- a/cogl/cogl-pipeline-layer-state.h
+++ b/cogl/cogl-pipeline-layer-state.h
@@ -36,8 +36,6 @@
 
 G_BEGIN_DECLS
 
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
-
 /**
  * CoglPipelineFilter:
  * @COGL_PIPELINE_FILTER_NEAREST: Measuring in manhatten distance from the,
@@ -601,8 +599,6 @@ cogl_pipeline_add_layer_snippet (CoglPipeline *pipeline,
                                  int layer,
                                  CoglSnippet *snippet);
 
-#endif /* COGL_ENABLE_EXPERIMENTAL_API */
-
 G_END_DECLS
 
 #endif /* __COGL_PIPELINE_LAYER_STATE_H__ */
diff --git a/cogl/cogl-pipeline-state.h b/cogl/cogl-pipeline-state.h
index 836fbce..02f4a92 100644
--- a/cogl/cogl-pipeline-state.h
+++ b/cogl/cogl-pipeline-state.h
@@ -35,8 +35,6 @@
 
 G_BEGIN_DECLS
 
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
-
 /**
  * cogl_pipeline_set_color:
  * @pipeline: A #CoglPipeline object
@@ -664,8 +662,6 @@ void
 cogl_pipeline_add_snippet (CoglPipeline *pipeline,
                            CoglSnippet *snippet);
 
-#endif /* COGL_ENABLE_EXPERIMENTAL_API */
-
 G_END_DECLS
 
 #endif /* __COGL_PIPELINE_STATE_H__ */
diff --git a/cogl/cogl-pipeline.h b/cogl/cogl-pipeline.h
index 67b777a..5cd21d9 100644
--- a/cogl/cogl-pipeline.h
+++ b/cogl/cogl-pipeline.h
@@ -39,8 +39,6 @@ typedef struct _CoglPipeline CoglPipeline;
 
 G_BEGIN_DECLS
 
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
-
 /**
  * SECTION:cogl-pipeline
  * @short_description: Functions for creating and manipulating the GPU
@@ -166,8 +164,6 @@ cogl_pipeline_get_uniform_location (CoglPipeline *pipeline,
                                     const char *uniform_name);
 
 
-#endif /* COGL_ENABLE_EXPERIMENTAL_API */
-
 G_END_DECLS
 
 #endif /* __COGL_PIPELINE_H__ */
diff --git a/cogl/cogl-texture.h b/cogl/cogl-texture.h
index 84a7e2f..0e16807 100644
--- a/cogl/cogl-texture.h
+++ b/cogl/cogl-texture.h
@@ -35,9 +35,7 @@ typedef struct _CoglTexture CoglTexture;
 
 #include <cogl/cogl-types.h>
 #include <cogl/cogl-defines.h>
-#if defined (COGL_ENABLE_EXPERIMENTAL_API)
 #include <cogl/cogl-pixel-buffer.h>
-#endif
 #include <cogl/cogl-bitmap.h>
 
 G_BEGIN_DECLS
@@ -421,8 +419,6 @@ cogl_texture_set_region (CoglTexture *texture,
                          unsigned int rowstride,
                          const uint8_t *data);
 
-#if defined (COGL_ENABLE_EXPERIMENTAL_API)
-
 #define cogl_texture_set_region_from_bitmap \
   cogl_texture_set_region_from_bitmap_EXP
 /**
@@ -459,7 +455,6 @@ cogl_texture_set_region_from_bitmap (CoglTexture *texture,
                                      unsigned int dst_width,
                                      unsigned int dst_height,
                                      CoglBitmap *bitmap);
-#endif
 
 /**
  * cogl_texture_new_from_sub_texture:
diff --git a/cogl/cogl.h b/cogl/cogl.h
index 6fcb76e..2072c88 100644
--- a/cogl/cogl.h
+++ b/cogl/cogl.h
@@ -29,16 +29,6 @@
 
 #define __COGL_H_INSIDE__
 
-#ifndef COGL_ENABLE_EXPERIMENTAL_2_0_API
-#define COGL_ENABLE_EXPERIMENTAL_2_0_API
-#endif
-
-/* TODO: Most of our currently "experimental" api should now just be
- * considered part of the 2.0 api */
-#ifndef COGL_ENABLE_EXPERIMENTAL_API
-#define COGL_ENABLE_EXPERIMENTAL_API
-#endif
-
 /*
  * API common to the 1.x and 2.0 api...
  */
@@ -57,18 +47,14 @@
 #include <cogl/cogl-path.h>
 #include <cogl/cogl-version.h>
 
-/*
- * 1.x only api...
- */
-#ifndef COGL_ENABLE_EXPERIMENTAL_2_0_API
-#include <cogl/cogl-clip-state.h>
+#ifdef COGL_HAS_GTYPE_SUPPORT
+/* GType integration */
 #include <cogl/cogl-enum-types.h>
 #endif
 
 /*
  * 2.0 api that's compatible with the 1.x api...
  */
-#if defined (COGL_ENABLE_EXPERIMENTAL_API)
 #include <cogl/cogl-swap-chain.h>
 #include <cogl/cogl-renderer.h>
 #include <cogl/cogl-display.h>
@@ -111,7 +97,6 @@
 /* XXX: This will definitly go away once all the Clutter winsys
  * code has been migrated down into Cogl! */
 #include <cogl/cogl-clutter.h>
-#endif
 #ifdef COGL_HAS_SDL_SUPPORT
 #include <cogl/cogl-sdl.h>
 #endif
diff --git a/cogl/winsys/cogl-texture-pixmap-x11.h b/cogl/winsys/cogl-texture-pixmap-x11.h
index c517762..20a2afe 100644
--- a/cogl/winsys/cogl-texture-pixmap-x11.h
+++ b/cogl/winsys/cogl-texture-pixmap-x11.h
@@ -32,8 +32,6 @@
 
 G_BEGIN_DECLS
 
-#ifdef COGL_ENABLE_EXPERIMENTAL_API
-
 /**
  * SECTION:cogl-texture-pixmap-x11
  * @short_description: Functions for creating and manipulating 2D meta
@@ -185,8 +183,6 @@ cogl_texture_pixmap_x11_set_damage_object (CoglTexturePixmapX11 *texture,
 CoglBool
 cogl_is_texture_pixmap_x11 (void *object);
 
-#endif /* COGL_ENABLE_EXPERIMENTAL_API */
-
 G_END_DECLS
 
 #endif /* __COGL_TEXTURE_PIXMAP_X11_H */
diff --git a/examples/android/hello/jni/Android.mk b/examples/android/hello/jni/Android.mk
index 01c811c..25c73d2 100644
--- a/examples/android/hello/jni/Android.mk
+++ b/examples/android/hello/jni/Android.mk
@@ -9,7 +9,6 @@ LOCAL_STATIC_LIBRARIES := cogl android_native_app_glue gobject gmodule gthread g
 LOCAL_ARM_MODE := arm
 LOCAL_CFLAGS := 				\
 	-DG_LOG_DOMAIN=\"TestCoglHello\"	\
-	-DCOGL_ENABLE_EXPERIMENTAL_2_0_API	\
 	$(NULL)
 
 include $(BUILD_SHARED_LIBRARY)
-- 
1.7.7.6



More information about the Cogl mailing list