summaryrefslogtreecommitdiff
path: root/tests/pixbuf-readonly-to-mutable.c
Commit message (Collapse)AuthorAgeFilesLines
* tests: Fix read-only to mutable on FreeBSDBenoƮt Dejean2017-10-051-7/+7
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=786306
* tests: define MAP_ANONYMOUS if it's not alreadyRyan Lortie2014-12-271-0/+6
| | | | | | | MAP_ANONYMOUS is not part of POSIX and some other systems (like Mac OS) call it MAP_ANON. https://bugzilla.gnome.org/show_bug.cgi?id=741933
* Add gdk_pixbuf_read_pixel_bytes()Colin Walters2014-07-181-0/+26
| | | | | | | | This can be convenient for language bindings to access the readonly data in a form that includes length, and also avoids a copy (for readonly pixbufs). https://bugzilla.gnome.org/show_bug.cgi?id=732297
* Add _new_from_bytes() and _read_pixels() API, handle read-only pixbufsColin Walters2014-07-181-0/+159
GdkPixbuf is an old API that predates introspection and GBytes. It has some confusion around whether or not pixbuf data is mutable or not. The _new_from_data() API takes a *const* pointer, but it's not copied, and _get_pixels() returns a non-const copy of the same pointer. There are several cases where we get read-only data, such as a GResource. For language bindings, _new_from_data() doesn't work because the array may be a temporary copy only allocated for the call. In order to support a clean _new_from_bytes() API, we need to add the concept of a read-only pixbuf into the core. The fundamental hack here is that _get_pixels() now causes an implicit copy. For the cases where we don't want to copy, add a new gdk_pixbuf_read_pixels() that returns a proper const pointer. https://bugzilla.gnome.org/show_bug.cgi?id=732297