gl/eagl: Fix resize condition check in draw_cb to not get called unnecessarily
authorMart Raudsepp <mart@leio.tech>
Thu, 26 Nov 2020 12:45:05 +0000 (14:45 +0200)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 3 Dec 2020 08:18:29 +0000 (08:18 +0000)
commit8ffea3afb5c41b4eee2e0ff2cea27e30f06f5ff4
tree17fc65cd6516ba9521fab301510057fed5f0efbc
parentd4ff62700d62e5de45cdb65f2899ee671c7666ae
gl/eagl: Fix resize condition check in draw_cb to not get called unnecessarily

A CGSize contains CGFloat values (a typedef to double or float), which means
that the values aren't equal, despite it being equal after they are cast to
int by assigning them to window_height/width private members. This leads to
excessive gst_gl_window_resize calls on each frame, at least if the CGFloat
value has a .5 decimal value, e.g. 103.5.
Fix it by storing them as CGFloat instead of gint.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/945>
gst-libs/gst/gl/eagl/gstglwindow_eagl.m