[cairo-commit] src/cairo-path-fixed.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Sep 16 08:14:27 PDT 2011


 src/cairo-path-fixed.c |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 1ce5d4707cf260618bd4d61f39aad4371ffa3336
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Sep 16 16:11:42 2011 +0100

    path: Skip calls to zero-length memcpy
    
    We attempt to copy 0 points onto the array of path points for a
    close-path. This is pointless and an unnecessary function call under
    MSVC at least.
    
    Based on a patch by Steve Snyder, incorporating Behdad's review
    comments.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37836
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index c257d73..f4410b3 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -808,6 +808,9 @@ _cairo_path_buf_add_points (cairo_path_buf_t       *buf,
 			    const cairo_point_t    *points,
 			    int		            num_points)
 {
+    if (buf->num_points == 0)
+	return;
+
     memcpy (buf->points + buf->num_points,
 	    points,
 	    sizeof (points[0]) * num_points);


More information about the cairo-commit mailing list