Re: [AD] window resizing

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


In answer to your other email, I suppose you're right. If there is a context switch right when SCREEN_H is read then the results will be incorrect.

Becuase the screen bitmap can now change at any time, the user will be required to call acquire_screen()/release_screen() whenever accessing the screen. The user should be doing this anyway but becuase there was never any way for screen to be modified was not required.

Peter Wang wrote:

Jon Rafkind wrote:

The attached patch allows the X11 window driver to be resized. As explained before, when a ConfigureNotify XEvent is received, the global resize_screen() is called with the new screen width and height. resize_screen() checks to see if the driver can handle screen resizing and then calls gfx_driver->resize_window() which returns a bitmap. resize_screen sets the global screen bitmap to this bitmap and the resizing is complete. If a user callback is set, that is called at the end of resize_screen. I have added an entry to the GFX_DRIVER and updated all the drivers( i hope ).



So, assuming the callback is called from a background thread, what happens if the main thread is accessing the current screen bitmap when the resize takes place?

Peter


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/