Re: [hatari-devel] OS X performance problem |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Hi,
On perjantai 30 toukokuu 2014, Thomas Huth wrote:
> Hmmm, ... and according to the man-page of SDL_UpdateRects:
>
> It is adviced to call this function only once per frame, since
> each call has some processing overhead. This is no restriction
> since you can pass any number of rectangles each time.
SDL_UpdateRect() doesn't mention that:
http://sdl.beuc.net/sdl.wiki/SDL_UpdateRect
Any idea whether OSX backend of that also does Vsync?
> So this is likely not only a problem on Mac OS X. I think we should
> somehow rework the code so that SDL_UpdateRects is only called once per
> frame. I see two possibilities:
>
> 1) Statusbar_Update does not do the update on its own but passes a
> rectangle list to the caller so the caller can do an SDL_UpdateRects
> with all areas.
>
> 2) Statusbar_Update does not do the update on its own but passes a flag
> to the caller whether the statusbar has been changed. If it has been
> changed, the caller simply updates the whole window instead of only
> updating the ST screen area.
>
> Eero, what do you think? Could you maybe implement such a solution? (or
> shall I have a try?)
Sure, I can do that. It will actually simplify statusbar.c code.
Statusbar update is called from quite many places though, and some
of them don't (currently) do any screen activity themselves:
$ grep '\bStatusbar_Update\b' *.c */*.c
main.c: Statusbar_Update(sdlscrn);
main.c: Statusbar_Update(sdlscrn);
screen.c: Statusbar_Update(sdlscrn);
debug/debugui.c: Statusbar_Update(sdlscrn);
falcon/hostscreen.c: Statusbar_Update(sdlscrn);
gui-sdl/dlgScreen.c: Statusbar_Update(sdlscrn);
gui-sdl/dlgScreen.c: Statusbar_Update(sdlscrn);
So it can uglify code by spreading screen update stuff around
a bit. Or the update function needs also an arg flag for
whether it should do the update itself. Let's see which
looks better.
- Eero