summaryrefslogtreecommitdiff
path: root/src/cairo-path-fixed-private.h
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2010-10-16 23:57:06 +0200
committerAndrea Canciani <ranma42@gmail.com>2010-10-29 17:31:21 +0200
commite9c1fc31887c5bfbb7d086f923a7628b7cfa739c (patch)
treeeb09b160574905223235f4efb45e0e165689946a /src/cairo-path-fixed-private.h
parent14cc9846b302a990e65d7572e7f095a8873a213d (diff)
downloadcairo-e9c1fc31887c5bfbb7d086f923a7628b7cfa739c.tar.gz
path: Do not access flags directly
Use inline accessors to hide the flags in the code. This ensures that flags that need additional computations (example: is_rectilinear for the fill case) are always used correctly.
Diffstat (limited to 'src/cairo-path-fixed-private.h')
-rw-r--r--src/cairo-path-fixed-private.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/cairo-path-fixed-private.h b/src/cairo-path-fixed-private.h
index 42e64eda3..5d665dbdf 100644
--- a/src/cairo-path-fixed-private.h
+++ b/src/cairo-path-fixed-private.h
@@ -139,7 +139,7 @@ _cairo_path_fixed_fill_is_empty (const cairo_path_fixed_t *path)
}
static inline cairo_bool_t
-_cairo_path_fixed_is_rectilinear_fill (const cairo_path_fixed_t *path)
+_cairo_path_fixed_fill_is_rectilinear (const cairo_path_fixed_t *path)
{
if (! path->is_rectilinear)
return 0;
@@ -153,13 +153,25 @@ _cairo_path_fixed_is_rectilinear_fill (const cairo_path_fixed_t *path)
}
static inline cairo_bool_t
-_cairo_path_fixed_maybe_fill_region (const cairo_path_fixed_t *path)
+_cairo_path_fixed_stroke_is_rectilinear (const cairo_path_fixed_t *path)
{
-#if WATCH_PATH
- fprintf (stderr, "_cairo_path_fixed_maybe_fill_region () = %s\n",
- path->maybe_fill_region ? "true" : "false");
-#endif
- return path->maybe_fill_region;
+ return path->is_rectilinear;
+}
+
+static inline cairo_bool_t
+_cairo_path_fixed_fill_maybe_region (const cairo_path_fixed_t *path)
+{
+ if (! path->maybe_fill_region)
+ return FALSE;
+
+ if (! path->has_current_point)
+ return TRUE;
+
+ /* check whether the implicit close preserves the rectilinear property
+ * (the integer point property is automatically preserved)
+ */
+ return path->current_point.x == path->last_move_point.x ||
+ path->current_point.y == path->last_move_point.y;
}
#endif /* CAIRO_PATH_FIXED_PRIVATE_H */