[cogl/wip/split-cogl-path: 2/2] Separate out CoglPath api into sub-library



commit 9280b96e8be8859ab5656daefa75ab8d0413ba84
Author: Robert Bragg <robert linux intel com>
Date:   Sun Apr 28 03:22:24 2013 +0100

    Separate out CoglPath api into sub-library
    
    This splits out the cogl_path_ api into a separate cogl-path sub-library
    like cogl-pango and cogl-gst. This enables developers to build Cogl with
    this sub-library disabled if they don't need it which can be useful when
    its important to keep the size of an application and its dependencies
    down to a minimum.
    
    There were a few places in core cogl and cogl-gst that referenced the
    CoglPath api and these have been decoupled by using the CoglPrimitive
    api instead. In the case of cogl_framebuffer_push_path_clip() the core
    clip stack no longer accepts path clips directly but it's now possible
    to get a CoglPrimitive for the fill of a path and so the implementation
    of cogl_framebuffer_push_path_clip() now lives in cogl-path and works as
    a shim that first gets a CoglPrimitive and uses
    cogl_framebuffer_push_primitive_clip instead.
    
    We may want to consider renaming cogl_framebuffer_push_path_clip to
    put it in the cogl_path_ namespace.

 Makefile.am                                     |    4 +
 cogl-pango/cogl-pango-display-list.c            |   50 +++-----
 cogl-pango/cogl-pango-pipeline-cache.c          |   12 --
 cogl-pango/cogl-pango-pipeline-cache.h          |   13 ++-
 cogl-pango/cogl-pango-render.c                  |   10 --
 cogl-path/Makefile.am                           |   87 +++++++++++++++
 {cogl => cogl-path}/cogl-path-private.h         |    1 +
 {cogl => cogl-path}/cogl-path.c                 |  134 ++++++++++++++++++++---
 {cogl => cogl-path}/cogl-path.h                 |   35 ++++++
 cogl-path/cogl-path.pc.in                       |   13 ++
 {cogl => cogl-path}/tesselator/GL/glu.h         |    0
 {cogl => cogl-path}/tesselator/README           |    0
 {cogl => cogl-path}/tesselator/dict-list.h      |    0
 {cogl => cogl-path}/tesselator/dict.c           |    0
 {cogl => cogl-path}/tesselator/dict.h           |    0
 {cogl => cogl-path}/tesselator/geom.c           |    0
 {cogl => cogl-path}/tesselator/geom.h           |    0
 {cogl => cogl-path}/tesselator/gluos.h          |    0
 {cogl => cogl-path}/tesselator/memalloc.h       |    0
 {cogl => cogl-path}/tesselator/mesh.c           |    0
 {cogl => cogl-path}/tesselator/mesh.h           |    0
 {cogl => cogl-path}/tesselator/normal.c         |    0
 {cogl => cogl-path}/tesselator/normal.h         |    0
 {cogl => cogl-path}/tesselator/priorityq-heap.c |    0
 {cogl => cogl-path}/tesselator/priorityq-heap.h |    0
 {cogl => cogl-path}/tesselator/priorityq-sort.h |    0
 {cogl => cogl-path}/tesselator/priorityq.c      |    0
 {cogl => cogl-path}/tesselator/priorityq.h      |    0
 {cogl => cogl-path}/tesselator/render.c         |    0
 {cogl => cogl-path}/tesselator/render.h         |    0
 {cogl => cogl-path}/tesselator/sweep.c          |    0
 {cogl => cogl-path}/tesselator/sweep.h          |    0
 {cogl => cogl-path}/tesselator/tess.c           |    0
 {cogl => cogl-path}/tesselator/tess.h           |    0
 {cogl => cogl-path}/tesselator/tesselator.h     |    0
 {cogl => cogl-path}/tesselator/tessmono.c       |    0
 {cogl => cogl-path}/tesselator/tessmono.h       |    0
 cogl/Makefile.am                                |   39 -------
 cogl/cogl-clip-stack.c                          |   61 ----------
 cogl/cogl-clip-stack.h                          |   24 +----
 cogl/cogl-context.c                             |    1 -
 cogl/cogl-framebuffer.c                         |   55 ---------
 cogl/cogl-framebuffer.h                         |   59 ----------
 cogl/cogl.h                                     |    1 -
 cogl/driver/gl/cogl-clip-stack-gl.c             |   51 ---------
 configure.ac                                    |   28 ++++-
 tests/conform/Makefile.am                       |    5 +-
 tests/conform/test-conform-main.c               |    2 +
 48 files changed, 322 insertions(+), 363 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 15fb589..fa2ea4c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,6 +12,10 @@ if BUILD_COGL_GST
 SUBDIRS += cogl-gst
 endif
 
+if BUILD_COGL_PATH
+SUBDIRS += cogl-path
+endif
+
 SUBDIRS += examples doc po build
 
 ACLOCAL_AMFLAGS = -I build/autotools ${ACLOCAL_FLAGS}
diff --git a/cogl-pango/cogl-pango-display-list.c b/cogl-pango/cogl-pango-display-list.c
index 1be3f44..a2f2e27 100644
--- a/cogl-pango/cogl-pango-display-list.c
+++ b/cogl-pango/cogl-pango-display-list.c
@@ -30,6 +30,7 @@
 #include <string.h>
 
 #include "cogl-pango-display-list.h"
+#include "cogl-pango-pipeline-cache.h"
 #include "cogl/cogl-context-private.h"
 
 typedef enum
@@ -88,12 +89,7 @@ struct _CoglPangoDisplayListNode
 
     struct
     {
-      float y_1;
-      float x_11;
-      float x_21;
-      float y_2;
-      float x_12;
-      float x_22;
+      CoglPrimitive *primitive;
     } trapezoid;
   } d;
 };
@@ -219,19 +215,26 @@ _cogl_pango_display_list_add_trapezoid (CoglPangoDisplayList *dl,
                                         float x_12,
                                         float x_22)
 {
+  CoglContext *ctx = dl->pipeline_cache->ctx;
   CoglPangoDisplayListNode *node = g_slice_new (CoglPangoDisplayListNode);
+  CoglVertexP2 vertices[4] = {
+        { x_11, y_1 },
+        { x_12, y_2 },
+        { x_22, y_2 },
+        { x_21, y_1 }
+  };
 
   node->type = COGL_PANGO_DISPLAY_LIST_TRAPEZOID;
   node->color_override = dl->color_override;
   node->color = dl->color;
-  node->d.trapezoid.y_1 = y_1;
-  node->d.trapezoid.x_11 = x_11;
-  node->d.trapezoid.x_21 = x_21;
-  node->d.trapezoid.y_2 = y_2;
-  node->d.trapezoid.x_12 = x_12;
-  node->d.trapezoid.x_22 = x_22;
   node->pipeline = NULL;
 
+  node->d.trapezoid.primitive =
+    cogl_primitive_new_p2 (ctx,
+                           COGL_VERTICES_MODE_TRIANGLE_FAN,
+                           4,
+                           vertices);
+
   _cogl_pango_display_list_append_node (dl, node);
 }
 
@@ -452,25 +455,8 @@ _cogl_pango_display_list_render (CoglFramebuffer *fb,
           break;
 
         case COGL_PANGO_DISPLAY_LIST_TRAPEZOID:
-          {
-            float points[8];
-            CoglPath *path;
-            CoglContext *ctx = fb->context;
-
-            points[0] =  node->d.trapezoid.x_11;
-            points[1] =  node->d.trapezoid.y_1;
-            points[2] =  node->d.trapezoid.x_12;
-            points[3] =  node->d.trapezoid.y_2;
-            points[4] =  node->d.trapezoid.x_22;
-            points[5] =  node->d.trapezoid.y_2;
-            points[6] =  node->d.trapezoid.x_21;
-            points[7] =  node->d.trapezoid.y_1;
-
-            path = cogl_path_new (ctx);
-            cogl_path_polygon (path, points, 4);
-            cogl_framebuffer_fill_path (fb, node->pipeline, path);
-            cogl_object_unref (path);
-          }
+          cogl_framebuffer_draw_primitive (fb, node->pipeline,
+                                           node->d.trapezoid.primitive);
           break;
         }
     }
@@ -487,6 +473,8 @@ _cogl_pango_display_list_node_free (CoglPangoDisplayListNode *node)
       if (node->d.texture.primitive != NULL)
         cogl_object_unref (node->d.texture.primitive);
     }
+  else if (node->type == COGL_PANGO_DISPLAY_LIST_TRAPEZOID)
+    cogl_object_unref (node->d.trapezoid.primitive);
 
   if (node->pipeline)
     cogl_object_unref (node->pipeline);
diff --git a/cogl-pango/cogl-pango-pipeline-cache.c b/cogl-pango/cogl-pango-pipeline-cache.c
index 67bb77a..1e702d0 100644
--- a/cogl-pango/cogl-pango-pipeline-cache.c
+++ b/cogl-pango/cogl-pango-pipeline-cache.c
@@ -37,18 +37,6 @@
 
 typedef struct _CoglPangoPipelineCacheEntry CoglPangoPipelineCacheEntry;
 
-struct _CoglPangoPipelineCache
-{
-  CoglContext *ctx;
-
-  GHashTable *hash_table;
-
-  CoglPipeline *base_texture_alpha_pipeline;
-  CoglPipeline *base_texture_rgba_pipeline;
-
-  CoglBool use_mipmapping;
-};
-
 struct _CoglPangoPipelineCacheEntry
 {
   /* This will take a reference or it can be NULL to represent the
diff --git a/cogl-pango/cogl-pango-pipeline-cache.h b/cogl-pango/cogl-pango-pipeline-cache.h
index 615eaf9..411650b 100644
--- a/cogl-pango/cogl-pango-pipeline-cache.h
+++ b/cogl-pango/cogl-pango-pipeline-cache.h
@@ -33,7 +33,18 @@
 
 COGL_BEGIN_DECLS
 
-typedef struct _CoglPangoPipelineCache CoglPangoPipelineCache;
+typedef struct _CoglPangoPipelineCache
+{
+  CoglContext *ctx;
+
+  GHashTable *hash_table;
+
+  CoglPipeline *base_texture_alpha_pipeline;
+  CoglPipeline *base_texture_rgba_pipeline;
+
+  CoglBool use_mipmapping;
+} CoglPangoPipelineCache;
+
 
 CoglPangoPipelineCache *
 _cogl_pango_pipeline_cache_new (CoglContext *ctx,
diff --git a/cogl-pango/cogl-pango-render.c b/cogl-pango/cogl-pango-render.c
index e296b2d..43fae50 100644
--- a/cogl-pango/cogl-pango-render.c
+++ b/cogl-pango/cogl-pango-render.c
@@ -778,19 +778,9 @@ cogl_pango_renderer_draw_trapezoid (PangoRenderer   *renderer,
                                    double           x22)
 {
   CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer);
-  float points[8];
 
   _COGL_RETURN_IF_FAIL (priv->display_list != NULL);
 
-  points[0] =  (x11);
-  points[1] =  (y1);
-  points[2] =  (x12);
-  points[3] =  (y2);
-  points[4] =  (x22);
-  points[5] = points[3];
-  points[6] =  (x21);
-  points[7] = points[1];
-
   cogl_pango_renderer_set_color_for_part (renderer, part);
 
   _cogl_pango_display_list_add_trapezoid (priv->display_list,
diff --git a/cogl-path/Makefile.am b/cogl-path/Makefile.am
new file mode 100644
index 0000000..82d4f89
--- /dev/null
+++ b/cogl-path/Makefile.am
@@ -0,0 +1,87 @@
+include $(top_srcdir)/build/autotools/Makefile.am.silent
+
+NULL =
+
+CLEANFILES =
+DISTCLEANFILES =
+
+EXTRA_DIST =
+
+# tesselator sources
+cogl_tesselator_sources = \
+       $(srcdir)/tesselator/dict-list.h        \
+       $(srcdir)/tesselator/dict.c             \
+       $(srcdir)/tesselator/dict.h             \
+       $(srcdir)/tesselator/geom.c             \
+       $(srcdir)/tesselator/geom.h             \
+       $(srcdir)/tesselator/gluos.h            \
+       $(srcdir)/tesselator/memalloc.h         \
+       $(srcdir)/tesselator/mesh.c             \
+       $(srcdir)/tesselator/mesh.h             \
+       $(srcdir)/tesselator/normal.c           \
+       $(srcdir)/tesselator/normal.h           \
+       $(srcdir)/tesselator/priorityq-heap.h   \
+       $(srcdir)/tesselator/priorityq-sort.h   \
+       $(srcdir)/tesselator/priorityq.c        \
+       $(srcdir)/tesselator/priorityq.h        \
+       $(srcdir)/tesselator/render.c           \
+       $(srcdir)/tesselator/render.h           \
+       $(srcdir)/tesselator/sweep.c            \
+       $(srcdir)/tesselator/sweep.h            \
+       $(srcdir)/tesselator/tess.c             \
+       $(srcdir)/tesselator/tess.h             \
+       $(srcdir)/tesselator/tesselator.h       \
+       $(srcdir)/tesselator/tessmono.c         \
+       $(srcdir)/tesselator/tessmono.h         \
+       $(srcdir)/tesselator/GL/glu.h           \
+       $(NULL)
+
+source_c = \
+       $(cogl_tesselator_sources) \
+       cogl-path-private.h \
+       cogl-path.c \
+       $(NULL)
+
+EXTRA_DIST += \
+       $(srcdir)/tesselator/README             \
+       $(srcdir)/tesselator/priorityq-heap.c   \
+       $(NULL)
+
+
+source_h = \
+       cogl-path.h \
+       $(NULL)
+
+lib_LTLIBRARIES = libcogl-path.la
+
+libcogl_path_la_SOURCES = $(source_c) $(source_h)
+libcogl_path_la_CFLAGS = $(COGL_DEP_CFLAGS) $(COGL_GST_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) $(MAINTAINER_CFLAGS)
+libcogl_path_la_LIBADD = $(top_builddir)/cogl/libcogl2.la
+libcogl_path_la_LIBADD += $(COGL_DEP_LIBS) $(COGL_GST_DEP_LIBS) $(COGL_EXTRA_LDFLAGS)
+libcogl_path_la_LDFLAGS = \
+       -export-dynamic \
+       -export-symbols-regex "^cogl_path_.*" \
+       -no-undefined \
+       -version-info @COGL_LT_CURRENT@:@COGL_LT_REVISION@:@COGL_LT_AGE@ \
+       -rpath $(libdir)
+
+AM_CPPFLAGS = \
+       -DCOGL_COMPILATION              \
+       -DG_LOG_DOMAIN=\"CoglPath\"     \
+       -I$(srcdir)/tesselator          \
+       -I$(top_srcdir)/cogl            \
+       -I$(top_builddir)/cogl          \
+       -I$(top_srcdir)/cogl/winsys     \
+       -I$(top_srcdir)                 \
+       -I$(top_builddir)
+
+cogl_pathheadersdir = $(includedir)/cogl2/cogl-path
+cogl_pathheaders_HEADERS = $(source_h)
+
+pc_files = cogl-path.pc
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = $(pc_files)
+
+EXTRA_DIST += cogl-path.pc.in
+DISTCLEANFILES += $(pc_files)
diff --git a/cogl/cogl-path-private.h b/cogl-path/cogl-path-private.h
similarity index 98%
rename from cogl/cogl-path-private.h
rename to cogl-path/cogl-path-private.h
index cc0b65c..9b68920 100644
--- a/cogl/cogl-path-private.h
+++ b/cogl-path/cogl-path-private.h
@@ -86,6 +86,7 @@ struct _CoglPathData
   CoglIndices         *fill_vbo_indices;
   unsigned int         fill_vbo_n_indices;
   CoglAttribute       *fill_attributes[COGL_PATH_N_ATTRIBUTES + 1];
+  CoglPrimitive       *fill_primitive;
 
   CoglAttributeBuffer *stroke_attribute_buffer;
   CoglAttribute      **stroke_attributes;
diff --git a/cogl/cogl-path.c b/cogl-path/cogl-path.c
similarity index 89%
rename from cogl/cogl-path.c
rename to cogl-path/cogl-path.c
index 7cd66bd..cf7b559 100644
--- a/cogl/cogl-path.c
+++ b/cogl-path/cogl-path.c
@@ -52,6 +52,7 @@
 static void _cogl_path_free (CoglPath *path);
 
 static void _cogl_path_build_fill_attribute_buffer (CoglPath *path);
+static CoglPrimitive *_cogl_path_get_fill_primitive (CoglPath *path);
 static void _cogl_path_build_stroke_attribute_buffer (CoglPath *path);
 
 COGL_OBJECT_DEFINE (Path, path);
@@ -72,6 +73,12 @@ _cogl_path_data_clear_vbos (CoglPathData *data)
       data->fill_attribute_buffer = NULL;
     }
 
+  if (data->fill_primitive)
+    {
+      cogl_object_unref (data->fill_primitive);
+      data->fill_primitive = NULL;
+    }
+
   if (data->stroke_attribute_buffer)
     {
       cogl_object_unref (data->stroke_attribute_buffer);
@@ -118,6 +125,7 @@ _cogl_path_modify (CoglPath *path)
                            old_data->path_nodes->len);
 
       path->data->fill_attribute_buffer = NULL;
+      path->data->fill_primitive = NULL;
       path->data->stroke_attribute_buffer = NULL;
       path->data->ref_count = 1;
 
@@ -198,16 +206,22 @@ _cogl_path_add_node (CoglPath *path,
 }
 
 void
-_cogl_path_stroke_nodes (CoglPath *path,
-                         CoglFramebuffer *framebuffer,
-                         CoglPipeline *pipeline)
+cogl_path_stroke (CoglPath *path,
+                  CoglFramebuffer *framebuffer,
+                  CoglPipeline *pipeline)
 {
-  CoglPathData *data = path->data;
+  CoglPathData *data;
   CoglPipeline *copy = NULL;
   unsigned int path_start;
   int path_num = 0;
   CoglPathNode *node;
 
+  _COGL_RETURN_IF_FAIL (cogl_is_path (path));
+  _COGL_RETURN_IF_FAIL (cogl_is_framebuffer (framebuffer));
+  _COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
+
+  data = path->data;
+
   if (data->path_nodes->len == 0)
     return;
 
@@ -340,6 +354,7 @@ _cogl_path_fill_nodes (CoglPath *path,
   else
     {
       CoglBool needs_fallback = FALSE;
+      CoglPrimitive *primitive;
 
       _cogl_pipeline_foreach_layer_internal (pipeline,
                                              validate_layer_cb,
@@ -352,21 +367,28 @@ _cogl_path_fill_nodes (CoglPath *path,
           return;
         }
 
-      _cogl_path_build_fill_attribute_buffer (path);
-
-      _cogl_framebuffer_draw_indexed_attributes (framebuffer,
-                                                 pipeline,
-                                                 COGL_VERTICES_MODE_TRIANGLES,
-                                                 0, /* first_vertex */
-                                                 path->data->fill_vbo_n_indices,
-                                                 path->data->fill_vbo_indices,
-                                                 path->data->fill_attributes,
-                                                 COGL_PATH_N_ATTRIBUTES,
-                                                 flags);
+      primitive = _cogl_path_get_fill_primitive (path);
+
+      _cogl_framebuffer_draw_primitive (framebuffer,
+                                        pipeline,
+                                        primitive,
+                                        flags);
     }
 }
 
 void
+cogl_path_fill (CoglPath *path,
+                CoglFramebuffer *framebuffer,
+                CoglPipeline *pipeline)
+{
+  _COGL_RETURN_IF_FAIL (cogl_is_path (path));
+  _COGL_RETURN_IF_FAIL (cogl_is_framebuffer (framebuffer));
+  _COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
+
+  _cogl_path_fill_nodes (path, framebuffer, pipeline, 0 /* flags */);
+}
+
+void
 cogl_path_move_to (CoglPath *path,
                    float x,
                    float y)
@@ -1367,6 +1389,88 @@ _cogl_path_build_fill_attribute_buffer (CoglPath *path)
   g_array_free (tess.indices, TRUE);
 }
 
+static CoglPrimitive *
+_cogl_path_get_fill_primitive (CoglPath *path)
+{
+  if (path->fill_primitive)
+    return path->fill_primitive;
+
+  _cogl_path_build_fill_attribute_buffer (path);
+
+  path->fill_primitive =
+    cogl_primitive_new_with_attributes (COGL_VERTICES_MODE_TRIANGLES,
+                                        path->data->fill_vbo_n_indices,
+                                        path->data->fill_attributes,
+                                        COGL_PATH_N_ATTRIBUTES);
+  cogl_primitive_set_indices (primitive,
+                              path->data->fill_vbo_indices,
+                              path->data->fill_vbo_n_indices);
+
+  return path->fill_primitive;
+}
+
+static CoglClipStack *
+_cogl_clip_stack_push_from_path (CoglClipStack *stack,
+                                 CoglPath *path,
+                                 CoglMatrixEntry *modelview_entry,
+                                 CoglMatrixEntry *projection_entry,
+                                 const float *viewport)
+{
+  float x_1, y_1, x_2, y_2;
+
+  _cogl_path_get_bounds (path, &x_1, &y_1, &x_2, &y_2);
+
+  /* If the path is a simple rectangle then we can divert to pushing a
+     rectangle clip instead which usually won't involve the stencil
+     buffer */
+  if (_cogl_path_is_rectangle (path))
+    return _cogl_clip_stack_push_rectangle (stack,
+                                            x_1, y_1,
+                                            x_2, y_2,
+                                            modelview_entry,
+                                            projection_entry,
+                                            viewport);
+  else
+    {
+      return _cogl_clip_stack_push_primitive (stack,
+                                              path->data->fill_primitive,
+                                              x_1, y_1, x_2, y_2,
+                                              modelview_entry,
+                                              projection_entry,
+                                              viewport);
+    }
+}
+
+void
+cogl_framebuffer_push_path_clip (CoglFramebuffer *framebuffer,
+                                 CoglPath *path)
+{
+  CoglClipState *clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
+  CoglMatrixEntry *modelview_entry =
+    _cogl_framebuffer_get_modelview_entry (framebuffer);
+  CoglMatrixEntry *projection_entry =
+    _cogl_framebuffer_get_projection_entry (framebuffer);
+  /* XXX: It would be nicer if we stored the private viewport as a
+   * vec4 so we could avoid this redundant copy. */
+  float viewport[] = {
+      framebuffer->viewport_x,
+      framebuffer->viewport_y,
+      framebuffer->viewport_width,
+      framebuffer->viewport_height
+  };
+
+  clip_state->stacks->data =
+    _cogl_clip_stack_push_from_path (clip_state->stacks->data,
+                                     path,
+                                     modelview_entry,
+                                     projection_entry,
+                                     viewport);
+
+  if (framebuffer->context->current_draw_buffer == framebuffer)
+    framebuffer->context->current_draw_buffer_changes |=
+      COGL_FRAMEBUFFER_STATE_CLIP;
+}
+
 static void
 _cogl_path_build_stroke_attribute_buffer (CoglPath *path)
 {
diff --git a/cogl/cogl-path.h b/cogl-path/cogl-path.h
similarity index 93%
rename from cogl/cogl-path.h
rename to cogl-path/cogl-path.h
index 35df19a..2c20427 100644
--- a/cogl/cogl-path.h
+++ b/cogl-path/cogl-path.h
@@ -463,6 +463,41 @@ cogl_path_set_fill_rule (CoglPath *path, CoglPathFillRule fill_rule);
 CoglPathFillRule
 cogl_path_get_fill_rule (CoglPath *path);
 
+/**
+ * cogl_path_stroke:
+ * @path: The #CoglPath to stroke
+ * @framebuffer: A #CoglFramebuffer
+ * @pipeline: A #CoglPipeline to render with
+ *
+ * Strokes the edge of the path using the fragment operations defined
+ * by the pipeline. The stroke line will have a width of 1 pixel
+ * regardless of the current transformation matrix.
+ *
+ * Since: 2.0
+ */
+
+void
+cogl_path_stroke (CoglPath *path,
+                  CoglFramebuffer *framebuffer,
+                  CoglPipeline *pipeline);
+
+/**
+ * cogl_framebuffer_push_path_clip:
+ * @framebuffer: A #CoglFramebuffer pointer
+ * @path: The path to clip with.
+ *
+ * Sets a new clipping area using the silhouette of the specified,
+ * filled @path.  The clipping area is intersected with the previous
+ * clipping area. To restore the previous clipping area, call
+ * cogl_framebuffer_pop_clip().
+ *
+ * Since: 1.0
+ * Stability: unstable
+ */
+void
+cogl_framebuffer_push_path_clip (CoglFramebuffer *framebuffer,
+                                 CoglPath *path);
+
 COGL_END_DECLS
 
 #endif /* __COGL_PATH_H__ */
diff --git a/cogl-path/cogl-path.pc.in b/cogl-path/cogl-path.pc.in
new file mode 100644
index 0000000..d8b3beb
--- /dev/null
+++ b/cogl-path/cogl-path.pc.in
@@ -0,0 +1,13 @@
+prefix= prefix@
+exec_prefix= exec_prefix@
+libdir= libdir@
+includedir= includedir@
+apiversion= COGL_API_VERSION@
+requires= COGL_PKG_REQUIRES@
+
+Name: Cogl
+Description: A 2D path drawing library for Cogl
+Version: @COGL_VERSION@
+Libs: -L${libdir} -lcogl-path
+Cflags: -I${includedir}/cogl
+Requires: ${requires}
diff --git a/cogl/tesselator/GL/glu.h b/cogl-path/tesselator/GL/glu.h
similarity index 100%
rename from cogl/tesselator/GL/glu.h
rename to cogl-path/tesselator/GL/glu.h
diff --git a/cogl/tesselator/README b/cogl-path/tesselator/README
similarity index 100%
rename from cogl/tesselator/README
rename to cogl-path/tesselator/README
diff --git a/cogl/tesselator/dict-list.h b/cogl-path/tesselator/dict-list.h
similarity index 100%
rename from cogl/tesselator/dict-list.h
rename to cogl-path/tesselator/dict-list.h
diff --git a/cogl/tesselator/dict.c b/cogl-path/tesselator/dict.c
similarity index 100%
rename from cogl/tesselator/dict.c
rename to cogl-path/tesselator/dict.c
diff --git a/cogl/tesselator/dict.h b/cogl-path/tesselator/dict.h
similarity index 100%
rename from cogl/tesselator/dict.h
rename to cogl-path/tesselator/dict.h
diff --git a/cogl/tesselator/geom.c b/cogl-path/tesselator/geom.c
similarity index 100%
rename from cogl/tesselator/geom.c
rename to cogl-path/tesselator/geom.c
diff --git a/cogl/tesselator/geom.h b/cogl-path/tesselator/geom.h
similarity index 100%
rename from cogl/tesselator/geom.h
rename to cogl-path/tesselator/geom.h
diff --git a/cogl/tesselator/gluos.h b/cogl-path/tesselator/gluos.h
similarity index 100%
rename from cogl/tesselator/gluos.h
rename to cogl-path/tesselator/gluos.h
diff --git a/cogl/tesselator/memalloc.h b/cogl-path/tesselator/memalloc.h
similarity index 100%
rename from cogl/tesselator/memalloc.h
rename to cogl-path/tesselator/memalloc.h
diff --git a/cogl/tesselator/mesh.c b/cogl-path/tesselator/mesh.c
similarity index 100%
rename from cogl/tesselator/mesh.c
rename to cogl-path/tesselator/mesh.c
diff --git a/cogl/tesselator/mesh.h b/cogl-path/tesselator/mesh.h
similarity index 100%
rename from cogl/tesselator/mesh.h
rename to cogl-path/tesselator/mesh.h
diff --git a/cogl/tesselator/normal.c b/cogl-path/tesselator/normal.c
similarity index 100%
rename from cogl/tesselator/normal.c
rename to cogl-path/tesselator/normal.c
diff --git a/cogl/tesselator/normal.h b/cogl-path/tesselator/normal.h
similarity index 100%
rename from cogl/tesselator/normal.h
rename to cogl-path/tesselator/normal.h
diff --git a/cogl/tesselator/priorityq-heap.c b/cogl-path/tesselator/priorityq-heap.c
similarity index 100%
rename from cogl/tesselator/priorityq-heap.c
rename to cogl-path/tesselator/priorityq-heap.c
diff --git a/cogl/tesselator/priorityq-heap.h b/cogl-path/tesselator/priorityq-heap.h
similarity index 100%
rename from cogl/tesselator/priorityq-heap.h
rename to cogl-path/tesselator/priorityq-heap.h
diff --git a/cogl/tesselator/priorityq-sort.h b/cogl-path/tesselator/priorityq-sort.h
similarity index 100%
rename from cogl/tesselator/priorityq-sort.h
rename to cogl-path/tesselator/priorityq-sort.h
diff --git a/cogl/tesselator/priorityq.c b/cogl-path/tesselator/priorityq.c
similarity index 100%
rename from cogl/tesselator/priorityq.c
rename to cogl-path/tesselator/priorityq.c
diff --git a/cogl/tesselator/priorityq.h b/cogl-path/tesselator/priorityq.h
similarity index 100%
rename from cogl/tesselator/priorityq.h
rename to cogl-path/tesselator/priorityq.h
diff --git a/cogl/tesselator/render.c b/cogl-path/tesselator/render.c
similarity index 100%
rename from cogl/tesselator/render.c
rename to cogl-path/tesselator/render.c
diff --git a/cogl/tesselator/render.h b/cogl-path/tesselator/render.h
similarity index 100%
rename from cogl/tesselator/render.h
rename to cogl-path/tesselator/render.h
diff --git a/cogl/tesselator/sweep.c b/cogl-path/tesselator/sweep.c
similarity index 100%
rename from cogl/tesselator/sweep.c
rename to cogl-path/tesselator/sweep.c
diff --git a/cogl/tesselator/sweep.h b/cogl-path/tesselator/sweep.h
similarity index 100%
rename from cogl/tesselator/sweep.h
rename to cogl-path/tesselator/sweep.h
diff --git a/cogl/tesselator/tess.c b/cogl-path/tesselator/tess.c
similarity index 100%
rename from cogl/tesselator/tess.c
rename to cogl-path/tesselator/tess.c
diff --git a/cogl/tesselator/tess.h b/cogl-path/tesselator/tess.h
similarity index 100%
rename from cogl/tesselator/tess.h
rename to cogl-path/tesselator/tess.h
diff --git a/cogl/tesselator/tesselator.h b/cogl-path/tesselator/tesselator.h
similarity index 100%
rename from cogl/tesselator/tesselator.h
rename to cogl-path/tesselator/tesselator.h
diff --git a/cogl/tesselator/tessmono.c b/cogl-path/tesselator/tessmono.c
similarity index 100%
rename from cogl/tesselator/tessmono.c
rename to cogl-path/tesselator/tessmono.c
diff --git a/cogl/tesselator/tessmono.h b/cogl-path/tesselator/tessmono.h
similarity index 100%
rename from cogl/tesselator/tessmono.h
rename to cogl-path/tesselator/tessmono.h
diff --git a/cogl/Makefile.am b/cogl/Makefile.am
index b261f11..4db98cd 100644
--- a/cogl/Makefile.am
+++ b/cogl/Makefile.am
@@ -18,7 +18,6 @@ lib_LTLIBRARIES =
 AM_CPPFLAGS = \
        -I$(top_srcdir)                         \
        -I$(top_builddir)                       \
-       -I$(srcdir)/tesselator                  \
        -I$(srcdir)/winsys                      \
        -I$(srcdir)/driver/gl                   \
        -I$(srcdir)/driver/gl/gl                \
@@ -84,7 +83,6 @@ cogl_public_h = \
        $(srcdir)/cogl-onscreen-template.h      \
        $(srcdir)/cogl-frame-info.h             \
        $(srcdir)/cogl-onscreen.h               \
-       $(srcdir)/cogl-path.h                   \
        $(srcdir)/cogl-pipeline-layer-state.h   \
        $(srcdir)/cogl-pipeline-state.h         \
        $(srcdir)/cogl-pipeline.h               \
@@ -196,45 +194,10 @@ cogl_winsys_common_sources = \
        $(srcdir)/winsys/cogl-winsys.c \
        $(NULL)
 
-# tesselator sources
-cogl_tesselator_sources = \
-       $(srcdir)/tesselator/dict-list.h        \
-       $(srcdir)/tesselator/dict.c             \
-       $(srcdir)/tesselator/dict.h             \
-       $(srcdir)/tesselator/geom.c             \
-       $(srcdir)/tesselator/geom.h             \
-       $(srcdir)/tesselator/gluos.h            \
-       $(srcdir)/tesselator/memalloc.h         \
-       $(srcdir)/tesselator/mesh.c             \
-       $(srcdir)/tesselator/mesh.h             \
-       $(srcdir)/tesselator/normal.c           \
-       $(srcdir)/tesselator/normal.h           \
-       $(srcdir)/tesselator/priorityq-heap.h   \
-       $(srcdir)/tesselator/priorityq-sort.h   \
-       $(srcdir)/tesselator/priorityq.c        \
-       $(srcdir)/tesselator/priorityq.h        \
-       $(srcdir)/tesselator/render.c           \
-       $(srcdir)/tesselator/render.h           \
-       $(srcdir)/tesselator/sweep.c            \
-       $(srcdir)/tesselator/sweep.h            \
-       $(srcdir)/tesselator/tess.c             \
-       $(srcdir)/tesselator/tess.h             \
-       $(srcdir)/tesselator/tesselator.h       \
-       $(srcdir)/tesselator/tessmono.c         \
-       $(srcdir)/tesselator/tessmono.h         \
-       $(srcdir)/tesselator/GL/glu.h           \
-       $(NULL)
-
-EXTRA_DIST += \
-       $(srcdir)/tesselator/README             \
-       $(srcdir)/tesselator/priorityq-heap.c   \
-       $(NULL)
-
 # sources
 cogl_sources_c = \
        $(cogl_driver_sources)                          \
        $(cogl_winsys_common_sources)                   \
-       $(cogl_tesselator_sources)                      \
        $(srcdir)/cogl-private.h                        \
        $(srcdir)/cogl-debug.h                          \
        $(srcdir)/cogl-debug-options.h                  \
@@ -267,8 +230,6 @@ cogl_sources_c = \
        $(srcdir)/cogl-bitmap-packing.h                 \
        $(srcdir)/cogl-primitives-private.h             \
        $(srcdir)/cogl-primitives.c                     \
-       $(srcdir)/cogl-path-private.h                   \
-       $(srcdir)/cogl-path.c                           \
        $(srcdir)/cogl-bitmap-pixbuf.c                  \
        $(srcdir)/cogl-clip-stack.h                     \
        $(srcdir)/cogl-clip-stack.c                     \
diff --git a/cogl/cogl-clip-stack.c b/cogl/cogl-clip-stack.c
index 9db3b0e..2e909ae 100644
--- a/cogl/cogl-clip-stack.c
+++ b/cogl/cogl-clip-stack.c
@@ -36,7 +36,6 @@
 #include "cogl-framebuffer-private.h"
 #include "cogl-journal-private.h"
 #include "cogl-util.h"
-#include "cogl-path-private.h"
 #include "cogl-matrix-private.h"
 #include "cogl-primitives-private.h"
 #include "cogl-private.h"
@@ -248,57 +247,6 @@ _cogl_clip_stack_push_rectangle (CoglClipStack *stack,
 }
 
 CoglClipStack *
-_cogl_clip_stack_push_from_path (CoglClipStack *stack,
-                                 CoglPath *path,
-                                 CoglMatrixEntry *modelview_entry,
-                                 CoglMatrixEntry *projection_entry,
-                                 const float *viewport)
-{
-  float x_1, y_1, x_2, y_2;
-
-  _cogl_path_get_bounds (path, &x_1, &y_1, &x_2, &y_2);
-
-  /* If the path is a simple rectangle then we can divert to pushing a
-     rectangle clip instead which usually won't involve the stencil
-     buffer */
-  if (_cogl_path_is_rectangle (path))
-    return _cogl_clip_stack_push_rectangle (stack,
-                                            x_1, y_1,
-                                            x_2, y_2,
-                                            modelview_entry,
-                                            projection_entry,
-                                            viewport);
-  else
-    {
-      CoglClipStackPath *entry;
-      CoglMatrix modelview;
-      CoglMatrix projection;
-      float transformed_corners[8];
-
-      entry = _cogl_clip_stack_push_entry (stack,
-                                           sizeof (CoglClipStackPath),
-                                           COGL_CLIP_STACK_PATH);
-
-      entry->path = cogl_path_copy (path);
-
-      entry->matrix_entry = cogl_matrix_entry_ref (modelview_entry);
-
-      cogl_matrix_entry_get (modelview_entry, &modelview);
-      cogl_matrix_entry_get (projection_entry, &projection);
-
-      get_transformed_corners (x_1, y_1, x_2, y_2,
-                               &modelview,
-                               &projection,
-                               viewport,
-                               transformed_corners);
-      _cogl_clip_stack_entry_set_bounds ((CoglClipStack *) entry,
-                                         transformed_corners);
-
-      return (CoglClipStack *) entry;
-    }
-}
-
-CoglClipStack *
 _cogl_clip_stack_push_primitive (CoglClipStack *stack,
                                  CoglPrimitive *primitive,
                                  float bounds_x1,
@@ -376,15 +324,6 @@ _cogl_clip_stack_unref (CoglClipStack *entry)
         case COGL_CLIP_STACK_WINDOW_RECT:
           g_slice_free1 (sizeof (CoglClipStackWindowRect), entry);
           break;
-
-        case COGL_CLIP_STACK_PATH:
-          {
-            CoglClipStackPath *path_entry = (CoglClipStackPath *) entry;
-            cogl_matrix_entry_unref (path_entry->matrix_entry);
-            cogl_object_unref (path_entry->path);
-            g_slice_free1 (sizeof (CoglClipStackPath), entry);
-            break;
-          }
         case COGL_CLIP_STACK_PRIMITIVE:
           {
             CoglClipStackPrimitive *primitive_entry =
diff --git a/cogl/cogl-clip-stack.h b/cogl/cogl-clip-stack.h
index 7c2ee98..2e0bd89 100644
--- a/cogl/cogl-clip-stack.h
+++ b/cogl/cogl-clip-stack.h
@@ -24,7 +24,6 @@
 #ifndef __COGL_CLIP_STACK_H
 #define __COGL_CLIP_STACK_H
 
-#include "cogl-path.h"
 #include "cogl-matrix.h"
 #include "cogl-primitive.h"
 #include "cogl-framebuffer.h"
@@ -41,14 +40,12 @@
 typedef struct _CoglClipStack CoglClipStack;
 typedef struct _CoglClipStackRect CoglClipStackRect;
 typedef struct _CoglClipStackWindowRect CoglClipStackWindowRect;
-typedef struct _CoglClipStackPath CoglClipStackPath;
 typedef struct _CoglClipStackPrimitive CoglClipStackPrimitive;
 
 typedef enum
   {
     COGL_CLIP_STACK_RECT,
     COGL_CLIP_STACK_WINDOW_RECT,
-    COGL_CLIP_STACK_PATH,
     COGL_CLIP_STACK_PRIMITIVE
   } CoglClipStackType;
 
@@ -65,14 +62,14 @@ typedef enum
  * CoglClipStack *stack_a = NULL;
  * stack_a = _cogl_clip_stack_push_rectangle (stack_a, ...);
  * stack_a = _cogl_clip_stack_push_rectangle (stack_a, ...);
- * stack_a = _cogl_clip_stack_push_from_path (stack_a, ...);
+ * stack_a = _cogl_clip_stack_push_primitive (stack_a, ...);
  * CoglClipStack *stack_b = NULL;
  * stack_b = cogl_clip_stack_push_window_rectangle (stack_b, ...);
  *
  *  stack_a
  *         \ holds a ref to
  *          +-----------+
- *          | path node |
+ *          | prim node |
  *          |ref count 1|
  *          +-----------+
  *                       \
@@ -143,16 +140,6 @@ struct _CoglClipStackWindowRect
      just adds to the scissor clip */
 };
 
-struct _CoglClipStackPath
-{
-  CoglClipStack _parent_data;
-
-  /* The matrix that was current when the clip was set */
-  CoglMatrixEntry *matrix_entry;
-
-  CoglPath *path;
-};
-
 struct _CoglClipStackPrimitive
 {
   CoglClipStack _parent_data;
@@ -186,13 +173,6 @@ _cogl_clip_stack_push_rectangle (CoglClipStack *stack,
                                  const float *viewport);
 
 CoglClipStack *
-_cogl_clip_stack_push_from_path (CoglClipStack *stack,
-                                 CoglPath *path,
-                                 CoglMatrixEntry *modelview_entry,
-                                 CoglMatrixEntry *projection_entry,
-                                 const float *viewport);
-
-CoglClipStack *
 _cogl_clip_stack_push_primitive (CoglClipStack *stack,
                                  CoglPrimitive *primitive,
                                  float bounds_x1,
diff --git a/cogl/cogl-context.c b/cogl/cogl-context.c
index e4714be..ef589db 100644
--- a/cogl/cogl-context.c
+++ b/cogl/cogl-context.c
@@ -44,7 +44,6 @@
 #include "cogl-pipeline-opengl-private.h"
 #include "cogl-framebuffer-private.h"
 #include "cogl-onscreen-private.h"
-#include "cogl-path.h"
 #include "cogl-attribute-private.h"
 #include "cogl-gpu-info-private.h"
 #include "cogl-config-private.h"
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index ceb7916..be78789 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -46,7 +46,6 @@
 #include "cogl-offscreen.h"
 #include "cogl-private.h"
 #include "cogl-primitives-private.h"
-#include "cogl-path-private.h"
 #include "cogl-error-private.h"
 #include "cogl-texture-gl-private.h"
 
@@ -1638,36 +1637,6 @@ cogl_framebuffer_push_rectangle_clip (CoglFramebuffer *framebuffer,
 }
 
 void
-cogl_framebuffer_push_path_clip (CoglFramebuffer *framebuffer,
-                                 CoglPath *path)
-{
-  CoglClipState *clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
-  CoglMatrixEntry *modelview_entry =
-    _cogl_framebuffer_get_modelview_entry (framebuffer);
-  CoglMatrixEntry *projection_entry =
-    _cogl_framebuffer_get_projection_entry (framebuffer);
-  /* XXX: It would be nicer if we stored the private viewport as a
-   * vec4 so we could avoid this redundant copy. */
-  float viewport[] = {
-      framebuffer->viewport_x,
-      framebuffer->viewport_y,
-      framebuffer->viewport_width,
-      framebuffer->viewport_height
-  };
-
-  clip_state->stacks->data =
-    _cogl_clip_stack_push_from_path (clip_state->stacks->data,
-                                     path,
-                                     modelview_entry,
-                                     projection_entry,
-                                     viewport);
-
-  if (framebuffer->context->current_draw_buffer == framebuffer)
-    framebuffer->context->current_draw_buffer_changes |=
-      COGL_FRAMEBUFFER_STATE_CLIP;
-}
-
-void
 cogl_framebuffer_push_primitive_clip (CoglFramebuffer *framebuffer,
                                       CoglPrimitive *primitive,
                                       float bounds_x1,
@@ -2420,27 +2389,3 @@ cogl_framebuffer_draw_textured_rectangles (CoglFramebuffer *framebuffer,
                                                    rects,
                                                    n_rectangles);
 }
-
-void
-cogl_framebuffer_fill_path (CoglFramebuffer *framebuffer,
-                            CoglPipeline *pipeline,
-                            CoglPath *path)
-{
-  _COGL_RETURN_IF_FAIL (cogl_is_framebuffer (framebuffer));
-  _COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
-  _COGL_RETURN_IF_FAIL (cogl_is_path (path));
-
-  _cogl_path_fill_nodes (path, framebuffer, pipeline, 0 /* flags */);
-}
-
-void
-cogl_framebuffer_stroke_path (CoglFramebuffer *framebuffer,
-                              CoglPipeline *pipeline,
-                              CoglPath *path)
-{
-  _COGL_RETURN_IF_FAIL (cogl_is_framebuffer (framebuffer));
-  _COGL_RETURN_IF_FAIL (cogl_is_pipeline (pipeline));
-  _COGL_RETURN_IF_FAIL (cogl_is_path (path));
-
-  _cogl_path_stroke_nodes (path, framebuffer, pipeline);
-}
diff --git a/cogl/cogl-framebuffer.h b/cogl/cogl-framebuffer.h
index 918a36d..fde5c35 100644
--- a/cogl/cogl-framebuffer.h
+++ b/cogl/cogl-framebuffer.h
@@ -37,7 +37,6 @@
  */
 typedef struct _CoglFramebuffer CoglFramebuffer;
 
-#include <cogl/cogl-path.h>
 #include <cogl/cogl-pipeline.h>
 #include <cogl/cogl-indices.h>
 #include <cogl/cogl-bitmap.h>
@@ -586,23 +585,6 @@ cogl_framebuffer_push_rectangle_clip (CoglFramebuffer *framebuffer,
                                       float y_2);
 
 /**
- * cogl_framebuffer_push_path_clip:
- * @framebuffer: A #CoglFramebuffer pointer
- * @path: The path to clip with.
- *
- * Sets a new clipping area using the silhouette of the specified,
- * filled @path.  The clipping area is intersected with the previous
- * clipping area. To restore the previous clipping area, call
- * cogl_framebuffer_pop_clip().
- *
- * Since: 1.0
- * Stability: unstable
- */
-void
-cogl_framebuffer_push_path_clip (CoglFramebuffer *framebuffer,
-                                 CoglPath *path);
-
-/**
  * cogl_framebuffer_push_primitive_clip:
  * @framebuffer: A #CoglFramebuffer pointer
  * @primitive: A #CoglPrimitive describing a flat 2D shape
@@ -1573,47 +1555,6 @@ cogl_framebuffer_draw_textured_rectangles (CoglFramebuffer *framebuffer,
                                            const float *coordinates,
                                            unsigned int n_rectangles);
 
-/**
- * cogl_framebuffer_fill_path:
- * @framebuffer: A #CoglFramebuffer
- * @pipeline: A #CoglPipeline to render with
- * @path: The #CoglPath to fill
- *
- * Fills the interior of the path using the fragment operations
- * defined by the pipeline.
- *
- * The interior of the shape is determined using the fill rule of the
- * path. See %CoglPathFillRule for details.
- *
- * <note>The result of referencing sliced textures in your current
- * pipeline when filling a path are undefined. You should pass
- * the %COGL_TEXTURE_NO_SLICING flag when loading any texture you will
- * use while filling a path.</note>
- *
- * Since: 2.0
- */
-void
-cogl_framebuffer_fill_path (CoglFramebuffer *framebuffer,
-                            CoglPipeline *pipeline,
-                            CoglPath *path);
-
-/**
- * cogl_framebuffer_stroke_path:
- * @framebuffer: A #CoglFramebuffer
- * @pipeline: A #CoglPipeline to render with
- * @path: The #CoglPath to stroke
- *
- * Strokes the edge of the path using the fragment operations defined
- * by the pipeline. The stroke line will have a width of 1 pixel
- * regardless of the current transformation matrix.
- *
- * Since: 2.0
- */
-void
-cogl_framebuffer_stroke_path (CoglFramebuffer *framebuffer,
-                              CoglPipeline *pipeline,
-                              CoglPath *path);
-
 /* XXX: Should we take an n_buffers + buffer id array instead of using
  * the CoglBufferBits type which doesn't seem future proof? */
 /**
diff --git a/cogl/cogl.h b/cogl/cogl.h
index 367d45a..c350f8b 100644
--- a/cogl/cogl.h
+++ b/cogl/cogl.h
@@ -38,7 +38,6 @@
 #include <cogl/cogl-offscreen.h>
 #include <cogl/cogl-texture.h>
 #include <cogl/cogl-types.h>
-#include <cogl/cogl-path.h>
 #include <cogl/cogl-version.h>
 
 #ifdef COGL_HAS_GTYPE_SUPPORT
diff --git a/cogl/driver/gl/cogl-clip-stack-gl.c b/cogl/driver/gl/cogl-clip-stack-gl.c
index 6fcd4c1..54c4c0b 100644
--- a/cogl/driver/gl/cogl-clip-stack-gl.c
+++ b/cogl/driver/gl/cogl-clip-stack-gl.c
@@ -33,7 +33,6 @@
 #include "cogl-util-gl-private.h"
 #include "cogl-primitives-private.h"
 #include "cogl-pipeline-opengl-private.h"
-#include "cogl-path-private.h"
 #include "cogl-clip-stack-gl-private.h"
 
 #ifndef GL_CLIP_PLANE0
@@ -360,41 +359,6 @@ add_stencil_clip_silhouette (CoglFramebuffer *framebuffer,
 }
 
 static void
-paint_path_silhouette (CoglFramebuffer *framebuffer,
-                       CoglPipeline *pipeline,
-                       void *user_data)
-{
-  CoglPath *path = user_data;
-  if (path->data->path_nodes->len >= 3)
-    _cogl_path_fill_nodes (path,
-                           framebuffer,
-                           pipeline,
-                           COGL_DRAW_SKIP_JOURNAL_FLUSH |
-                           COGL_DRAW_SKIP_PIPELINE_VALIDATION |
-                           COGL_DRAW_SKIP_FRAMEBUFFER_FLUSH);
-}
-
-static void
-add_stencil_clip_path (CoglFramebuffer *framebuffer,
-                       CoglMatrixEntry *modelview_entry,
-                       CoglPath *path,
-                       CoglBool merge,
-                       CoglBool need_clear)
-{
-  CoglPathData *data = path->data;
-  add_stencil_clip_silhouette (framebuffer,
-                               paint_path_silhouette,
-                               modelview_entry,
-                               data->path_nodes_min.x,
-                               data->path_nodes_min.y,
-                               data->path_nodes_max.x,
-                               data->path_nodes_max.y,
-                               merge,
-                               need_clear,
-                               path);
-}
-
-static void
 paint_primitive_silhouette (CoglFramebuffer *framebuffer,
                             CoglPipeline *pipeline,
                             void *user_data)
@@ -574,21 +538,6 @@ _cogl_clip_stack_gl_flush (CoglClipStack *stack,
     {
       switch (entry->type)
         {
-        case COGL_CLIP_STACK_PATH:
-            {
-              CoglClipStackPath *path_entry = (CoglClipStackPath *) entry;
-
-              COGL_NOTE (CLIPPING, "Adding stencil clip for path");
-
-              add_stencil_clip_path (framebuffer,
-                                     path_entry->matrix_entry,
-                                     path_entry->path,
-                                     using_stencil_buffer,
-                                     TRUE);
-
-              using_stencil_buffer = TRUE;
-              break;
-            }
         case COGL_CLIP_STACK_PRIMITIVE:
             {
               CoglClipStackPrimitive *primitive_entry =
diff --git a/configure.ac b/configure.ac
index f0bb096..fb4b1a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -472,6 +472,21 @@ AS_IF([test "x$enable_cogl_gst" = "xyes"],
       ]
 )
 
+dnl     ============================================================
+dnl     Should cogl-path be built?
+dnl     ============================================================
+
+AC_ARG_ENABLE(
+  [cogl-path],
+  [AC_HELP_STRING([--enable-cogl-path=@<:@no/yes@:>@], [Enable 2D path support @<:@default=no@:>@])],
+  [],
+  enable_cogl_path=yes
+)
+AS_IF([test "x$enable_cogl_path" = "xyes"],
+      [
+        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_COGL_PATH_SUPPORT"
+      ]
+)
 
 dnl     ============================================================
 dnl     Choose image loading backend
@@ -1170,6 +1185,8 @@ AS_IF([test "x$enable_cogl_pango" = "xyes"],
 )
 AM_CONDITIONAL([BUILD_COGL_PANGO], [test "x$enable_cogl_pango" = "xyes"])
 
+AM_CONDITIONAL([BUILD_COGL_PATH], [test "x$enable_cogl_path" = "xyes"])
+
 AC_SUBST(COGL_GST_PKG_REQUIRES)
 
 AS_IF([test "x$enable_cogl_gst" = "xyes"],
@@ -1325,6 +1342,8 @@ cogl/cogl.rc
 cogl-pango/Makefile
 cogl-pango/cogl-pango2.pc
 cogl-pango/cogl-pango.rc
+cogl-path/Makefile
+cogl-path/cogl-path.pc
 cogl-gst/Makefile
 cogl-gst/cogl-gst.pc
 cogl-gles2/Makefile
@@ -1380,13 +1399,14 @@ fi
 echo "        Build libcogl-gles2 GLES 2.0 frontend api: ${enable_cogl_gles2}"
 echo "        Image backend: ${COGL_IMAGE_BACKEND}"
 echo "        Cogl Pango: ${enable_cogl_pango}"
-echo "        Profiling: ${enable_profile}"
-echo "        CoglGst: ${enable_cogl_gst}"
+echo "        Cogl Gstreamer: ${enable_cogl_gst}"
+echo "        Cogl Path: ${enable_cogl_path}"
 
 # Compiler/Debug related flags
 echo ""
-echo " • Compiler options:"
-echo "        Cogl debug: ${enable_debug}"
+echo " • Build options:"
+echo "        Debugging: ${enable_debug}"
+echo "        Profiling: ${enable_profile}"
 echo "        Enable deprecated symbols: ${enable_deprecated}"
 echo "        Compiler flags: ${CFLAGS} ${COGL_EXTRA_CFLAGS}"
 echo "        Linker flags: ${LDFLAGS} ${COGL_EXTRA_LDFLAGS}"
diff --git a/tests/conform/Makefile.am b/tests/conform/Makefile.am
index d5c25db..6c09ac0 100644
--- a/tests/conform/Makefile.am
+++ b/tests/conform/Makefile.am
@@ -33,7 +33,6 @@ test_sources = \
        test-color-mask.c \
        test-backface-culling.c \
        test-just-vertex-shader.c \
-       test-path.c \
        test-pipeline-uniforms.c \
        test-pixel-buffer.c \
        test-premult.c \
@@ -67,6 +66,10 @@ test_sources = \
        test-pipeline-cache-unrefs-texture.c \
        $(NULL)
 
+if BUILD_COGL_PATH
+test_sources += test-path.c
+endif
+
 test_conformance_SOURCES = $(common_sources) $(test_sources)
 
 if OS_WIN32
diff --git a/tests/conform/test-conform-main.c b/tests/conform/test-conform-main.c
index 9345065..a3df1c3 100644
--- a/tests/conform/test-conform-main.c
+++ b/tests/conform/test-conform-main.c
@@ -55,7 +55,9 @@ main (int argc, char **argv)
   ADD_TEST (test_blend_strings, 0, 0);
   ADD_TEST (test_premult, 0, 0);
   UNPORTED_TEST (test_readpixels);
+#ifdef COGL_HAS_COGL_PATH_SUPPORT
   ADD_TEST (test_path, 0, 0);
+#endif
   ADD_TEST (test_depth_test, 0, 0);
   ADD_TEST (test_color_mask, 0, 0);
   ADD_TEST (test_backface_culling, 0, 0);



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