* opengl: remove unnecessery glflush calls
glflushing forces the driver to break batching and issue commands
prematurely and prevents optimisations like command reordering and
merging.
many glFunctions already internally glflushes and eglsync creation still
has a glflush at end render. so lets reduce the overhead of these calls.
* opengl: reduce glUseProgram calls
apitrace shows cases where the same program gets called multiple times,
add a helper function that keeps track of current program and only call
it once on same program. reduces slight overhead.
* opengl: use more efficient vertex array object
use a more modern vertex array object approach with the shaders, makes
it a onetime setup on shader creation instead of once per drawcall, also
should make the driver not have to revalidate the vertex format on each
call.
remove unused timeline and waitpoint in texpass and especially remove
the passing it to renderTextureInternalWithDamage that implicitly
converted it to bool. setting discardActive and allowCustomUV
* compositor: reduce amount of window box copies
mousemoveunified can call this very frequently, the cbox copying
actually shows up as an impact in such cases, move it down in the scope
and only do it when necessery.
* core: constify and reference frequent calls
profiling shows these as frequent called functions try to reduce the
amount of copies with references and const the variables.
* pointermgr: remove not used local copy, const ref
remove unneded local copies and const ref cursorsize.
* inputmgr: reduce amount of calls to vectortowindow
the amount of calls to g_pCompositor->vectorToWindowUnified fast ramps
up in cpu usage with enough windows existing and moving the mouse, move
the PWINDOWIDEAL up and reuse it if its already the same.
* protocol: compositor remove unused local copy
remove unused local copy of accumulateCurrentBufferDamage and const
previousBuffer.
* renderer: reduce scope of variables and refactor
move a few variables down in their scopes to reduce the amount of calls
and copies when not needed, also add one more for loop in
renderWorkspaceWindows and store the windows in a vector with
weakpointers that should be rendered, this adds a loop but reduces the
amount of repeated calls to shouldRenderWindow and also makes the rest
of the loops go over way smaller vector when many windows exist.
change the hook to monitorAdded instead of newMonitor so its finalized
in the compositor and added to vMonitors, move the
checkDefaultCursorWarp to PointerManager and check for it upon mode
change. and also ensure it doesnt go out of bounds by replacing it in
the middle again on resolution changes.