void render_part(
    cairo_t *cr,
    struct part *part
  ) {
  struct path *path = &part->paths;

  cairo_set_line_width(cr, 1/32.0);
  while (path) {
    path_render(cr, path);
    path = path->next;
  }
}
Пример #2
0
void vgDrawPath(VGPath path, VGbitfield paintModes)
{
   struct vg_context *ctx = vg_current_context();

   if (path == VG_INVALID_HANDLE) {
      vg_set_error(ctx, VG_BAD_HANDLE_ERROR);
      return;
   }

   if (!(paintModes & (VG_STROKE_PATH | VG_FILL_PATH))) {
      vg_set_error(ctx, VG_ILLEGAL_ARGUMENT_ERROR);
      return;
   }

   if (path_is_empty((struct path*)path))
      return;
   path_render((struct path*)path, paintModes);
}
Пример #3
0
static void vg_render_glyph(struct vg_context *ctx,
                            struct vg_glyph *glyph,
                            VGbitfield paintModes,
                            VGboolean allowAutoHinting)
{
   if (glyph->object && paintModes) {
      struct vg_state *state = &ctx->state.vg;
      struct matrix m;

      m = state->glyph_user_to_surface_matrix;
      matrix_translate(&m,
            state->glyph_origin[0].f - glyph->glyph_origin[0],
            state->glyph_origin[1].f - glyph->glyph_origin[1]);

      if (glyph->object->type == VG_OBJECT_PATH) {
         path_render((struct path *) glyph->object, paintModes, &m);
      }
      else {
         assert(glyph->object->type == VG_OBJECT_IMAGE);
         image_draw((struct vg_image *) glyph->object, &m);
      }
   }
}