GNOME Bugzilla – Bug 130547
generic framebuffer support for gtk
Last modified: 2011-06-06 23:55:13 UTC
(opening bugzilla RFE per yosh's suggestion) I've got a patch that extends the linux-fb gdk backend to handle rendering to a generic buffer (32-bit RGBA buffer). "extends" is used loosely here, because the majority of the worked involved ripping out linuxfb handling/setup, ripping out mouse drivers and keyboard input drivers, and hardcoding a 32bpp truecolor visual. I have the code pulled out in a separate "gl" subdirectory of gdk; mostly copies of linux-fb, with some heavy changes in keyboard/mouse input handling. Keyboard and mouse input comes in via a GQueue protected by a GMutex, which is polled via a GSource in the main loop.. keyboard input uses SDL keysyms, for simplicity (thus there's a build-time dependency on a SDL include file atm). What this gives me is the ability to use gtk as a UI on top of an OpenGL scene (or, presumably, Direct3D or just about anything where I can render an image to the screen). There are very few UI packages that can do this; the ones that are out there generally suck. There are no polished middleware packages for this. I'll attach a patch against 2.3.1, but it duplicates a lot of linux-fb code. Any suggestions on merging the two, or any feedback on the chances of this type of gdk support making it into mainline gtk would be appreciated. :)
Created attachment 22926 [details] gtk+ gl patch, against 2.3.1
I'd say zero chance unless you can factor out the duplication between that code and the linux-fb code. As for how to factor out the duplication, I'm not sure I can give specific advice without looking a lot at the details but presumambly, there would be a gdk/framebuffer directory with the "draw to a framebuffer code", then linux-fb and whatever else that use the code from that.
Okay, new patch. No duplication; all the relevant code is merged in with linux-fb, and is enabled when the gl gdk target is built. The patched gtk builds on both linux and win32, in both the native (x11/win32) and gdkgl modes, as well as the old linux-fb backend on the linux side. The patch is against 2.4.0. Any feedback would be much appreciated.
Created attachment 26278 [details] [review] generic framebuffer patch, take 2 (against gtk 2.4.0)
Isn't this fixed already? We both have support for rendering to pixmaps and a directfb backend now. Not sure client-side buffers.
Is the patch or parts of it still relevant?
Many hunks from patch in comment 4 fail.
This is obviously obsoleted by the years; gdk has been more or less rewritten, several backends have come and gone...