Esempio n. 1
0
void vegaSetColor(VGPaint paint, VGuint rgba)
{
   struct vg_context *ctx = vg_current_context();

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

   if (!vg_object_is_valid((void*)paint, VG_OBJECT_PAINT)) {
      vg_set_error(ctx, VG_BAD_HANDLE_ERROR);
      return;
   }
   {
      struct vg_paint *p = (struct vg_paint *)paint;
      paint_set_colori(p, rgba);
   }
}
Esempio n. 2
0
void vegaSetColor(VGPaint paint, VGuint rgba)
{
   struct vg_context *ctx = vg_current_context();
   struct vg_paint *p;

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

   if (!vg_object_is_valid(paint, VG_OBJECT_PAINT)) {
      vg_set_error(ctx, VG_BAD_HANDLE_ERROR);
      return;
   }

   p = handle_to_paint(paint);
   paint_set_colori(p, rgba);

   if (ctx->state.vg.fill_paint == p ||
       ctx->state.vg.stroke_paint == p)
      ctx->state.dirty |= PAINT_DIRTY;
}