Re: zero size textures?
`VL <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <[email protected]> |
On 16.12.2017 20:48, Uli Schlachter wrote: > On 16.12.2017 16:18, `VL wrote: >> On 16.12.2017 12:48, Uli Schlachter wrote: > [...] >>>> So the question - is it ok to call cairo functions with zero sizes >>>> and expect some valid result? Could it be some bug in cairo (xcb backend) ? >>> Look at cairo_status() and/or cairo_surface_status(). Once an object >>> ends up in an error state, all operations in it will fail. >> ok, this explains why further rendering stops. >> But I can't find a function to reset state and somehow rollback operation. >> My app did all operations in a block of cairo_save/cairo_restore, but it >> doesn't seem to help with error state. >> >> Or am I supposed to re-create whole context on any error? > [...] > I'm afraid that errors are sticky. I guess you are supposed not to cause > any, sorry. > > Can't you check for a scale of zero before doing cairo_scale() and if > you see a zero there, you just skip the whole block of drawing operations? yes, of course. This is what I'm doing now to avoid bad call. I think it's worth to improve documentation: particularly cairo_scale() doesn't mention which parameters are accepted, and which would lead to incorrect context. > > Cheers, > Uli -- cairo mailing list [email protected] https://lists.cairographics.org/mailman/listinfo/cairo