[cairo] CAIRO_STATUS_NO_MEMORY when passing incorrect scaling

Peter Clifton pcjc2 at cam.ac.uk
Thu Jan 1 05:20:50 PST 2009


Hi guys,

I noticed, as I was debugging some drawing code, that after a certain
error in my code, all further cairo output was stopped.

I tracked the problem down to an incorrect scale factor I was passing to
cairo_scale(), I was in fact passing the X scale factor as 0. due to a
corner case being hit at a certain zoom factor.

What puzzled me in trying to track this down, is that the surface's
error state was CAIRO_STATUS_NO_MEMORY (at least,
cairo_status_to_string() reported no memory).

Is this the expected error status for this kind of problem with the
surface transformation matrix? Should this error be recoverable?

In my case, the cairo context became basically useless after that one
mistaken operation, in spite the fact that I reset the CTM afterwards
with a cairo_identity_matrix() call, all further drawing operations
failed.

I've since fixed my code, but wondered whether the behaviour I saw
constituted a bug which needed reporting.

Best regards,

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



More information about the cairo mailing list