forked from joejulian/gio
97299dc2f9b1e05d44bf426b358c5dbfe65409f1
The gioui.org/commit/74407a50d598bfd27e8f8e48b6832cc5df04de77 added a NewImageOp constructor that always copies the supplied image. It does that for two reasons: First, the image.Image reference is used in the image=>texture map of cached textures. Without a copy, we wouldn't detect a modified image even if a new ImageOp was created. Second, we don't want the program to touch the image while the GPU is uploading it. The second reason was removed in a previous change that blocks FrameEvent.Frame until we're done with the operations, including uploading images to the GPU. The first reason is easily fixed by using a unique per ImageOp, as pointed out by Alessandro Arzilli. This change switches to using the unique key. Alessandro's patch avoids the copy when possible. Signed-off-by: Elias Naur <mail@eliasnaur.com>
Gio
Immediate mode GUI programs in Go for Android, iOS, macOS, Linux, FreeBSD, Windows and WebAssembly. See gioui.org for details and documentation.
Issues
File bugs and TODOs through the issue tracker or send an email to ~eliasnaur/gio@todo.sr.ht. For general discussion, use the mailing list: ~eliasnaur/gio@lists.sr.ht.
Contributing
Post discussion to the mailing list and patches to gio-patches. No Sourcehut account is required and you can post without being subscribed.
See the contribution guide for more details.
License
Description
Languages
Go
89.6%
C
7%
Java
1.7%
Objective-C
1.6%