Commit Graph

10 Commits

Author SHA1 Message Date
Emmanuel Gil Peyrot
1fdf5b7cf8 gdk: Optimise RGBA8 → premultiplied BGRA8 for ARM
This more than halves the total runtime of this function since the
previous commit, from 8.36% to 4.02%, and is most likely memory
bandwidth limited on this specific board now.

I tried to do a SSE2 version as well, but couldn’t find any equivalent
of the LD4/ST4 ARM instruction.
2022-02-16 16:36:33 +01:00
Emmanuel Gil Peyrot
0e3ed7a738 gdk: Specialise RGBA8 → premultiplied BGRA8 conversion
On x86 on a Kaby Lake CPU, this makes it go from 6.63% of the total
execution time (loading some PNGs using the cairo backend) down to
3.20%.

On ARM on a Cortex-A7, on the same workload, this makes it go from 57%
to 8.36%.
2022-02-16 16:35:39 +01:00
Benjamin Otte
dcba783389 gdk: Rework gdk_pixbuf_get_from_texture()
Make it use gdk_memory_texture_from_texture().

Also make gdk_memory_format_alpha() privately available so that we can
detect if an image contains an alpha channel.
2021-10-18 12:08:57 +02:00
Benjamin Otte
1e7fb52b21 Add memory formats used by libpng
Add unpremultiplied high-depth formats. They are used in the real world,
so let's support them.
2021-10-13 14:33:44 +02:00
Matthias Clasen
49a64da7ec Merge branch 'ngl-is-the-new-gl' into 'master'
Rename ngl to gl

Closes #4318

See merge request GNOME/gtk!4037
2021-10-11 06:43:41 +00:00
Benjamin Otte
27b5dc1452 gl: Fix broken internal format 2021-10-09 04:44:30 +02:00
Matthias Clasen
144f727d5a Rename ngl to gl
We have only one gl renderer now, and it is
a bit odd for it not be called gl.
2021-10-07 13:05:53 -04:00
Benjamin Otte
afa004fb8b memoryformat: Add gdk_memory_format_prefers_high_depth()
This is unused so far, but is part of preparations for high depth
support in renderers.
2021-10-06 22:50:07 +02:00
Benjamin Otte
149395c306 gl: Move memory <=> GL format mapping
Put it into gdkmemoryformat.c, where all the mapping goes.
2021-10-06 22:50:07 +02:00
Benjamin Otte
48781cf7f7 memorytexture: Split out GdkMemoryFormat handling
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.
2021-10-06 22:50:07 +02:00