summaryrefslogtreecommitdiff
path: root/cogl/cogl-clip-state.c
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2010-11-04 00:27:47 +0000
committerRobert Bragg <robert@linux.intel.com>2010-11-11 13:17:26 +0000
commitcce8645aba8d076e250e4efe93e8689585aa12f5 (patch)
tree9aed25edbbf1bbba8aeabaaf296f7594c9180129 /cogl/cogl-clip-state.c
parent1b75ad9c80e250a56e3c049bfd3bd166641a5cbb (diff)
downloadcogl-cce8645aba8d076e250e4efe93e8689585aa12f5.tar.gz
path 2.0: update path API for experimental 2.0 API
When COGL_ENABLE_EXPERIMENTAL_2_0_API is defined cogl.h will now include cogl2-path.h which changes cogl_path_new() so it can directly return a CoglPath pointer; it no longer exposes a prototype for cogl_{get,set}_path and all the remaining cogl_path_ functions now take an explicit path as their first argument. The idea is that we want to encourage developers to retain path objects for as long as possible so they can take advantage of us uploading the path geometry to the GPU. Currently although it is possible to start a new path and query the current path, it is not convenient. The other thing is that we want to get Cogl to the point where nothing depends on a global, current context variable. This will allow us to one day define a sensible threading model if/when that is ever desired.
Diffstat (limited to 'cogl/cogl-clip-state.c')
-rw-r--r--cogl/cogl-clip-state.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/cogl/cogl-clip-state.c b/cogl/cogl-clip-state.c
index e261405a..71d4d4dc 100644
--- a/cogl/cogl-clip-state.c
+++ b/cogl/cogl-clip-state.c
@@ -176,16 +176,20 @@ cogl_clip_push_from_path_preserve (void)
cogl_get_modelview_matrix (&modelview_matrix);
clip_state->stacks->data =
- _cogl_clip_stack_push_from_path (clip_state->stacks->data, cogl_get_path (),
+ _cogl_clip_stack_push_from_path (clip_state->stacks->data,
+ ctx->current_path,
&modelview_matrix);
}
void
cogl_clip_push_from_path (void)
{
+ _COGL_GET_CONTEXT (ctx, NO_RETVAL);
+
cogl_clip_push_from_path_preserve ();
- cogl_path_new ();
+ cogl_object_unref (ctx->current_path);
+ ctx->current_path = cogl2_path_new ();
}
static void