amiga-mui / muidev

:mage_man: Magic User Interface (MUI) – Documentation+Releases
http://muidev.de
55 stars 0 forks source link

Support flicker-free live resizing on OS4 #356

Closed afalkenhahn closed 2 years ago

afalkenhahn commented 2 years ago

I have written a custom class which draws a number of thumbnails. Whenever the window size changes, the thumbnails are automatically rearranged according to the available window space. Since OS4 redraws windows during resizing, this leads to a lot of flickering when resizing the window.

MorphOS's MUI seems to draw this much more efficiently because on MorphOS there is no flickering at all, although it also does live window resizing. It would be nice if OS4's MUI could also support flicker-free live resizing as on MorphOS because with the current flickering this looks and feels quite ugly for the end user.

On OS3 this isn't a problem because OS3 doesn't support live window resizing. It's something that's specifically needed for OS4.

afalkenhahn commented 2 years ago

Ok, I'm setting MUIA_FillArea to FALSE now which makes the flickering go away. Still, on MorphOS there's no flicker even without setting MUIA_FillArea to FALSE so it looks like drawing on MorphOS is somewhat more efficient.

tboeckel commented 2 years ago

MorphOS has doublebuffering implemented and enabled, that's why you don't see any duplicate blitting effects.

If your thumbnail covers the whole area (i.e. there is no transparent area), then filling the area with the background pattern first and then drawing the thumbnail all over the filled background again makes no sense and causes unnecessary graphics operations. But if there are any transparent areas, then you MUST use MUIA_FillArea=TRUE, otherwise you will end up with graphical articfacts when resizing the window.

Additionally you might want to set MUIA_DoubleBuffer=TRUE for the thumbnail object, or even for their parent object. This causes all subobjects to be drawn to an off screen bitmap first and finally draw that offscreen bitmap with just a single blit onto the screen, instead of doing lots of individual small blits for each thumbnail.