26 Commits (75c0c415cc27583f3014ba4fbb7d5a371ce94d59)

Author SHA1 Message Date
Martin Flöser f31e183605 [libkwineffects] Try fixing compile error with clang
The FreeBSD build is currently failing with:

kwingltexture_p.h:83:23: error: no function named 'cleanupGL' with type
'void ()' was found in the specified scope
friend void KWin::cleanupGL();

This change hopefully addresses the problem.
7 years ago
Martin Flöser 8ae37c420b Move SceneOpenGL into a dedicated plugin
Summary:
Unfortunately a rather large change which required more refactoring than
initially expected. The main problem was that some parts needed to go
into platformsupport so that the platform plugins can link them. Due to
the rather monolithic nature of scene_opengl.h a few changes were
required:
* SceneOpenGL::Texture -> SceneOpenGLTexture
* SceneOpenGL::TexturePrivate -> SceneOpenGLTexturePrivate
* texture based code into dedicated files
* SwapProfiler code into dedicated files
* SwapProfiler only used in x11 variants
* Safety checks for OpenGL scene moved into the new plugin
* signal declared in SceneOpenGL moved to Scene, so that we don't need
to include SceneOpenGL in composite

Test Plan: Nested OpenGL compositor works

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7740
7 years ago
Martin Gräßlin 7bbb68aad6 Check GL version and/or extension for using texture format GL_R8
BUG: 344301
FIXED-IN: 5.2.1
REVIEW: 122615
10 years ago
Fredrik Höglund 7fd4cf0227 Add GLTexture::setSwizzle()
This method allows the caller to specify which component of a texel
is placed in each respective component of the vector returned to the
shader.
10 years ago
Fredrik Höglund 4d738b86ea Add an internalFormat parameter to the GLTexture ctor
This parameter is ignored on GLES.
10 years ago
Fredrik Höglund 74b65fcd00 Add support for GL_ARB_texture_storage
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.
10 years ago
Fredrik Höglund 450be6a378 Add a levels parameter to the GLTexture ctor
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.
10 years ago
Fredrik Höglund 9d01ed16be Remove GLTexturePrivate::bind()/unbind()
These virtual methods are not reimplemented anywhere.
10 years ago
Fredrik Höglund 383a5ac319 Remove GLTexturePrivate::convertToGLFormat()
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.
10 years ago
Fredrik Höglund cb39eb0cc5 Use consistent names for the static members in GLTexturePrivate 10 years ago
Fredrik Höglund 854f66c164 Make s_supportsUnpack a static member of GLTexturePrivate 10 years ago
Fredrik Höglund edb0751cba Remove the NPOT texture support checks
We require OpenGL 2.0 which always supports NPOT textures.
10 years ago
Fredrik Höglund 181afc85fe Remove the saturation support checks
We no longer use texture environment parameters to control saturation.
10 years ago
Martin Gräßlin b8cc10ffab [kwinglutils] Improve cleanup handling
* 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
11 years ago
Egor Matirov 05c2849fee Added export header through cmake for libkwinglutils
REVIEW: 114265
11 years ago
Martin Gräßlin 416898ecfa Remove kwinglobals.h include where not needed any more
Most headers only included kwinglobals.h just for the KWIN_EXPORT
macro. As that's not used any more, we don't need that include any
more.
11 years ago
Jacob Logan 0c4518cca9 added export header through cmake for kwineffects
REVIEW: 114233
11 years ago
Thomas Lübking 3f5ef10c8e introduce GLTexture::clear and use it from paintredirector
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
11 years ago
Fredrik Höglund 7a99b8c0ef kwin: Add GLTexture::matrix()
This method returns a matrix that transforms normalized or un-normalized
texture coordinates, taking the texture target and y-inversion flag into
account.
11 years ago
Martin Gräßlin 9206f530ce Adding support for GL_EXT_texture_format_BGRA8888 in GLES
If extension is present texture format BGRA_EXT is used for loading
textures from QImages.

REVIEW: 109090
12 years ago
Martin Gräßlin 32b6ef42b9 Strip module path from all Qt #include <>
Done with:
fixqt4headers.pl --strip-modules

REVIEW: 109176
12 years ago
Martin Gräßlin b01f5684c5 Remove not needed includes from kwineffect header files
Only include what's actually needed in the headers. This causes of course
some additional needed includes in some implementation files.
12 years ago
Philipp Knechtges f5b5e5c8d0 kwin: cleaning up the GLTexture API 13 years ago
Philipp Knechtges 87bcabdf99 kwin: improving the texture update handling
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
13 years ago
Martin Gräßlin 309b94c10e Add newline at end of file
KRAZY--
SVN_SILENT
13 years ago
Philipp Knechtges 4f50a8df3c kwin: Implement "use by value" and implicit sharing for GLTexture.
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
13 years ago