[cogl] Remove cogl-primitives.h and CoglTextureVertex



commit 6b081a5572058d66225d72355655ef799ec97edb
Author: Neil Roberts <neil linux intel com>
Date:   Thu Sep 13 17:47:26 2012 +0100

    Remove cogl-primitives.h and CoglTextureVertex
    
    This removes the cogl-primitives.h header. The implementations for all
    of the functions that it declared have already been removed in
    7546ee19.
    
    The CoglTextureVertex type has also been removed because it was only
    used for cogl_polygon which has already been removed.
    
    This patch also fixes some mentions of cogl_rectangle() in the
    documentation and replaces them with
    cogl_framebuffer_draw_rectangle().
    
    Reviewed-by: Robert Bragg <robert linux intel com>

 cogl/Makefile.am                            |    2 -
 cogl/cogl-clip-stack.c                      |    1 -
 cogl/cogl-context-private.h                 |    1 -
 cogl/cogl-meta-texture.h                    |   32 +++--
 cogl/cogl-primitives.c                      |    8 -
 cogl/cogl-primitives.h                      |  190 ---------------------------
 cogl/cogl-snippet.h                         |    4 +-
 cogl/cogl-sub-texture.h                     |    4 +-
 cogl/cogl-texture.c                         |    1 -
 cogl/cogl-types.h                           |   22 ---
 cogl/cogl.h                                 |    1 -
 cogl/driver/gl/cogl-texture-driver-gl.c     |    1 -
 cogl/driver/gles/cogl-texture-driver-gles.c |    1 -
 tests/conform/test-backface-culling.c       |    3 -
 tests/conform/test-wrap-modes.c             |    8 -
 15 files changed, 20 insertions(+), 259 deletions(-)
---
diff --git a/cogl/Makefile.am b/cogl/Makefile.am
index 2cb63de..4fc34ec 100644
--- a/cogl/Makefile.am
+++ b/cogl/Makefile.am
@@ -59,7 +59,6 @@ cogl_1_public_h = \
 	$(srcdir)/cogl-color.h 			\
 	$(srcdir)/cogl-matrix.h 		\
 	$(srcdir)/cogl-offscreen.h 		\
-	$(srcdir)/cogl-primitives.h 		\
 	$(srcdir)/cogl-texture.h 		\
 	$(srcdir)/cogl-types.h 			\
 	$(srcdir)/cogl-clutter.h       		\
@@ -213,7 +212,6 @@ cogl_sources_c = \
 	$(srcdir)/cogl-bitmap-conversion.c 		\
 	$(srcdir)/cogl-bitmap-packing.h			\
 	$(srcdir)/cogl-primitives-private.h 		\
-	$(srcdir)/cogl-primitives.h 			\
 	$(srcdir)/cogl-primitives.c 			\
 	$(srcdir)/cogl-path-private.h 			\
 	$(srcdir)/cogl-path.c 				\
diff --git a/cogl/cogl-clip-stack.c b/cogl/cogl-clip-stack.c
index 8a1d9de..d8dbb3d 100644
--- a/cogl/cogl-clip-stack.c
+++ b/cogl/cogl-clip-stack.c
@@ -31,7 +31,6 @@
 #include <glib.h>
 
 #include "cogl-clip-stack.h"
-#include "cogl-primitives.h"
 #include "cogl-context-private.h"
 #include "cogl-internal.h"
 #include "cogl-framebuffer-private.h"
diff --git a/cogl/cogl-context-private.h b/cogl/cogl-context-private.h
index 67e2a1d..8e35099 100644
--- a/cogl/cogl-context-private.h
+++ b/cogl/cogl-context-private.h
@@ -34,7 +34,6 @@
 #endif
 
 #include "cogl-display-private.h"
-#include "cogl-primitives.h"
 #include "cogl-clip-stack.h"
 #include "cogl-matrix-stack.h"
 #include "cogl-pipeline-private.h"
diff --git a/cogl/cogl-meta-texture.h b/cogl/cogl-meta-texture.h
index b896cd0..06a3088 100644
--- a/cogl/cogl-meta-texture.h
+++ b/cogl/cogl-meta-texture.h
@@ -57,12 +57,12 @@ G_BEGIN_DECLS
  * For example the GPU is not able to automatically handle repeating a
  * texture that is part of a larger atlas texture but if you use
  * %COGL_PIPELINE_WRAP_MODE_REPEAT with an atlas texture when drawing
- * with cogl_rectangle() you should see that it "Just Worksâ" - at
- * least if you don't use multi-texturing. The reason this works is
- * because cogl_rectangle() internally understands the #CoglMetaTexture
- * interface and is able to manually resolve the low-level textures
- * using this interface and by making multiple draw calls it can
- * emulate the texture repeat modes.
+ * with cogl_framebuffer_draw_rectangle() you should see that it "Just
+ * Worksâ" - at least if you don't use multi-texturing. The reason
+ * this works is because cogl_framebuffer_draw_rectangle() internally
+ * understands the #CoglMetaTexture interface and is able to manually
+ * resolve the low-level textures using this interface and by making
+ * multiple draw calls it can emulate the texture repeat modes.
  *
  * Cogl doesn't aim to pretend that meta-textures are just like real
  * textures because it would get extremely complex to try and emulate
@@ -72,12 +72,13 @@ G_BEGIN_DECLS
  * the developer's responsibility to resolve all textures referenced by
  * a #CoglPipeline to low-level textures before drawing.
  *
- * If you want to develop custom primitive APIs like cogl_rectangle()
- * and you want to support drawing with #CoglAtlasTexture<!-- -->s
- * or #CoglSubTexture<!-- -->s for example, then you will need to use
- * this #CoglMetaTexture interface to be able to resolve high-level
- * textures into low-level textures before drawing with Cogl's
- * low-level drawing APIs such as cogl_draw_attributes().
+ * If you want to develop custom primitive APIs like
+ * cogl_framebuffer_draw_rectangle() and you want to support drawing
+ * with #CoglAtlasTexture<!-- -->s or #CoglSubTexture<!-- -->s for
+ * example, then you will need to use this #CoglMetaTexture interface
+ * to be able to resolve high-level textures into low-level textures
+ * before drawing with Cogl's low-level drawing APIs such as
+ * cogl_draw_attributes().
  *
  * <note>Most developers won't need to use this interface directly
  * but still it is worth understanding the distinction between
@@ -149,9 +150,10 @@ typedef void (*CoglMetaTextureCallback) (CoglTexture *sub_texture,
  * consistently using this interface which greately simplifies
  * implementing primitives that support all texture types.
  *
- * For example if you use the cogl_rectangle() API then Cogl will
- * internally use this API to resolve the low level textures of any
- * meta textures you have associated with CoglPipeline layers.
+ * For example if you use the cogl_framebuffer_draw_rectangle() API
+ * then Cogl will internally use this API to resolve the low level
+ * textures of any meta textures you have associated with CoglPipeline
+ * layers.
  *
  * <note>The low level drawing APIs such as cogl_draw_attributes()
  * don't understand the #CoglMetaTexture interface and so it is your
diff --git a/cogl/cogl-primitives.c b/cogl/cogl-primitives.c
index ef48d2f..87ca8bc 100644
--- a/cogl/cogl-primitives.c
+++ b/cogl/cogl-primitives.c
@@ -62,14 +62,6 @@ typedef struct _TextureSlicedQuadState
   CoglBool flipped_y;
 } TextureSlicedQuadState;
 
-typedef struct _TextureSlicedPolygonState
-{
-  const CoglTextureVertex *vertices;
-  int n_vertices;
-  int stride;
-  CoglAttribute **attributes;
-} TextureSlicedPolygonState;
-
 static void
 log_quad_sub_textures_cb (CoglTexture *texture,
                           const float *subtexture_coords,
diff --git a/cogl/cogl-snippet.h b/cogl/cogl-snippet.h
index f20cc98..b9b97f3 100644
--- a/cogl/cogl-snippet.h
+++ b/cogl/cogl-snippet.h
@@ -301,9 +301,7 @@ G_BEGIN_DECLS
  *   cogl_pipeline_set_uniform_1f (pipeline, location, 0.5f);
  *
  *   /<!-- -->* Now we can render with the snippet as usual *<!-- -->/
- *   cogl_push_source (pipeline);
- *   cogl_rectangle (0, 0, 10, 10);
- *   cogl_pop_source ();
+ *   cogl_framebuffer_draw_rectangle (fb, pipeline, 0, 0, 10, 10);
  * </programlisting>
  */
 typedef struct _CoglSnippet CoglSnippet;
diff --git a/cogl/cogl-sub-texture.h b/cogl/cogl-sub-texture.h
index 92bbe4e..914b4c5 100644
--- a/cogl/cogl-sub-texture.h
+++ b/cogl/cogl-sub-texture.h
@@ -69,8 +69,8 @@ typedef struct _CoglSubTexture CoglSubTexture;
  * that hardware can understand natively.
  *
  * <note>Remember: Unless you are using high level drawing APIs such
- * as cogl_rectangle() or other APIs documented to understand the
- * #CoglMetaTexture interface then you need to use the
+ * as cogl_framebuffer_draw_rectangle() or other APIs documented to
+ * understand the #CoglMetaTexture interface then you need to use the
  * #CoglMetaTexture interface to resolve a #CoglSubTexture into a
  * low-level texture before drawing.</note>
  *
diff --git a/cogl/cogl-texture.c b/cogl/cogl-texture.c
index 25c5282..4c8e2e9 100644
--- a/cogl/cogl-texture.c
+++ b/cogl/cogl-texture.c
@@ -49,7 +49,6 @@
 #include "cogl-context-private.h"
 #include "cogl-object-private.h"
 #include "cogl-object-private.h"
-#include "cogl-primitives.h"
 #include "cogl-framebuffer-private.h"
 #include "cogl1-context.h"
 #include "cogl-sub-texture.h"
diff --git a/cogl/cogl-types.h b/cogl/cogl-types.h
index 03c9701..07511d0 100644
--- a/cogl/cogl-types.h
+++ b/cogl/cogl-types.h
@@ -136,7 +136,6 @@ typedef struct _CoglQuaternion CoglQuaternion;
 typedef struct _CoglEuler CoglEuler;
 
 typedef struct _CoglColor               CoglColor;
-typedef struct _CoglTextureVertex       CoglTextureVertex;
 
 /* Enum declarations */
 
@@ -448,27 +447,6 @@ struct _CoglColor
 COGL_STRUCT_SIZE_ASSERT (CoglColor, 16);
 
 /**
- * CoglTextureVertex:
- * @x: Model x-coordinate
- * @y: Model y-coordinate
- * @z: Model z-coordinate
- * @tx: Texture x-coordinate
- * @ty: Texture y-coordinate
- * @color: The color to use at this vertex. This is ignored if
- *   use_color is %FALSE when calling cogl_polygon()
- *
- * Used to specify vertex information when calling cogl_polygon()
- */
-struct _CoglTextureVertex
-{
-  float x, y, z;
-  float tx, ty;
-
-  CoglColor color;
-};
-COGL_STRUCT_SIZE_ASSERT (CoglTextureVertex, 36);
-
-/**
  * CoglTextureFlags:
  * @COGL_TEXTURE_NONE: No flags specified
  * @COGL_TEXTURE_NO_AUTO_MIPMAP: Disables the automatic generation of
diff --git a/cogl/cogl.h b/cogl/cogl.h
index 597f1d5..8291bc2 100644
--- a/cogl/cogl.h
+++ b/cogl/cogl.h
@@ -42,7 +42,6 @@
 #include <cogl/cogl-color.h>
 #include <cogl/cogl-matrix.h>
 #include <cogl/cogl-offscreen.h>
-#include <cogl/cogl-primitives.h>
 #include <cogl/cogl-texture.h>
 #include <cogl/cogl-types.h>
 #include <cogl/cogl-path.h>
diff --git a/cogl/driver/gl/cogl-texture-driver-gl.c b/cogl/driver/gl/cogl-texture-driver-gl.c
index 2c59177..57c7517 100644
--- a/cogl/driver/gl/cogl-texture-driver-gl.c
+++ b/cogl/driver/gl/cogl-texture-driver-gl.c
@@ -38,7 +38,6 @@
 #include "cogl-pipeline.h"
 #include "cogl-context-private.h"
 #include "cogl-object-private.h"
-#include "cogl-primitives.h"
 #include "cogl-pipeline-opengl-private.h"
 
 #include <string.h>
diff --git a/cogl/driver/gles/cogl-texture-driver-gles.c b/cogl/driver/gles/cogl-texture-driver-gles.c
index e19721c..bd8f748 100644
--- a/cogl/driver/gles/cogl-texture-driver-gles.c
+++ b/cogl/driver/gles/cogl-texture-driver-gles.c
@@ -39,7 +39,6 @@
 #include "cogl-pipeline-opengl-private.h"
 #include "cogl-context-private.h"
 #include "cogl-object-private.h"
-#include "cogl-primitives.h"
 
 #include <string.h>
 #include <stdlib.h>
diff --git a/tests/conform/test-backface-culling.c b/tests/conform/test-backface-culling.c
index 1ee13b3..e952680 100644
--- a/tests/conform/test-backface-culling.c
+++ b/tests/conform/test-backface-culling.c
@@ -71,7 +71,6 @@ paint_test_backface_culling (TestState *state,
   for (draw_num = 0; draw_num < 8; draw_num++)
     {
       float x1 = 0, x2, y1 = 0, y2 = (float)(TEXTURE_RENDER_SIZE);
-      CoglTextureVertex verts[4];
       CoglPipeline *pipeline;
 
       cogl_framebuffer_push_matrix (framebuffer);
@@ -83,8 +82,6 @@ paint_test_backface_culling (TestState *state,
       cogl_pipeline_set_front_face_winding (pipeline, FRONT_WINDING (draw_num));
       cogl_pipeline_set_cull_face_mode (pipeline, CULL_FACE_MODE (draw_num));
 
-      memset (verts, 0, sizeof (verts));
-
       x2 = x1 + (float)(TEXTURE_RENDER_SIZE);
 
       /* Draw a front-facing texture */
diff --git a/tests/conform/test-wrap-modes.c b/tests/conform/test-wrap-modes.c
index 903f0b8..8bc5a3e 100644
--- a/tests/conform/test-wrap-modes.c
+++ b/tests/conform/test-wrap-modes.c
@@ -105,14 +105,6 @@ draw_tests (TestState *state)
     }
 }
 
-static const CoglTextureVertex vertices[4] =
-  {
-    { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f },
-    { 0.0f, TEX_SIZE * 2, 0.0f, 0.0f, 2.0f },
-    { TEX_SIZE * 2, TEX_SIZE * 2, 0.0f, 2.0f, 2.0f },
-    { TEX_SIZE * 2, 0.0f, 0.0f, 2.0f, 0.0f }
-  };
-
 static void
 validate_set (TestState *state, int offset)
 {



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