Exemple #1
0
void
cogl_primitive_draw (CoglPrimitive *primitive,
                     CoglFramebuffer *framebuffer,
                     CoglPipeline *pipeline)
{
  _cogl_primitive_draw (primitive, framebuffer, pipeline, 0 /* flags */);
}
Exemple #2
0
static void
paint_primitive_silhouette (CoglFramebuffer *framebuffer,
                            CoglPipeline *pipeline,
                            void *user_data)
{
  _cogl_primitive_draw (user_data,
                        framebuffer,
                        pipeline,
                        COGL_DRAW_SKIP_JOURNAL_FLUSH |
                        COGL_DRAW_SKIP_PIPELINE_VALIDATION |
                        COGL_DRAW_SKIP_FRAMEBUFFER_FLUSH);
}
Exemple #3
0
void
_cogl_path_fill_nodes (CoglPath *path,
                       CoglFramebuffer *framebuffer,
                       CoglPipeline *pipeline,
                       CoglDrawFlags flags)
{
  if (path->data->path_nodes->len == 0)
    return;

  /* If the path is a simple rectangle then we can divert to using
     cogl_framebuffer_draw_rectangle which should be faster because it
     can go through the journal instead of uploading the geometry just
     for two triangles */
  if (path->data->is_rectangle && flags == 0)
    {
      float x_1, y_1, x_2, y_2;

      _cogl_path_get_bounds (path, &x_1, &y_1, &x_2, &y_2);
      cogl_framebuffer_draw_rectangle (framebuffer,
                                       pipeline,
                                       x_1, y_1,
                                       x_2, y_2);
    }
  else
    {
      CoglBool needs_fallback = FALSE;
      CoglPrimitive *primitive;

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

      primitive = _cogl_path_get_fill_primitive (path);

      _cogl_primitive_draw (primitive,
                            framebuffer,
                            pipeline,
                            flags);
    }
}