Re: surface locking

Marc Strämke <[email protected]> Tue, 12 Aug 2003 14:16:52 +0200
Newsgroups gmane.comp.embedded.stk.gui.devel
Message-ID <[email protected]>
Darren V Hart wrote:
> We need to discuss how we want to handle backends that require surface
> locking prior to direct access.  I think the API should state that
> put_pixel*() and get_pixel*() should be called with the surface locked,
> and that their behavior is undefined if the surface is not locked.  This
> will allow the high level drawing routines to call lock and unlock as
> necessary.  ie draw_poly calls draw_line, but the user may call
> draw_line as well, so we must be able to recursively call lock without
> blocking.  To draw a single pixel, the use must call draw_pixel*() which
> must lock, call put_pixel, and unlock.
> 
> It may be of use to provide a surface::lock(void) to simply lock the
> surface and not fill in the double pointer buf field etc.
> 
> Comments welcome.

I think we are talking about two different kind of locks here, the type 
i mentioned when we invented the API was for direct memory access to 
graphic memory, so the biggest purpose is getting the pointer, the kind 
you are thinking of is backend specific and needs no api. (I M O)