Commit graph

46 commits

Author SHA1 Message Date
Martin Gräßlin
32422fd8cc Drop kwinconfig.h include from kwinglutils_funcs.h
Not used.
2016-11-17 14:25:28 +01:00
Martin Gräßlin
9d8833afdc Remove kwinglobal.h include from kwinglutils_funcs.h
Not used.
2016-11-17 14:18:00 +01:00
Martin Gräßlin
dcf7f40c18 [kwinglutils] Drop eglResolveFunctions
Summary:
Method doesn't do anything. If at some point we want to resolve egl
functions again, it should be done in the Platform, just like
glxResolveFunctions is nowadays done in the platform.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3391
2016-11-17 12:59:48 +01:00
Martin Gräßlin
d7fa827644 Pass function ptr to resolve glFunctions to initGL
Summary:
KWin still resolves some OpenGL function pointers. For that it needs to
use either eglGetProcAddress or glxGetProcAddress. With other words the
method to resolve needs to know whether it is egl or glx and needs both
a dependency to egl and glx. Especially the dependency to glx is ugly as
that pulls in XLib into our library.

The way so far was to pass an enum value to the initGL method to know
whether it's EGL or GLX. With this change the enum value is removed and
replaced by a function pointer to resolve the methods.

This simplifies the resolve code and allows to completely remove the glx
variant we still had in the library. Thus kwinglutils library is now glx
and XLib free.

Test Plan: nested KWin with OpenGL/EGL still works

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3336
2016-11-16 17:59:26 +01:00
Martin Gräßlin
feac312ee0 Move resolving glxSwapIntervalMesa into platform plugin
Summary:
No need to resolve glx methods through the shared lib. At the moment
this duplicates some code, but will be cleaned up with a follow up
change.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3335
2016-11-16 09:06:47 +01:00
Martin Gräßlin
01451eea36 Revert "Handle conflicts between epoxy and manually resolved function pointers"
This reverts commit ac1dbac8b1.
2015-11-17 14:58:59 +01:00
Martin Gräßlin
ac1dbac8b1 Handle conflicts between epoxy and manually resolved function pointers
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
2015-11-11 08:04:29 +01:00
Martin Gräßlin
03231942bb Bind building of glx support on whether epoxy has a glx header
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.
2015-11-03 09:29:31 +01:00
Martin Gräßlin
c24e315a9b Drop build option KWIN_BUILD_EGL
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
2015-08-11 11:15:25 +02:00
Fredrik Höglund
aa7f9f26f6 Fix the GLES build 2014-07-22 13:07:48 +02:00
Fredrik Höglund
b1586daab4 Remove the GL_QUADS_KWIN definition
GL_QUADS is always defined now that we're using libepoxy.
2014-07-22 12:56:32 +02:00
Fredrik Höglund
3b8b1455a6 Use libepoxy to resolve GL functions
Remove the manually written GL dispatch code, and use libepoxy
to resolve functions.

The only exceptions are GLX_MESA_swap_control, which is not in
the XML API registry, and GL_ARB_robustness/GL_EXT_robustness.
For the latter we want to resolve the functions to the same names
on both GLES and desktop GL, and plug in our own implementations
when the extension is not supported.
2014-07-14 12:04:37 +02:00
Martin Gräßlin
afbc5222e1 Merge branch 'KDE/4.11' into master
Conflicts:
	CMakeLists.txt
	doc/kcontrol/screensaver/index.docbook
	kcontrol/krdb/krdb.cpp
	kscreensaver/kblank_screensaver/kblank.desktop
	kscreensaver/krandom_screensaver/krandom.desktop
	kscreensaver/libkscreensaver/main.cpp
	ksplash/ksplashqml/SplashApp.cpp
	kstyles/oxygen/config/main.cpp
	kstyles/oxygen/demo/main.cpp
	kstyles/oxygen/oxygenstylehelper.cpp
	kwin/clients/oxygen/config/oxygenexceptiondialog.cpp
	kwin/clients/oxygen/config/ui/oxygenconfigurationui.ui
	kwin/clients/oxygen/config/ui/oxygenexceptiondialog.ui
	kwin/clients/oxygen/demo/main.cpp
	kwin/clients/oxygen/oxygenconfigdata.kcfg
	kwin/egl_wayland_backend.cpp
	kwin/eglonxbackend.h
	kwin/glxbackend.cpp
	kwin/glxbackend.h
	kwin/kcmkwin/kwinoptions/kwinactions.desktop
	kwin/scene_opengl.cpp
	kwin/scene_opengl.h
	plasma/desktop/applets/pager/pager.cpp
	plasma/desktop/shell/activitymanager/activitymanager.cpp
	plasma/desktop/shell/activitymanager/activitymanager.h
	plasma/desktop/shell/controllerwindow.cpp
	plasma/desktop/shell/data/plasma-desktop.desktop
	plasma/generic/dataengines/geolocation/geolocation.cpp
	plasma/generic/dataengines/nowplaying/plasma-dataengine-nowplaying.desktop
	plasma/generic/wallpapers/color/plasma-wallpaper-color.desktop
	plasma/generic/wallpapers/image/image.cpp
	plasma/generic/wallpapers/image/image.h
2014-01-07 09:36:11 +01:00
Fredrik Höglund
eeb309c149 kwin: Add support for EXT_buffer_age
This patch adds support for GLX_EXT_buffer_age, and
EGL_EXT_buffer_age on X11.
2013-12-12 01:36:46 +01:00
Egor Matirov
05c2849fee Added export header through cmake for libkwinglutils
REVIEW: 114265
2013-12-03 14:37:29 +01:00
Jacob Logan
0c4518cca9 added export header through cmake for kwineffects
REVIEW: 114233
2013-12-02 07:43:26 +01:00
Casian Andrei
4d24fe8b30 Fix many color correction problems with OpenGL ES
On GLES, check for OES_texture_3D extension for color correction

Remove a block of ugly hack code that was supposedly needed to build
with OpenGL ES.

Convert the lookup texture data to uint8 on OpenGL ES before sending it
via glTexImage3D, because uint16 is not supported.

Check if the shaders have been reinitialized successfuly when trying to
activate color correction, prevent black screens when there are issues
with the shaders.

BUG: 315419
REVIEW: 111225
(cherry picked from commit 68c68ee3c2b54f968c4d8275f1e8a2e0ccc90dd7)
2013-07-28 17:44:06 +03:00
Casian Andrei
54ee2bf564 Fix many color correction problems with OpenGL ES
On GLES, check for OES_texture_3D extension for color correction

Remove a block of ugly hack code that was supposedly needed to build
with OpenGL ES.

Convert the lookup texture data to uint8 on OpenGL ES before sending it
via glTexImage3D, because uint16 is not supported.

Check if the shaders have been reinitialized successfuly when trying to
activate color correction, prevent black screens when there are issues
with the shaders.

BUG: 315419
REVIEW: 111225
2013-07-23 19:48:47 +03:00
Fredrik Höglund
7e22bd314c kwin: Add support for rendering quads using an index buffer
This reduces the size of the geometry that needs to be uploaded by
one-third, and allows kwin to take advantage of the post-transform
cache in the GPU.
2013-06-05 00:41:24 +02:00
Fredrik Höglund
479ea5db61 kwin: Resolve functions for GL_ARB_copy_buffer 2013-06-05 00:41:24 +02:00
Fredrik Höglund
5e7b2a34a8 kwin: Resolve functions for GL_ARB_draw_elements_base_vertex 2013-06-05 00:41:23 +02:00
Martin Gräßlin
ad1203e3b2 Add defines from EXT_robustness
Seem to be missing in the headers used on build.kde.org.
2013-05-23 08:38:16 +02:00
Fredrik Höglund
2f87b7542f kwin/es: Resolve functions for GL_EXT_robustness 2013-05-21 00:22:57 +02:00
Fredrik Höglund
adc581d2ab kwin: Resolve functions for GL_ARB_robustness
Only the subset of functions available in core contexts is resolved,
except for glGetnTexImageARB() and glGetnUniformivARB(), which are
not used by kwin.

Instead of setting the function pointers to NULL when the extension isn't
supported, kwin provides its own implementations that call the non-robust
versions of the functions.  This is so callers don't have to check if the
extension is supported before calling the functions.
2013-05-21 00:22:55 +02:00
Fredrik Höglund
e65f717b47 kwin/es: Resolve functions for GL_EXT_map_buffer_range 2013-05-08 18:36:50 +02:00
Fredrik Höglund
b6585c2d8b kwin/es: Resolve functions for GL_OES_mapbuffer 2013-05-08 18:36:45 +02:00
Fredrik Höglund
11b9323f3d kwin: Resolve functions for GL_ARB_map_buffer_range 2013-05-08 18:36:38 +02:00
Fredrik Höglund
08d3b6cc3a kwin: Resolve more functions from ARB_vertex_buffer_object
This patch resolves:
    glMapBuffer()
    glUnmapBuffer()
    glBufferSubData()
    glGetBufferSubData()
2013-05-08 18:36:04 +02:00
Fredrik Höglund
e0003db385 kwin: Resolve functions for GL_EXT_gpu_shader4 2013-05-08 18:33:02 +02:00
Fredrik Höglund
2bcad53bbb kwin: Resolve functions for GL_ARB_vertex_array_object 2013-05-08 18:33:02 +02:00
Fredrik Höglund
d116ef6655 kwin/egl: Add defines for EGL_KHR_create_context 2013-05-08 18:33:01 +02:00
Fredrik Höglund
aab026af93 kwin: Resolve functions for GLX_ARB_create_context 2013-05-08 18:12:43 +02:00
Martin Gräßlin
7ab5df9de8 Define GL_UNPACK_* for gles if not defined
Should fix build error in build.kde.org.
2013-03-11 12:36:40 +01:00
Ralf Jung
96bc979ca8 Fix buffer swap prototypes
BUG: 309647
REVIEW: 107302
2012-11-18 12:50:31 +01:00
Martin Gräßlin
ba08ff6a14 Fix build error when GLES is not available
Note to me: always rebuild with all possible build options if something
is changed.

Sorry for the inconvenience and thanks to the early report of the issue.

BUG: 307866
FIXED-IN: 4.10
2012-10-06 13:44:12 +02:00
Martin Gräßlin
476adac337 Do not resolve glx functions specified in GLX 1.3
According to the OpenGL ABI for Linux GLX 1.3 is a minimum requirement.
Therefore we do not need to resolve the symbols which are present in that
version.

KWin did always require at least 1.3, for all the resolved functions
there were checks in the Scene, but they might have been incorrect.
Instead now the GLX version is checked and OpenGL compositing is blocked
if there is not at least GLX 1.3.

REVIEW: 106704
2012-10-04 17:17:51 +02:00
Martin Gräßlin
15d714d82c Do not resolve glBlendColor
glBlendColor has been added to OpenGL 1.2 which means it is part of
the OpenGL ABI defined for Linux.

See http://www.opengl.org/registry/ABI/ section 3.4.
2012-10-04 17:17:45 +02:00
Martin Gräßlin
a401558a43 Provide OpenGL over Egl
The Egl backend is decoupled from the OpenGL ES build option which makes
it possible to use it as a replacement for glx.

To make this possible a new build flag is added when egl is available at
compile time and any egl specific code is now ifdefed with this flag
instead of the gles flag. In addition at runtime a windowing system enum
value is passed to the various detect methods to have egl/glx specific
detection for e.g. function pointer resolving.

By default egl is used if compiled with OpenGL ES, otherwise glx is used.
But in the non-gles case the windowing system can be selected through the
new environment variable KWIN_OPENGL_INTERFACE. Setting this variable to
"egl" the EglOnXBackend is used.

REVIEW: 106632
2012-10-04 17:17:01 +02:00
Thomas Lübking
fc665106c9 Swap vsync order, trade in 1frame lag
REVIEW: 103058
2012-05-17 11:41:26 +02:00
Christoph Thielecke
99b233e2ed define missing defines if nessary 2012-03-22 15:10:30 +01:00
Pierre-Loup A. Griffais
7fff9705b4 kwin-gles: define EGL_POST_SUB_BUFFER_SUPPORTED_NV if it's not there
This fixes the build with older versions of eglext.h.

REVIEW: 102915
2011-10-19 20:15:40 +02:00
Pierre-Loup A. Griffais
2570e9ec61 kwin-gles: add support for EGL_NV_post_sub_buffer
The EGL path had no support for presenting sub-regions of the screen, we can
leverage EGL_NV_post_sub_buffer for that. This wouldn't be a win if we didn't
have to opt-out of flipping.

REVIEW: 102889
2011-10-17 20:27:23 +02:00
Martin Gräßlin
225c362a04 Add support for framebuffer blit extension
Resolving of blit function and method in GLRenderTarget to blit
from the framebuffer to the RenderTarget.

REVIEW: 102354
2011-08-20 10:58:27 +02:00
Martin Gräßlin
9c2d6f8fdc Drop hacks for gcc-3.3.3
According to Thiago minimum supported gcc is 4.2.
2011-08-14 08:59:51 +02:00
Martin Gräßlin
f5a187d224 Remove KWIN_HAVE_OPENGL from kwingl(es)utils
Yes building an OpenGL support library requires OpenGL...
2011-08-13 16:46:43 +02:00
Martin Gräßlin
57d11c134a Move kwineffects library into own directory
Second part of cleaning up the lib directory: the effects library
now lives in libkwineffects/ directory.

For existing effects nothing changes as the install path is unchanged.
The change obsoletes the lib/ directory.

As glplatform.h has not yet been exported I dared to export it and
adjust the places where it is used.
CCMAIL: kwin@kde.org
2011-02-19 10:01:31 +01:00
Renamed from lib/kwinglutils_funcs.h (Browse further)