Exemple #1
0
CoglPath *
cogl_path_copy (CoglPath *old_path)
{
  CoglPath *new_path;

  _COGL_RETURN_VAL_IF_FAIL (cogl_is_path (old_path), NULL);

  new_path = g_slice_new (CoglPath);
  new_path->data = old_path->data;
  new_path->data->ref_count++;

  return _cogl_path_object_new (new_path);
}
Exemple #2
0
CoglPath *
cogl2_path_new (void)
{
  CoglPath *path;
  CoglPathData *data;

  path = g_slice_new (CoglPath);
  data = path->data = g_slice_new (CoglPathData);

  data->ref_count = 1;
  data->fill_rule = COGL_PATH_FILL_RULE_EVEN_ODD;
  data->path_nodes = g_array_new (FALSE, FALSE, sizeof (CoglPathNode));
  data->last_path = 0;
  data->fill_attribute_buffer = NULL;
  data->stroke_attribute_buffer = NULL;
  data->is_rectangle = FALSE;

  return _cogl_path_object_new (path);
}