This method allows to generate a shader with ShaderTraits but one
part (e.g. vertex and/or fragment) to be replaced by custom shader
code.
Thus it can be used as a replacement for the load*(ShaderType) variants
and allows more effects to transition to shaders using traits.
The screen projection matrix is needed if an effect wants to customize
the modelview projection matrix while rendering a window and keeping
the currently applied screen projection and transformation.
With this change a new ctor overload is added to ScreenPaintData
which allows passing a projection matrix through the effects. This
allows effects to put up custom shaders with a shared projection matrix
and without having to calculate it themselves.
The projection matrix is a read-only information for the effects. There
is no way to change or overwrite it.
The way nearestPowerOfTwo is currently defined allows for the possibility of
left-shifting an int by 32 bits or more, which is undefined behavior on
platforms where int is 32 bits, and is something that can happen here if `s`
is equal to 31 by the end of the loop. Noted by Coverity as CID 1291191.
This patch takes an algorithm to perform the same operation from Hank Warren
Jr.'s book "Hacker's Delight", which should avoid UB.
REVIEW:126540
The extensions specify that you are only allwoed to use the robust
functions if the context is robust. Given that we need to query
whether the robust is context and fall back to our workaround if
the context is not robust.
REVIEW: 126051
For the functions from GL_FOO_robustness we want to resolve it by
ourselves in order to add a custom implementation if it's not available.
Unfortunately once epoxy.h is included this breaks as epoxy defines the
names and so through the preprocessor epoxy always wins.
So we need different names: all functions from robustness get a "kwin"
prefix and the usage is changed everywhere in kwin source code.
REVIEW: 125883
-use qstringliteral only when necessary (i.e. not in concat or comparison)
-use qbytearray instead of qstring when dealing with latin1 input and output (glplatform)
-use qstringref to extract numbers from strings (glplatform)
-define qt_use_qstringbuilder to optimize all string concatenations
-anidata: use ctor init lists, add windowType member initialization
REVIEW: 125933
So far it was bound to whether we build for GLES. But this is
semantically wrong. It might be possible that even on desktop gl
epoxy is built without GLX support, thus we need to reflect this.
This change ensures that epoxy/glx.h is only included if available,
that relevant code is bound to it and that checks are in place to
enforce EGL if not build with glx support.
In addtion the glxbackend.cpp is now only included in the build set
if available.
Only those which truly are different are kept as compile time checks.
In addition the index buffer is made available to GLES as in principle
all required functionality is available on gles.
REVIEW: 125865
It was broken on so many ways, it's unbelievable:
* action was read but did nothing
* config was saved into a different file than read from
REVIEW: 125701
CCBUG: 331841
Removes the ElectricAction for ShowDashboard and the relevant code
in screenedges and the KCM.
Also a leftover in the glide effect.
REVIEW: 125700
BUG: 353928
A quad might have a null size in case it has a null width or null height.
Not just one dimension.
BUG: 236353
BUG: 210467
FIXED-IN: 5.4.2
REVIEW: 125131
It doesn't make much sense any more as we do no longer link EGL since the
switch to epoxy. And epoxy pulls it in at runtime if needed.
Even more on Wayland it's just plain stupid to have EGL disabled. So
removing the option just simplifies our code base without any
disadvantages.
REVIEW: 124695
Internally QX11Info::display() calls into QPA native interface and
tries to resolve the nativeResourceForIntegration for "display".
Unfortunately this key also exists in other QPA plugins, e.g. in
QtWayland.
Calling without a check on platform results on wayland qpa in
wl_display* being casted into Display*.
REVIEW: 124203
The glVersion was not set at all for gles causing any code doing a
hasGLVersion check to fail which means that the compositor doesn't
start at all, because it has a hasGLVersion(2, 0) check.
The complete ifdef is no longer needed. The used additional glGetStringi
is also available in gles 3.0, thus epoxy can handle it quite well
without a need for ifdef.
Unfortunately the version string can be "strange" on GLES. On desktop
it looks like: "3.0 some driver foo", on GLES it could also be:
"OpenGL ES 3.0 some driver bar". Thus to make the logic work we are
first removing any leading "OpenGL ES " and hope that then the version
is encoded just like on GL.
On wayland OpenGL might get initialized before we have a connection
to the XServer and we might only have an xcb connection. So let's
guard the access.
KWin::connection() uses the property to resolve the value instead of
using QX11Info. In practice this doesn't change anything at the moment,
but allows kwin_wayland to provide an xcb connection without depending
on QX11Info.
As we cannot make xcb_connection_t* available as a metatype, the
property's type is set to void*.
KWin::rootWindow() uses the property to resolve the value instead of
using QX11Info. In practice this doesn't change anything at the moment,
but allows kwin_wayland to provide a root window without depending on
QX11Info.
The porting to Qt5 broke the timestamp handling in many areas. A deeper
look into Qt's xcb plugin shows that the appTime handling is not
sufficient for KWin's need. E.g. the time is only updated in response to
a property notify event if it's for a Qt created window, which is hardly
ever the case in KWin. Another example is that key press/release events
never updated the appTime.
As the functionality in Qt is rather trivial we can do the timestamp
handling ourselves. We filter all events anyway and it is slightly faster
as we don't have to go through the QPA interface any more.
REVIEW: 122636
Resetting glPixelStore is bound to the variable useUnpack, but setting
was only bound to a subset of the checks going into useUnpack variable.
This could cause an assert if one updated with a QImage not in format
ARGB32_Premultiplied.
REVIEW: 122521