gsk/gl: use GdkArrayImpl for Clip tracking
authorChristian Hergert <chergert@redhat.com>
Tue, 26 Sep 2023 20:08:45 +0000 (13:08 -0700)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 28 Sep 2023 00:42:45 +0000 (20:42 -0400)
commit3698cadcd21e2a52c30766d311043093ea557b3f
tree16b576106f59dd923a3c31b84caf26a264b153ad
parent412a12032fd8c0f4e4f29f82895735ec38299d2f
gsk/gl: use GdkArrayImpl for Clip tracking

We can end up spending a lot of time in g_array_maybe_expand() through the
use of g_array_set_size() for clip tracking. That is somewhat due to the
simple nature of GArray being size-dynamic. Instead, we can use
GdkArrayImpl and let the compiler do what it does best to elide some
work and hoist other work into the calling function.

This also fixes a potential UAF in gsk_gl_render_job_push_contained_clip().
gsk/gl/gskglrenderjob.c