Use aligned allocators for GtkSnapshot
authorРуслан Ижбулатов <lrn1986@gmail.com>
Sat, 9 Jun 2018 14:06:55 +0000 (14:06 +0000)
committerРуслан Ижбулатов <lrn1986@gmail.com>
Sun, 10 Jun 2018 20:35:54 +0000 (20:35 +0000)
commitc02bc22cc575470aab870599f2781c3781fb75e6
tree2530bb78b2d30075800f4a9c7ac31341f3a85783
parenta394a86151fda092567ad9833720de1d9b56235b
Use aligned allocators for GtkSnapshot

Any data that is later fed to graphene must be
allocated with proper alignment, if graphene
uses SSE2 or GCC vector instructions.

This adds custom array code (a streamlined copy
of GArray with all unnecessary bells and whistles removed),
which is then used for the state_stack instead of GArray.

There's also a runtime check for the size of GtkSnapshotState
itself being a multiple of 16. If that is not so, any array
elements past the 0th element will lose alignment.
There are probably struct attributes that can
make GtkSnapshotState always have size that is a multiple
of 16, but we'll burn that bridge if we cross it.
gsk/gskalloc.c
gtk/gtksnapshot.c
gtk/gtksnapshotprivate.h