[cairo] Re: Notes on cairo/win32

Owen Taylor otaylor at redhat.com
Wed Jan 12 10:32:41 PST 2005


On Wed, 2005-01-12 at 12:39 -0500, Dimitrie O. Paun wrote:

> > > Theoretically, we would need a software renderer to implement them
> > > properly, but that's a lot of work, and we don't have the resources 
> > > to do it currently. So we have to play all sorts of silly games with 
> > > the X server, bouncing the image back an forth (GDI operations must 
> > > coherently modify the DIB with any direct memory modification 
> > > performed by the application). This is both rather nasty and slow.
> > 
> > Doesn't the need for apps to use GdiFlush() help in reducing
> > synchronization with the server? But yes, consistent rendering between
> > client and server is a nice feature of Cairo.
> 
> Thing is that you don't have to do a GdiFlush or anything to
> directly manipulate a DIB. You can just draw a line, change
> some bytes in memory directly, draw something else, and it
> should just work. To achieve that we trap any memory accesses
> to the DIB, and copy the image back and forth from the server
> on any such access. U-g-l-y.

The platform SDK docs for CreateDIBSection say:
  
 Windows NT/2000/XP: You need to guarantee that the GDI subsystem has  
 completed any drawing to a bitmap created by CreateDIBSection before
 you draw to the bitmap yourself. Access to the bitmap must be
 synchronized. Do this by calling the GdiFlush function. This applies to
 any use of the pointer to the bitmap bit values, including passing the
 pointer in calls to functions such as SetDIBits.

It's very possible that Microsoft is just making threatening noises, and
found that requiring GdiFlush here wasn't sufficiently compatible.

Regards,
						Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050112/92119116/attachment.pgp


More information about the cairo mailing list