surface locking

Darren V Hart <[email protected]> 07 Aug 2003 17:38:26 -0600
Newsgroups gmane.comp.embedded.stk.gui.devel
Message-ID <1060299506.24170.4.camel@brain>
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.