[cairo-commit] 2 commits - src/cairo-botor-scan-converter.c src/cairo-path-stroke-polygon.c src/cairo-scaled-font-subsets.c

Uli Schlachter psychon at kemper.freedesktop.org
Sat May 5 01:15:28 PDT 2012


 src/cairo-botor-scan-converter.c |   36 -------------------------------
 src/cairo-path-stroke-polygon.c  |   44 ---------------------------------------
 src/cairo-scaled-font-subsets.c  |    5 ----
 3 files changed, 85 deletions(-)

New commits:
commit 138e595c1192c03ebc1b2c89851ce938b18abd2f
Author: Uli Schlachter <psychon at znc.in>
Date:   Tue May 1 14:48:43 2012 +0200

    Remove some dead code
    
    This code could never be executed, because the status variable doesn't get set
    since the last time it is checked and errors get returned to the caller.
    
    This was noticed while looking into the build log provided by
    http://lists.cairographics.org/archives/cairo/2012-April/022993.html
    
    Reported-by: Ryan Schmidt <cairo-2012b at ryandesign.com>
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/src/cairo-scaled-font-subsets.c b/src/cairo-scaled-font-subsets.c
index 355245a..e78e0c2 100644
--- a/src/cairo-scaled-font-subsets.c
+++ b/src/cairo-scaled-font-subsets.c
@@ -522,11 +522,6 @@ _cairo_sub_font_add_glyph (cairo_sub_font_t	   *sub_font,
     y_advance = scaled_glyph->metrics.y_advance;
     _cairo_scaled_font_thaw_cache (sub_font->scaled_font);
 
-    if (unlikely (status)) {
-	_cairo_sub_font_glyph_destroy (sub_font_glyph);
-	return status;
-    }
-
     if (!is_latin && sub_font->num_glyphs_in_current_subset == sub_font->max_glyphs_per_subset)
     {
 	sub_font->current_subset++;
commit 494cfd7eb9d994a5e2024e299986e66a3ef9a562
Author: Uli Schlachter <psychon at znc.in>
Date:   Tue May 1 14:38:51 2012 +0200

    Remove some unused functions
    
    All of these are unused since af9fbd176b145f0424 "Introduce a new compositor
    architecture". Since no one complained yet, I guess that means that we don't
    need these any more. :-)
    
    This was noticed while looking into the build log provided by
    http://lists.cairographics.org/archives/cairo/2012-April/022993.html
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/src/cairo-botor-scan-converter.c b/src/cairo-botor-scan-converter.c
index 2729463..515305b 100644
--- a/src/cairo-botor-scan-converter.c
+++ b/src/cairo-botor-scan-converter.c
@@ -2128,42 +2128,6 @@ botor_add_edge (cairo_botor_scan_converter_t *self,
     return CAIRO_STATUS_SUCCESS;
 }
 
-static cairo_status_t
-_cairo_botor_scan_converter_add_edge (void		*converter,
-				      const cairo_point_t *p1,
-				      const cairo_point_t *p2,
-				      int top, int bottom,
-				      int dir)
-{
-    cairo_botor_scan_converter_t *self = converter;
-    cairo_edge_t edge;
-
-    edge.line.p1 = *p1;
-    edge.line.p2 = *p2;
-    edge.top = top;
-    edge.bottom = bottom;
-    edge.dir = dir;
-
-    return botor_add_edge (self, &edge);
-}
-
-static cairo_status_t
-_cairo_botor_scan_converter_add_polygon (void		*converter,
-					 const cairo_polygon_t *polygon)
-{
-    cairo_botor_scan_converter_t *self = converter;
-    cairo_status_t status;
-    int i;
-
-    for (i = 0; i < polygon->num_edges; i++) {
-	status = botor_add_edge (self, &polygon->edges[i]);
-	if (unlikely (status))
-	    return status;
-    }
-
-    return CAIRO_STATUS_SUCCESS;
-}
-
 static void
 _cairo_botor_scan_converter_destroy (void *converter)
 {
diff --git a/src/cairo-path-stroke-polygon.c b/src/cairo-path-stroke-polygon.c
index 7b485a1..919e7db 100644
--- a/src/cairo-path-stroke-polygon.c
+++ b/src/cairo-path-stroke-polygon.c
@@ -232,50 +232,6 @@ join_is_clockwise (const cairo_stroke_face_t *in,
     return _cairo_slope_compare (&in->dev_vector, &out->dev_vector) < 0;
 }
 
-static cairo_int64_t
-distance_from_face (const cairo_stroke_face_t *face,
-		    const cairo_point_t *p,
-		    cairo_bool_t negate)
-{
-    int32_t dx = (p->x - face->point.x);
-    int32_t dy = (p->y - face->point.y);
-    cairo_int64_t d;
-
-    d = _cairo_int64_sub (_cairo_int32x32_64_mul (dx, face->dev_vector.dy),
-			  _cairo_int32x32_64_mul (dy, face->dev_vector.dx));
-    if (negate)
-	d = _cairo_int64_negate (d);
-    return d;
-}
-
-static cairo_int64_t
-distance_along_face (const cairo_stroke_face_t *face,
-		    const cairo_point_t *p)
-{
-    int32_t dx = (p->x - face->point.x);
-    int32_t dy = (p->y - face->point.y);
-    return _cairo_int64_add (_cairo_int32x32_64_mul (dx, face->dev_vector.dx),
-			     _cairo_int32x32_64_mul (dy, face->dev_vector.dy));
-}
-
-static void
-compute_inner_joint (cairo_point_t *p1, cairo_int64_t d_p1,
-		     const cairo_point_t *p2, cairo_int64_t d_p2,
-		     cairo_int64_t half_line_width)
-{
-    int32_t dx = p2->x - p1->x;
-    int32_t dy = p2->y - p1->y;
-
-    half_line_width = _cairo_int64_sub (half_line_width, d_p1);
-    d_p2 = _cairo_int64_sub (d_p2, d_p1);
-
-    p1->x += _cairo_int_96by64_32x64_divrem (_cairo_int64x32_128_mul (half_line_width, dx),
-					      d_p2).quo;
-
-    p1->y += _cairo_int_96by64_32x64_divrem (_cairo_int64x32_128_mul (half_line_width, dy),
-					      d_p2).quo;
-}
-
 static void
 inner_join (struct stroker *stroker,
 	    const cairo_stroke_face_t *in,


More information about the cairo-commit mailing list