-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
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
it makes no sense and there's a good chance
that in this case m_vbo is still nullptr and
it will not be created since d->m_cachedSize
will be an empty size as well
-> nullptr access -> crash
BUG: 337090
FIXED-IN: 5.2
Use glTexStorage2D() to allocate storage for the texture. The structure
of the resulting texture becomes immutable and the texture is always
mipmap complete. This allows the driver to skip the mipmap consistency
checks when validating the texture at draw time.
Prior to this commit we didn't know if mipmaps were going to be used
when we created the GL texture, which meant that we couldn't tell the
driver whether to allocate storage for mipmaps or not.
This resulted in one of two things happening depending on the driver;
either it would allocate storage for mipmaps that in most cases would
never be used, or it wouldn't and would later be forced to reallocate
the texture when mipmaps were added.
By adding this parameter we can now explicitly tell the driver how
many mipmap levels will be used.
The parameter is only added to the non-image constructor for now. The
image constructor is changed to only allocate a single level, which
matches how textures created from images are used in kwin. This may
need to be revisited in the future.
GLTexture would set both the minification and magnification filters
to GL_NEAREST if the texture filter was set to any mipmap filter other
than GL_LINEAR_MIPMAP_LINEAR.
This code is broken in a number of different ways; firstly by assuming
that the mipmaps need to be regenerated when the texture filter has
changed. Secondly by preventing mipmaps from being specified by other
means.
This commit removes the code from bind() and adds a generateMipmaps()
method instead.
This is the only place where it is called.
There was also no need for this function to be virtual since it's not
reimplemented anywhere.
This also fixes the GLTexturePrivate being created only to be
immediately deleted and replaced by a new GLTexturePrivate when the
GLTexture(QImage) constructor was used.
With this change the structure of the GLTexture effectively becomes
immutable to the outside world; the contents of the texture images can
change, but the texture images themselves cannot be reallocated.
QImage::Format_RGBA8888_Premultiplied is the equivalent of
GL_RGBA/GL_UNSIGNED_BYTE, so use QImage::convertToFormat()
instead.
This commit also makes the texture upload code work correctly
on big-endian systems.
It doesn't make sense to convert the extension names to QStrings.
This also replaces the QString parameter in hasGLExtension() with
a QByteArray and adjusts all callers.
* add static cleanup handlers to GLTexturePrivate and GLRenderTarget
* revert the runtime resolved features (e.g. RenderTargets are not
supported once we run the cleanup code)
* clear the extension lists
* reset the version variables
REVIEW: 117484
KWin already has a de facto OpenGL 2 dependency through QML. Combined
with the fact that the OpenGL 1 backend is basically unmaintained and
also unused, it's better to remove it for the new major release.
This change includes:
* Removal of cmake option KWIN_BUILD_OPENGL_1_COMPOSITING
* Removal of KWIN_HAVE_OPENGL_1 compile option and all code
ifdef'ed with it (partially removal of if-else constructs)
* Removal of CompositingType::OpenGL1Compositing (flags are kept
as a core flag should get introduced)
* Driver recommendation for OpenGL1Compositing changed to XRender
(should be evaluated whether the drivers can provide GL2)
* Removal of configuration option "GLLegacy"
* Removal of fooMatrix function in kwinglutils
* Removal of ARBBlurShader
* Removal of legacy code path in GLVertexBuffer
* Removal of GLShaderManager::disable
* if-blocks with ShaderManager::instance()->isValid() removed
REVIEW: 116042
Completing the task of replacing all NULL to nullptr in all the files in
libkwineffects folder.
(also substituting some "0" used as nullptr with nullptr)
REVIEW: 114823
also work around broken fbo texture clearing on fglrx
so far supports FBO/glClear and resorts to glTexSubImage2D
if the fbo cannot be created or is (in case of fglrx)
known to break, resort to glTexImage2D loading of an
argb array of zeros
BUG: 323065
FIXED-IN: 4.11.2
REVIEW: 112526
* "" needs to be wrapped in QStringLiteral
* QString::fromUtf8 needed for const char* and QByteArray
* QByteArray::constData() needed to get to the const char*
This method returns a matrix that transforms normalized or un-normalized
texture coordinates, taking the texture target and y-inversion flag into
account.
Ownership of decoration textures is moved from SceneOpenGL::Window to
OpenGLPaintRedirector. The PaintRedirector is responsible for updating
the textures whenever they change. For this GLTexture is extended by an
update(QImage, QPoint) method which uses glTexSubImage2D to update only
the changed parts.
The big advantage compared to before is that if e.g. only a button is
animated only the button part is updated instead of the complete deco
part.
If the build option is enabled KWIN_HAVE_OPENGL_1 is passed as a compile
flag when build against OpenGL.
This compile flag is meant to replace the KWIN_HAVE_OPENGLES. So far code
has been ifdefed for special behavior of OpenGL ES 2.0 and to remove
fixed functionality calls which are not available in OpenGL ES 2.0.
With this build flag the fixed functionality calls which are only used in
the OpenGL1 Compositor can be removed and keeping the KWIN_HAVE_OPENGLES
for the real differences between OpenGL 2.x and OpenGL ES 2.0.
E.g. a call like glColor4f should be in an
glColor4f(1.0, 1.0, 1.0, 1.0);
while a call like glPolygonMode should be in an
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
Building for OpenGL ES 2.0 of course implies that KWIN_HAVE_OPENGL_1 is
not defined.
This patch changes the behavior of strictly bound textures such that
they are only updated if the corresponding window has been damaged.
Additionally GLTexture now keeps track of the current filter and
wrapmode setting.
REVIEW: 103655
Fixes rendering issues with R300 and similar GPUs. If the texture
uses GL_TEXTURE_RECTANGLE_ARB as target the tex coordinates need
to be adjusted. This at least fixes missing text on EffectFrames
with graphicssystem native on R300. Hopefully more issues are
resolved by the change.
BUG: 269576
CCBUG: 282882
FIXED-IN: 4.7.3
Additionally:
- hide the GLTexture implementation using dpointers
- drop the unused function SceneOpenGL::Texture::optimizeBindDamage()
- Texture::load now loads a new texture and does not update the existing one
REVIEW: 101999
Now convertToGLFormat does no longer mirror the texture, so that we can
avoid a deep copy in case we render a GL_BGRA texture on a little endian system.
REVIEW: 101739