diff options
author | Andrea Canciani <ranma42@gmail.com> | 2010-12-09 22:00:15 +0100 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2010-12-10 11:04:48 +0100 |
commit | 85a489f0f212d68c69dbe5807b379b874daef4d1 (patch) | |
tree | 9ed5ed594d67aa84afa62b28b09f679e0abcd9a9 /src/cairo-polygon.c | |
parent | 75f34b595aead729b6f6a7017c8790d68dfa0326 (diff) |
polygon: Merge _cairo_polygon_init and _cairo_polygon_limit
_cairo_polygon_limit() had to be called immediately after
_cairo_polygon_init() (or never at all).
Merging the two calls is a simple way to enforce this rule.
Diffstat (limited to 'src/cairo-polygon.c')
-rw-r--r-- | src/cairo-polygon.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/cairo-polygon.c b/src/cairo-polygon.c index e5c4f96c..c3f3631d 100644 --- a/src/cairo-polygon.c +++ b/src/cairo-polygon.c @@ -1,3 +1,4 @@ +/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */ /* cairo - a vector graphics library with display and print output * * Copyright © 2002 University of Southern California @@ -39,8 +40,12 @@ #include "cairo-error-private.h" void -_cairo_polygon_init (cairo_polygon_t *polygon) +_cairo_polygon_init (cairo_polygon_t *polygon, + const cairo_box_t *limits, + int num_limits) { + int n; + VG (VALGRIND_MAKE_MEM_UNDEFINED (polygon, sizeof (cairo_polygon_t))); polygon->status = CAIRO_STATUS_SUCCESS; @@ -50,18 +55,8 @@ _cairo_polygon_init (cairo_polygon_t *polygon) polygon->edges = polygon->edges_embedded; polygon->edges_size = ARRAY_LENGTH (polygon->edges_embedded); - polygon->num_limits = 0; - polygon->extents.p1.x = polygon->extents.p1.y = INT32_MAX; polygon->extents.p2.x = polygon->extents.p2.y = INT32_MIN; -} - -void -_cairo_polygon_limit (cairo_polygon_t *polygon, - const cairo_box_t *limits, - int num_limits) -{ - int n; polygon->limits = limits; polygon->num_limits = num_limits; |