[cairo] Copying of clip not working for PS surface

Fred Kiefer fredkiefer at gmx.de
Tue Oct 23 01:05:23 PDT 2007


About a week ago I send this mail to the mailing list, but didn't get
any reply.
What I need to know is if this is intended behaviour and if there is a
way to work around it. If necessary, I could provide you with some
background information, where and why the copying of the current clip
range is needed in GNUstep (We use it to work around another limitation
of cairo).

Cheers,
Fred


Fred Kiefer wrote:
> Is anybody able to explain why the following short program gives the
> output "Cairo status 'clip region not representable in desired format'
> in copy clip"?
> 
> The same operations work fine when applied to an image surface.
> 
> Thank you
> Fred
> 
> #include <stddef.h>
> #include <cairo.h>
> #include <cairo-ps.h>
> 
> int
> main (int argc, const char *argv[])
> {
>   cairo_status_t status;
>   cairo_t *ct;
>   cairo_surface_t *surface;
>   cairo_rectangle_list_t *clip_rects;
> 
>   surface = cairo_ps_surface_create("test.ps", 100, 100);
>   status = cairo_surface_status(surface);
>   if (status != CAIRO_STATUS_SUCCESS)
>     {
>       printf("Cairo status '%s' for surface\n",
> cairo_status_to_string(status));
>       return 0;
>     }
> 
>   ct = cairo_create(surface);
>   status = cairo_status(ct);
>   if (status != CAIRO_STATUS_SUCCESS)
>     {
>       printf("Cairo status '%s' for context\n",
> cairo_status_to_string(status));
>       return 0;
>     }
> 
>   cairo_rectangle(ct, 10, 10, 80, 80);
>   cairo_clip(ct);
>   clip_rects = cairo_copy_clip_rectangle_list(ct);
>   status = clip_rects->status;
>   if (status != CAIRO_STATUS_SUCCESS)
>     {
>       printf("Cairo status '%s' in copy clip\n",
> cairo_status_to_string(status));
>     }
> 
>   cairo_destroy(ct);
>   cairo_surface_destroy(surface);
> }
> 
> 
> 
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
> 



More information about the cairo mailing list