anvil/udev: Dynamic support for pixman rendererer#1497
anvil/udev: Dynamic support for pixman rendererer#1497ids1024 wants to merge 2 commits intoSmithay:masterfrom
Conversation
|
I tried to create a wrapper enum implementing the renderer traits. Macro based implementation: https://github.com/cmeissl/smithay/blob/3834756520cfb8db5c21b9b5485d16bdc7cdab6e/src/backend/renderer/auto.rs |
|
I was thinking a macro might make sense. That looks handy. Although macro rules macros like that get a bit complicated. |
|
Updated on top of #1600. Testing this I see a crash: I guess that's an existing issue with the pixman renderer, and not something changed here? Hm. |
|
Updated so the Exactly how best to abstract over multiple renderers remains an open question. |
This removes a bit of duplication between backends. There seems to be no need to separate these unless fps is used for other things.
The `RendererRef` and `Texture` enums provide one way to abstract over different renderers. This splits `FpsElement` into a seperate `Fps` that isn't a render element, and isn't specific to one renderer/texture type.
|
This seems to be working correctly, including with the We may want to change how renderers are abstracted dynamically in the future (and provide some helper for this in Smithay), but this seems good for now, to have a way to test Pixman rendering properly. |
With the changes here, the anvil udev backend will use pixman for rendering if
ANVIL_USE_PIXMANis set.To do:
Sendbound onMemoryRenderBuffer, and noSendforPixmanTexturedebugfeature (need to abstract texture)It's not entirely clear how best to abstract renderers dynamically:
Renderertrait?Rendererand related traits make it easier to abstract over, and dispatch at runtime to different renderers?