[cairo] zero size textures?
bryce at osg.samsung.com
Fri Jan 5 01:56:19 UTC 2018
On Sat, Dec 16, 2017 at 09:26:26PM +0300, `VL wrote:
> 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.
Good idea, would you mind suggesting a revised text phrasing?
More information about the cairo