Beispiel #1
0
void
_cogl_path_fill_nodes (CoglPath *path, CoglDrawFlags flags)
{
  gboolean needs_fallback = FALSE;
  CoglPipeline *pipeline = cogl_get_source ();

  _cogl_pipeline_foreach_layer_internal (pipeline,
                                         validate_layer_cb, &needs_fallback);
  if (needs_fallback)
    {
      _cogl_path_fill_nodes_with_clipped_rectangle (path);
      return;
    }

  _cogl_path_build_fill_attribute_buffer (path);

  _cogl_framebuffer_draw_indexed_attributes (cogl_get_draw_framebuffer (),
                                             pipeline,
                                             COGL_VERTICES_MODE_TRIANGLES,
                                             0, /* first_vertex */
                                             path->data->fill_vbo_n_indices,
                                             path->data->fill_vbo_indices,
                                             path->data->fill_attributes,
                                             COGL_PATH_N_ATTRIBUTES,
                                             flags);
}
Beispiel #2
0
static CoglPrimitive *
_cogl_path_get_fill_primitive (CoglPath *path)
{
  if (path->data->fill_primitive)
    return path->data->fill_primitive;

  _cogl_path_build_fill_attribute_buffer (path);

  path->data->fill_primitive =
    cogl_primitive_new_with_attributes (COGL_VERTICES_MODE_TRIANGLES,
                                        path->data->fill_vbo_n_indices,
                                        path->data->fill_attributes,
                                        COGL_PATH_N_ATTRIBUTES);
  cogl_primitive_set_indices (path->data->fill_primitive,
                              path->data->fill_vbo_indices,
                              path->data->fill_vbo_n_indices);

  return path->data->fill_primitive;
}