[gtk/wip/matthiasc/lottie-stroke: 52/55] Revert "wip: pathstroke port to curve"




commit bb3efac5082164acfad6216bf3a234b5953231f1
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Dec 10 21:01:08 2020 -0500

    Revert "wip: pathstroke port to curve"
    
    This reverts commit 46c6dd5351dc35c1065861bf38fefda2e91c4ab5.

 gsk/gskpathstroke.c | 45 +++++++++------------------------------------
 1 file changed, 9 insertions(+), 36 deletions(-)
---
diff --git a/gsk/gskpathstroke.c b/gsk/gskpathstroke.c
index 2108d21aaa..66aa22b144 100644
--- a/gsk/gskpathstroke.c
+++ b/gsk/gskpathstroke.c
@@ -996,7 +996,10 @@ curve_intersection (Curve            *c1,
 
 typedef struct
 {
-  GskCurve curve;
+  GskPathOperation op;
+  int n_pts;
+  graphene_point_t pts[4]; /* points of the curve */
+  float w;
 
   graphene_point_t r[4]; /* offset to the right */
   graphene_point_t l[4]; /* offset to the left */
@@ -1005,37 +1008,6 @@ typedef struct
   float angle[2]; /* angles between tangents at the both ends */
 } PathOpData;
 
-/* Compute the curve that results from offsetting the control points */
-static void
-offset_curve (const GskCurve *c,
-              float           distance,
-              GskCurve       *o)
-{
-  graphene_vec2_t n;
-  graphene_point_t p[4];
-
-  switch (c->op)
-    {
-    case GSK_PATH_LINE:
-      normal_vector (&c->line.points[0], &c->line.points[1], &n);
-      scale_point (&c->line.points[0], &n, distance, &p[0]);
-      scale_point (&c->line.points[1], &n, distance, &p[1]);
-      gsk_curve_initialize (o, gsk_patho_encode (GSK_PATH_LINE, p);
-      break;
-    case GSK_PATH_CURVE:
-      normal_vector (&c->curve.points[0], &c->curve.points[1], &n1);
-      scale_point (&c->curve.points[0], &n, distance, &p[0]);
-      scale_point (&c->curve.points[1], &n, distance, &p[1]);
-      break;
-    case GSK_PATH_CONIC:
-      break;
-    case GSK_PATH_CLOSE:
-    case GSK_PATH_MOVE:
-    default:
-      g_assert_not_reached ();
-    }
-}
-
 static void
 compute_offsets (PathOpData *op,
                  float       d)
@@ -1226,10 +1198,11 @@ path_op_data_new (GskPathOperation        op,
   int i;
 
   d = g_new0 (PathOpData, 1);
-  if (op == GSK_PATH_CONIC)
-    gsk_curve_init (&d->curve, gsk_pathop_encode (op, { pts[0], pts[1], { w,}, pts[2] }));
-  else
-    gsk_curve_init (&d->curve, gsk_pathop_encode (op, pts));
+  d->op = op;
+  for (i = 0; i < n_pts; i++)
+    d->pts[i] = pts[i];
+  d->n_pts = n_pts;
+  d->w = w;
 
 #if STROKE_DEBUG
   /* detect uninitialized values */


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