}
CoglPath *
-cogl_path_get (void)
-{
- _COGL_GET_CONTEXT (ctx, NULL);
-
- return ctx->current_path;
-}
-
-void
-cogl_path_set (CoglPath *path)
-{
- _COGL_GET_CONTEXT (ctx, NO_RETVAL);
-
- if (!cogl_is_path (path))
- return;
-
- /* Reference the new object first in case it is the same as the old
- object */
- cogl_object_ref (path);
- cogl_object_unref (ctx->current_path);
- ctx->current_path = path;
-}
-
-CoglPath *
_cogl_path_new (void)
{
CoglPath *path;
}
#endif
+
+CoglPath *
+cogl_get_path (void)
+{
+ _COGL_GET_CONTEXT (ctx, NULL);
+
+ return ctx->current_path;
+}
+
+void
+cogl_set_path (CoglPath *path)
+{
+ _COGL_GET_CONTEXT (ctx, NO_RETVAL);
+
+ if (!cogl_is_path (path))
+ return;
+
+ /* Reference the new object first in case it is the same as the old
+ object */
+ cogl_object_ref (path);
+ cogl_object_unref (ctx->current_path);
+ ctx->current_path = path;
+}
+
BLOCK_SIZE, BLOCK_SIZE);
cogl_path_rectangle (BLOCK_SIZE / 2, BLOCK_SIZE / 2,
BLOCK_SIZE * 3 / 4, BLOCK_SIZE);
- path_a = cogl_handle_ref (cogl_path_get ());
+ path_a = cogl_handle_ref (cogl_get_path ());
draw_path_at (0, 0);
/* Create another path filling the whole block */
cogl_path_rectangle (0, 0, BLOCK_SIZE, BLOCK_SIZE);
- path_b = cogl_handle_ref (cogl_path_get ());
+ path_b = cogl_handle_ref (cogl_get_path ());
draw_path_at (1, 0);
/* Draw the first path again */
- cogl_path_set (path_a);
+ cogl_set_path (path_a);
draw_path_at (2, 0);
/* Draw a copy of path a */
path_c = cogl_path_copy (path_a);
- cogl_path_set (path_c);
+ cogl_set_path (path_c);
draw_path_at (3, 0);
/* Add another rectangle to path a. We'll use line_to's instead of
cogl_rectangle so that we don't create another sub-path because
that is more likely to break the copy */
- cogl_path_set (path_a);
+ cogl_set_path (path_a);
cogl_path_line_to (0, BLOCK_SIZE / 2);
cogl_path_line_to (0, 0);
cogl_path_line_to (BLOCK_SIZE / 2, 0);
draw_path_at (4, 0);
/* Draw the copy again. It should not have changed */
- cogl_path_set (path_c);
+ cogl_set_path (path_c);
draw_path_at (5, 0);
/* Add another rectangle to path c. It will be added in two halves,
one as an extension of the previous path and the other as a new
sub path */
- cogl_path_set (path_c);
+ cogl_set_path (path_c);
cogl_path_line_to (BLOCK_SIZE / 2, 0);
cogl_path_line_to (BLOCK_SIZE * 3 / 4, 0);
cogl_path_line_to (BLOCK_SIZE * 3 / 4, BLOCK_SIZE / 2);
draw_path_at (6, 0);
/* Draw the original path again. It should not have changed */
- cogl_path_set (path_a);
+ cogl_set_path (path_a);
draw_path_at (7, 0);
cogl_handle_unref (path_a);