Hacker News new | ask | show | jobs
by ng55QPSK 951 days ago
Is the same infrastructure available in Windows and MacOS?
5 comments

From the article:

> What are the limitations?

> At the moment, graphics offload will only work with Wayland on Linux. There is some hope that we may be able to implement similar things on MacOS, but for now, this is Wayland-only. It also depends on the content being in dmabufs.

macOS supports similar things in its own native stack, but GTK doesn't make use of it.
macOS has IOSurface [0], so it can be done there too. It would require someone to implement it for GTK.

[0] https://developer.apple.com/documentation/iosurface

When I wrote the macOS backend and GL renderer I made them use IOSurface already. So it's really a matter of setting up CALayer automatically the same way that we do it on Linux.

I don't really have time for that though, I only wrote the macOS port because I had some extra holiday hacking time.

On Windows and DirectX, you have the concept of Shared Handles, which are essentially handles you can pass between process boundaries. It also comes with a mutex mechanism to signal who is using the resource at the moment. Fun fact - Windows at the kernel level works with the concept of 'objects', which can be file handles, window handles, threads, mutexes, or in this case, textures, which are reference counted. Sharing a particular texture is just exposing the handle to multiple processes.

A bit of reading if you are interested:

https://learn.microsoft.com/en-us/windows/win32/direct3darti...

The last paragraph says:

> At the moment, graphics offload will only work with Wayland on Linux. There is some hope that we may be able to implement similar things on MacOS, but for now, this is Wayland-only. It also depends on the content being in dmabufs.

Nope, it is yet another step making Gtk only relevant for Linux development.
Supporting a feature on one platform does not make a toolkit less relevant or practical on another platform.
Except this has been happening for quite a while, hence why a couple of cross platform projects have migrated from Gtk to Qt, including Subsurface, a bit ironically, given the relationship of the project to Linus.
The Subsurface developer did that 10 years ago and it only was because he personally preferred Qt. Take a step back for a moment and consider that in 10 years that's the only major example that anyone ever brings out. GTK is still very welcoming for contributions to maintain the GDK backends. Developers like that have to actually step up and do it and have patience, instead of outright quitting and running off to Qt which has a whole company to maintain those ports.
Gtk has always been primarily built by and for Linux users.
The GIMP Tolkit was always cross platform, the GNOME Tolkit not really.
That is ahistorical, and the misnaming doesn't help make your point.
After seeing this whole thread a day late, I have to wonder: is the unspoken difference what "cross-platform" and "always" mean to different posters? To someone with my historical perspective, it grates a bit to see X Windows conflated with Linux as a platform.

My memory of the early days is consistent with what the wikipedia page says about GIMP. It was cross-platform on the typical Unix workstations that were around the UC Berkeley campus labs and XCF. This was things like Solaris, SunOS, HP-UX, Ultrix, and Irix.

Students in this milieu were just as likely to have some BSD variant on their home PC as Linux. I think it was later during and after the "Beowulf" scientific computing period when Linux started to dominate as the Unix-like platform for open source development.

Has it been relevant for something else before?
Yes, back when G stood for Gimp, and not GNOME.
Even in those days, Gtk+ applications were quite horrible on non-X11 platforms. GTK has never been a good cross-platform toolkit in contrast to e.g. Qt.
I guess people enjoying GIMP and Inkscape would beg to differ.
Maybe it’s a thing on Windows (I don’t know), but I’ve never seen anyone use GIMP or Inkscape on macOS. I’m pretty sure they exist somewhere, but all Mac users I know use Photoshop, Pixelmator or Affinity Photo rather than GIMP.
Inskape devs have a lot of trouble making their app work on other OS.