mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-05 06:50:21 +01:00
Remove CAIRO_BEGIN_DECLS and CAIRO_END_DECLS as they are not needed for private headers.
Add ASSERT_NOT_REACHED macro. Rewrite in terms of cairo_copt_path and cairo_copy_path_flat in preparation for removing cairo_gstate_interpret_path.
This commit is contained in:
parent
cb5bbd0aa7
commit
0ba7a082af
4 changed files with 73 additions and 17 deletions
11
ChangeLog
11
ChangeLog
|
|
@ -1,3 +1,14 @@
|
|||
2005-03-23 Carl Worth <cworth@cworth.org>
|
||||
|
||||
* src/cairo-path-data-private.h: Remove CAIRO_BEGIN_DECLS and
|
||||
CAIRO_END_DECLS as they are not needed for private headers.
|
||||
|
||||
* src/cairoint.h: Add ASSERT_NOT_REACHED macro.
|
||||
|
||||
* src/cairo.c: (cairo_get_path), (cairo_get_path_flat): Rewrite in
|
||||
terms of cairo_copt_path and cairo_copy_path_flat in preparation
|
||||
for removing cairo_gstate_interpret_path.
|
||||
|
||||
2005-03-23 Carl Worth <cworth@cworth.org>
|
||||
|
||||
* src/cairo-gstate-private.h:
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@
|
|||
|
||||
extern cairo_path_t _cairo_path_nil;
|
||||
|
||||
CAIRO_BEGIN_DECLS
|
||||
|
||||
cairo_path_t *
|
||||
_cairo_path_data_create (cairo_gstate_t *gstate);
|
||||
|
||||
|
|
@ -52,6 +50,4 @@ cairo_status_t
|
|||
_cairo_path_data_append_to_context (cairo_path_t *path,
|
||||
cairo_t *cr);
|
||||
|
||||
CAIRO_END_DECLS
|
||||
|
||||
#endif /* CAIRO_PATH_DATA_PRIVATE_H */
|
||||
|
|
|
|||
69
src/cairo.c
69
src/cairo.c
|
|
@ -2068,16 +2068,39 @@ cairo_get_path (cairo_t *cr,
|
|||
cairo_close_path_func_t *close_path,
|
||||
void *closure)
|
||||
{
|
||||
int i;
|
||||
cairo_path_t *path;
|
||||
cairo_path_data_t *data;
|
||||
|
||||
CAIRO_CHECK_SANITY (cr);
|
||||
if (cr->status)
|
||||
return;
|
||||
|
||||
cr->status = _cairo_gstate_interpret_path (cr->gstate,
|
||||
move_to,
|
||||
line_to,
|
||||
curve_to,
|
||||
close_path,
|
||||
closure);
|
||||
|
||||
path = cairo_copy_path (cr);
|
||||
|
||||
for (i=0; i < path->num_data; i += path->data[i].header.length) {
|
||||
data = &path->data[i];
|
||||
switch (data->header.type) {
|
||||
case CAIRO_PATH_MOVE_TO:
|
||||
(move_to) (closure, data[1].point.x, data[1].point.y);
|
||||
break;
|
||||
case CAIRO_PATH_LINE_TO:
|
||||
(line_to) (closure, data[1].point.x, data[1].point.y);
|
||||
break;
|
||||
case CAIRO_PATH_CURVE_TO:
|
||||
(curve_to) (closure,
|
||||
data[1].point.x, data[1].point.y,
|
||||
data[2].point.x, data[2].point.y,
|
||||
data[3].point.x, data[3].point.y);
|
||||
break;
|
||||
case CAIRO_PATH_CLOSE_PATH:
|
||||
(close_path) (closure);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
cairo_path_destroy (path);
|
||||
|
||||
CAIRO_CHECK_SANITY (cr);
|
||||
}
|
||||
DEPRECATE (cairo_current_path, cairo_get_path);
|
||||
|
|
@ -2089,16 +2112,36 @@ cairo_get_path_flat (cairo_t *cr,
|
|||
cairo_close_path_func_t *close_path,
|
||||
void *closure)
|
||||
{
|
||||
int i;
|
||||
cairo_path_t *path;
|
||||
cairo_path_data_t *data;
|
||||
|
||||
CAIRO_CHECK_SANITY (cr);
|
||||
if (cr->status)
|
||||
return;
|
||||
|
||||
cr->status = _cairo_gstate_interpret_path (cr->gstate,
|
||||
move_to,
|
||||
line_to,
|
||||
NULL,
|
||||
close_path,
|
||||
closure);
|
||||
path = cairo_copy_path_flat (cr);
|
||||
|
||||
for (i=0; i < path->num_data; i += path->data[i].header.length) {
|
||||
data = &path->data[i];
|
||||
switch (data->header.type) {
|
||||
case CAIRO_PATH_MOVE_TO:
|
||||
(move_to) (closure, data[1].point.x, data[1].point.y);
|
||||
break;
|
||||
case CAIRO_PATH_LINE_TO:
|
||||
(line_to) (closure, data[1].point.x, data[1].point.y);
|
||||
break;
|
||||
case CAIRO_PATH_CLOSE_PATH:
|
||||
(close_path) (closure);
|
||||
break;
|
||||
case CAIRO_PATH_CURVE_TO:
|
||||
ASSERT_NOT_REACHED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
cairo_path_destroy (path);
|
||||
|
||||
CAIRO_CHECK_SANITY (cr);
|
||||
}
|
||||
DEPRECATE (cairo_current_path_flat, cairo_get_path_flat);
|
||||
|
|
|
|||
|
|
@ -120,6 +120,12 @@
|
|||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#define ASSERT_NOT_REACHED \
|
||||
do { \
|
||||
static const int NOT_REACHED = 0; \
|
||||
assert (NOT_REACHED); \
|
||||
} while (0)
|
||||
|
||||
#include "cairo-wideint.h"
|
||||
|
||||
typedef int32_t cairo_fixed_16_16_t;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue