3 ms·
Compositors are not just about visual effects. They are also a pretty good way to leverage GPUs. If you don't care that much about latency, there's a clear ben
by outworlder 6y ago
Compositors are not just about visual effects. They are also a pretty good way to leverage GPUs.
If you don't care that much about latency, there's a clear benefit in never having windows getting "damaged" just because other stuff has temporarily occluded them. You will never get "ghost" images because one app has locked up or is slow. No flurry of "WM_PAINT", "WM_NCPAINT" or whatever equivalent just because you are moving windows. No matter how fast your system is, any 'movement' is much more fluid (as position changes are almost free).
Essentially, having windows completely isolated from one another - except when they are "composited" back - simplifies a lot. There's a lot of cruft and corner cases that you don't have to care.
There are features that can enhance usability that are trivial to do with compositors but difficult without - for instance, showing a window "preview" when you are switching apps or when you mouse over in the taskbar. While you can do this without a compositor, you can get this very easily and for almost 'free'.
And, as you point out, you can post-process and apply whatever effects you want. But this is a minor detail and was used initially as a selling point.
Of course, for a tiling window manager none of this matters as they never overlap. But most users don't use tiling window managers.
- toast0 6y ago> If you don't care that much about latency, there's a clear benefit in never having windows getting "damaged" just because other stuff has temporarily occluded them. Isn't that why X11 provided an (optional) backing store?
- badsectoracula 6y ago> They are also a pretty good way to leverage GPUs. Compositors do not do much GPU leverage outside of drawing a bunch of textured quads for the final image, but those textures are assembled on the CPU (some toolkits have GPU backends but even that goes back and forth the CPU because not everything is done though the GPU). It would need a big rewrite of the GUI stack to actually take advantage of GPUs with whatever service/server handles it to have a full scene tree with all the contents of the desktop resident (and whenever possible, manipulated) in GPU memory. As things are nowadays, however, at best you get a mix of the two (and that itself isn't without its drawbacks too).