[cairo] zero size textures?

Uli Schlachter psychon at znc.in
Sat Dec 16 17:48:26 UTC 2017

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?

- Captain, I think I should tell you I've never
  actually landed a starship before.
- That's all right, Lieutenant, neither have I.

More information about the cairo mailing list