mirror of
https://github.com/brl/mutter.git
synced 2025-02-23 08:24:09 +00:00

It's the 10 bit equivalent to NV12 and uses the same layout as P016, i.e. 16 bit components with the lowest 6 bits set to 0 (padding), allowing us to use 16 bit "subformats". Thus adding support is quite trivial as we can reuse the NV12 shader. The format is widely supported in decoding and display hardware (on Intel since Kaby Lake), as well as modern codecs (AV1, VP9, HEVC) and has visible quality advantages over NV12. Note that the additional colors are lost if composited to a 8 bit RGB framebuffer. Switching between direct scanout and compositing can thus cause quality differences. This is no new phenomena, however, as the same is the case already for e.g. GL clients using 10 bit formats - including video players. Also note that P012 and P016 could trivially added as well - it's not done here as they are uncommen and thus hard to test. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3244>
Intro ===== In general, the compositor splits the window from the contents of the window from the shape of the window. In other words, a window has contents, and the contents of the window have a shape. This is represented by the actor hierarchy: +--------------------------------------+ | MetaWindowActor | | +----------------------------------+ | | | MetaSurfaceActor | | | | +------------------------------+ | | | | | MetaShapedTexture | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +------------------------------+ | | | +----------------------------------+ | +--------------------------------------+ Surfaces may also contain subsurfaces. The MetaWindowActor and MetaSurfaceActor subclasses that will be created depend on the client type, and the display server type. ## Subsurfaces Additionally, there is also the case of subsurfaces: surfaces that are child of other surfaces. That is also represented in the actor hierarchy by having one or many MetaSurfaceActors (the subsurfaces) added as children of a parent MetaSurfaceActor. There are no limits to how many subsurfaces a surface may have. With subsurfaces, the actor hierarchy looks like this: MetaWindowActor ↳ MetaSurfaceActor (surface) ↳ MetaShapedTexture ↳ MetaSurfaceActor (subsurface) ↳ MetaShapedTexture ↳ MetaSurfaceActor (sub-subsurface) ↳ MetaShapedTexture ↳ MetaSurfaceActor (subsurface) ↳ MetaShapedTexture In this example, the main surface has 2 subsurfaces. One of these subsurfaces contains a subsurface as well. All MetaWindowActors contain at least one MetaSurfaceActor, and all MetaSurfaceActors contain a MetaShapedTexture. ## Client and compositor MetaWindowActor and its subclasses represent the client window's type. A X11 client will have a MetaWindowActorX11 representing it, and a Wayland client will have a MetaWindowActorWayland. On the compositor side, the surface where the contents of the window are drawn into are represented by MetaSurfaceActor subclasses. On a Wayland session, windows are backed by a MetaSurfaceActorWayland surface, whereas on X11 sessions, by MetaSurfaceActorX11. XWayland windows are X11 client windows (MetaWindowActorX11) backed by Wayland surfaces (MetaWindowActorWayland). Env Vars ======== MUTTER_DISABLE_MIPMAPS - set to disable use of mipmaped windows.