|
From: | Ivan Vučica |
Subject: | Re: SwiftUI compatibility APIs in GNUstep's graphics stack (Was: Which ObjC2.0 features are missing in the latest GCC?) |
Date: | Wed, 27 Nov 2019 19:12:17 +0000 |
On 27 Nov 2019, at 18:29, Ivan Vučica <ivan@vucica.net> wrote:
>
> I will intentionally not discuss this further, and I have
> intentionally not dug very deep. I don't want to be overly exposed to
> ideas beyond the APIs.
Apple wrote quite a lot publicly about how their fast rendering server (Quartz Extreme!!11eleventyone) worked, and it’s very similar to how most modern GUIs work. XDAMAGE, XRENDER and XCOMPOSITE expose all of the things required to do the same on X11. Their main innovation was that, for each font, they pre-rendered all of the glyphs and did server-side compositing.
On a modern GPU, modifying a texture is very expensive, but compositing is basically free. On a CPU, modifying a texture is cheap and compositing is relatively expensive. The interface that you want from the GUI stack to the display server (X11 or whatever) should favour storing rendered things on the server and should provide the regions that need redrawing. If you’re using a GPU, rendered things can be stored as textures and composited for free. If you need to redraw something, you can render to texture and then cache the result and composite that.
I haven’t looked at the Cairo back end, but from what I’ve seen of its behaviour, my guess as to some of the performance issues:
- It is redrawing a lot more than it needs to. There may still be the double buffering inherited from the ART back end, but I’ve seen the entire window flicker when only a small portion should be redrawn.
- There’s no CALayer support, so redrawing a view always involves redrawing all subviews, even ones that haven’t changed.
Pretty much all other modern toolkits have sone CALayer equivalent and so can cache expensive to render and just recomposite them. This is particularly noticeable over remote X11, where those images are cached on the display server and only the redrawn bits need to be transferred over the network.
[Prev in Thread] | Current Thread | [Next in Thread] |