GNOME Bugzilla – Bug 688058
Make (some of) GnomeBG thread-safe
Last modified: 2013-02-19 20:00:01 UTC
The plan (bug 682427) is to move background rendering from gnome-settings-daemon to mutter. As gnome-shell already has issues to keep the frame-rate, I don't want to block the main loop doing the tons of sync IO GnomeBG needs. Instead, given that GnomeBG is fully software rendered, I want to render backgrounds in a worker thread, and the following patches allow me to do that. I didn't touch the cairo or X11 bits, as those are usually very tied to the main thread.
Created attachment 228651 [details] [review] GnomeBG: add a thread safe variant of gnome_bg_draw() The only thread unsafe part of that function is the one accessing monitor geometry from GdkScreen, so if that's factored out one can do background rendering in a worker thread.
Created attachment 228652 [details] [review] Actually make GnomeBG thread safe GLib data structures are only thread safe if two threads never access them at the same time. As creating a new GnomeBG means dropping the cache on the floor and might be undesirable, serialize drawing through a mutex.
Review of attachment 228651 [details] [review]: Makes sense to me
So this is an accepted-commit_now?
Still hoping for Ray to review the background work...
Giovanni, i'm going to close this now, since it's not as relevant anymore. reopen if you have any objections and still want to see this go in.
I agree with you, this is not needed. Thank you for taking care of it.