opengl and the compositor

Sampsa Riikonen sampsa.riikonen at iki.fi
Mon Nov 18 07:50:21 GMT 2019


Dear Developers,

Sorry about the basic nature of my questions.

I'd like to get into kwin development, but before that, I have to get my
head around some basic concepts.

I'm recurring to this mailing list, since these thing is not explained
anywhere (at least I could not find).

Please feel free to point me to any tutorial or lines in the actual kwin
source code.

**How does an OpenGL context play along with the compositor?**

Consider this:

- I create a window with an opengl context
- I draw stuff to that context using opengl 3.1 (texture streaming in my
case)
- Opengl renders the final 2d image into a framebuffer
- ..that framebuffer is used by the kwin compositor, to embed it into
the final desktop view (?)
- But the opengl rasterization has been done on the GPU, and to my
understanding, never "leaves the GPU"
- ..so how is the compositor is able to use that framebuffer?
- I typically use direct rendering in opengl, so this gets even more
mystical (ref:
https://en.wikipedia.org/wiki/Direct_Rendering_Infrastructure#/media/File:Linux_graphics_drivers_DRI_current.svg
)


**How are the Qt widgets rendered with the OpenGL backend?**

The kwin compositor creates it own OpenGL context

Is my understanding of the Qt rendering pipeline correct:?

- My program creates a Qt widget under kwin
- Those widgets have the window-manager-owned widgets as their parent
widgets
- Window manager renders the main level widgets (=> and hierarchically
the child-level widgets created by my Qt program)
- Window manager passes the final rendered widgets to OpenGL


Kind Regards,

Sampsa Riikonen




More information about the kwin mailing list