| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
The API docs outline why quite well.
This should make it possible to do saving of textures to image files
without any private API with the same featureset that GTK uses.
Also remove the gsktextureprivate.h include where
gdk_texture_get_format() was the only reason for it.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
clang complained that we may end up jumping
to the cleanup code without initializing data
in the jpeg code. Always initialize data to
NULL to prevent that eventuality.
|
|
|
|
|
| |
Bump the limit for memory use during jpeg loading
to 1GB, matching what gdk-pixbuf has for this.
|
|
|
|
|
| |
This header was merely including gi18n-lib.h.
Just do that directly.
|
|
|
|
|
|
|
| |
Commit 59f6c50df8d4d9 set the memory limit to 100M,
which turns out to exclude some large, valid jpegs.
So, bump things to 300M, matching what was done
in gdk-pixbuf.
|
|
|
|
|
|
| |
This will prevent stupid oom situations with pathological
jpeg files, without affecting our ability to load reasonable
images.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`free` is defined in `stdlib.h`, see for example
<https://pubs.opengroup.org/onlinepubs/009604499/functions/free.html>. Without
this include compilation can fail with the following error:
```
../gdk/loaders/gdkjpeg.c: In function ‘gdk_save_jpeg’:
../gdk/loaders/gdkjpeg.c:264:7: warning: implicit declaration of function ‘free’ [-Wimplicit-function-declaration]
free (data);
^
../gdk/loaders/gdkjpeg.c:264:7: warning: incompatible implicit declaration of built-in function ‘free’
../gdk/loaders/gdkjpeg.c:264:7: note: include ‘<stdlib.h>’ or provide a declaration of ‘free’
../gdk/loaders/gdkjpeg.c:302:67: error: ‘free’ undeclared (first use in this function)
return g_bytes_new_with_free_func (data, size, (GDestroyNotify) free, NULL);
^
../gdk/loaders/gdkjpeg.c:302:67: note: each undeclared identifier is reported only once for each function it appears in
../gdk/loaders/gdkjpeg.c:303:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libpng wants to receive samples in either RGB or RGBA order, whether
each sample is big-endian or not. This resolves test failures in
testsuite/gdk/memorytexture.c (and a lot of reftests) on s390x, and
probably the PowerPC family too.
Modifying the test to show the color in use and write out the PNG bytes
to a file, and running the memorytexture test on s390x, produces a PNG
that loads with the correct color values in GIMP (on an x86_64 machine),
which seems like evidence that this is the correct change and not just
compensating errors.
Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/4616
Signed-off-by: Simon McVittie <smcv@debian.org>
|
|
|
|
|
| |
tiff_open_read may fail, and we should not crash
in that case but return an error.
|
| |
|
|
|
|
|
| |
Makes the static analyzer not trip up when trying to analyze memory
leaks.
|
| |
|
| |
|
|
|
|
| |
Now we support all the formats.
|
|
|
|
|
| |
Do all the memory format shenanigans in GTK now and support all the PNG
formats.
|
|
|
|
|
| |
Add unpremultiplied high-depth formats. They are used in the real world,
so let's support them.
|
|
|
|
|
|
|
| |
Not inside libpng.
We really want to do them in GL, but we don't have a premultiply step
yet.
|
|
|
|
|
|
|
|
|
|
|
| |
Pass a format do GdkTextureClass::download(). That way we can download
data in any format.
Also replace gdk_texture_download_texture() with
gdk_memory_texture_from_texture() which again takes a format.
The old functionality is still there for code that wants it: Just pass
gdk_texture_get_format (texture) as the format argument.
|
|
|
|
|
| |
We have only one gl renderer now, and it is
a bit odd for it not be called gl.
|
|
|
|
|
|
|
|
|
|
|
| |
For MemoryTexture, this is a simple change.
For GLTexture, we need to query the format at texture creation. This
sounds like a bad idea and extra work until one realizes that we'd
need to do that anyway when using the texure the first time - either
when downloading, or when trying to use it in a rendernode, where we
will soon need that information to determine if the texture prefers high
depth.
|
|
|
|
|
|
|
| |
Also, now make gdk_memory_convert() the only conversion functions
and allow conversions between any 2 formats by going via a float[4].
This could be optimized via fast-paths, but so far it isn't.
|
| |
|
|\
| |
| |
| |
| | |
gtk-demo: Cosmetics
See merge request GNOME/gtk!3975
|
| |
| |
| |
| |
| | |
These are potentially expensive calls, we
should make sure they show up in profiles.
|
|/
|
|
| |
The latter seems to be deprecated.
|
|
|
|
|
|
|
|
|
|
|
| |
1. Change INSUFFICIENT_MEMORY to TOO_LARGE
GTK crashes on insufficient memory, we don't emit GErrors.
2. Split UNSUPPORTED into UNSUPPORTED_CONTENT and UNSUPPORTED_FORMAT
So we know if you need to find an RPM with a loader or curse and
the weird file.
3. Translate error messages, they are meant for end users.
|
|
|
|
|
|
|
|
| |
When loading, convert all >8-bit data to
GDK_MEMORY_R16G16B16A16_PREMULTIPLIED.
When saving, save all 8-bit formats as 8-bit RGBA,
and save all >8-bt formats as 16-bit RGBA.
|
| |
|
|
|
|
|
|
| |
This way, the code using it becomes clearer and we can use it in
multiple places without accidentally doing it wrong (hint: see next
commit).
|
|
|
|
|
|
|
| |
This lets us avoid gdk-pixbuf for loading
textures from the common image formats.
As a consequence, we are now linking against libjpeg.
|
|
|
|
|
|
|
|
| |
Add support for the tiff format, which is flexible
enough to handle all our memory texture formats
without loss.
As a consequence, we are now linking against libtiff.
|
|
Using libpng instead of the lowest-common-denominator
gdk-pixbuf loader. This will allow us to load >8bit data,
and apply gamma and color correction in the future.
For now, this still just provides RGBA8 data.
As a consequence, we are now linking against libpng.
|