Originally posted by gens
View Post
Let me explain: We all know the famous GLX_texture_from_pixmap extension which allows to use a pixmap as a GL texture. Now X11 pixmaps are stored on the GPU where possible and therefore accessible within OpenGL through this extension.
X without compositing: Each application draws directly on the screen using X primitives (e.g. pixmaps, but also lines, boxes, text that looks ugly?) and on EVERY screen damage (e.g. a window moved over another) drawing has to be repeated.
X with CPU compositing: What you see on the display is a fullscreen window managed by the compositor who can use the same X primitives to draw. The application's drawing is performed onto pixmaps available to the compositor. As the compositor keeps these pixmaps, applications are not bothered with screen damage. The compositing process is, as said, done with X primitives and the pixmaps typically reside, as said, on the GPU, so using XRENDER etc. the CPU compositing can still be 2D hardware accelerated.
X with GL compositing: Here the compositor uses GL commands to draw its window and within these commands pixmaps (the pre-rendered application windows) are directly accessed as textures.
Wayland: Basically very similar to the X compositing cases, the differences lie in the protocols. For example, applications do not draw primitives anymore but have to provide a pixmap in the first place, even including their decorations. Wayland also has no idea about how to draw text on the screen, be it ugly or non-ugly. Wayland also has no clue on how to bring anything to the screen, this is the sole responsibility of the compositor (e.g. Weston). Obviously there is a direct exchange of pre-rendered windows to the compositor and I don't know how that works. Can the application render into a GL framebuffer (like Qt OpenGL backend) and this is used as a texture by the compositor? I don't know but probably there is a mechanism.
tl;dr: Wayland compositing is not inherently more efficient or use less content copies than X compositing. The avoidance of extra copies through GLX_TEXTURE_FROM_PIXMAP was the groundbraking feature that made the whole compositing feasible in the first place. Anyone remembers XGL?
Comment