Refactor OpenGL drawImage
Open, Needs TriagePublic

Description

in kis_opengl_canvas2 drawImage there is a loop that calls glDrawArrays, every loop the CPU send data to the GPU and waits for it to be processed. On linux and windows this wait time is no problem since tablet events are buffered. But on macOS the slow delay makes some tablet events to get lost and produce jagged lines.

One possible solution is to change to an indirect rendering, using glMultiDrawArraysIndirect to effectively reduce the CPU-GPU communication overhead.