On Tue, Aug 24, 2010 at 01:25:55PM +0000, A. Steinhoff wrote:
> >AG_PixmapFromSurface() will
> > only map the surface argument without duplicating it, so the surface
> > must remain valid for the lifetime of the widget.
> 
> Yes, that's the case ... but when I close the window by a mouse click the
> notebook widget will be removed. The crash happens then at rendering time ...
> Do we have here a race condition with a worker thread and the rendering 
> action ?

Agar itself doesn't use threads. It's thread-safe, but it does not create
threads for anything.

> I do also call cyclic AG_PixmapSetSurface() which is using a reference of the
> pixel array of the related notbook tap.
> 
> Yes, it's a real killer if you close the referenced window :)
> But a crash happens also w/o calling AG_PixmapSetSurface().

Can you try again without the AG_PIXMAP_RESCALE flag?

> > AG_PixmapFromSurfaceCopy(), however, will implicitely duplicate the
> > surface for you.
> 
> It's odd ... but it doesn't work with AG_PixmapFromSurfaceCopy() =:-]

It doesn't work how? The only difference between the two is that
AG_PixmapFromSurfaceCopy() uses AG_SurfaceDup() on the surface
argument. If it crashes there, you have an invalid surface.

> > To be consistent with what most other widgets use for functions accepting
> > surface arguments, I should really rename them:
> > 
> >     AG_PixmapFromSurfaceCopy() -> AG_PixmapFromSurface()
> >     AG_PixmapFromSurface() -> AG_PixmapFromSurfaceNODUP()
> > 
> > but unfortunately I can't do that without breaking compatibility.
> 
> The names of the lib calls are somtimes real odd ... e.g.  
> AG_PixmapSetSurface()
> does request a refresh. What about AG_PixmapReqRefresh instead ?

AG_PixmapSetSurface() is intended for switching between your surfaces when
multiple surfaces are in use; it happens to set the internal AG_PIXMAP_UPDATE
flag (indicating that, if AG_PIXMAP_RESCALE is in use, the cached rescaled
surface should be updated).

Unless I'm misunderstanding, you're suggesting something like
AG_PixmapSetSurface() but without the "name" argument. Of so, why would you
need to explicitely update the rescaled surface from your code? All of the
relevant routines should already be doing that internally.

> The semantic of the library calls are real week documented. That's a pitty
> because that lib is very, very nice!!

Could you give me some examples? How would you improve the AG_Pixmap manual
page, for instance? We spent a lot of effort making sure every aspect of
every library call is documented.

_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html

Reply via email to