Commit Graph

18 Commits

Author SHA1 Message Date
Emmanuel Gil Peyrot eff793ab46 Fix indentation all through the project
Fixes a “regression” from 04918f3b0b, but
also other missed pieces.
2021-07-31 15:28:20 +00:00
Stefan Agner db905f4671 shared/platform: avoid build warning when building without gl-renderer
When building without GL renderer the compiler prints the following
warning:
  ../clients/subsurfaces.c: In function ‘egl_state_create’:
  ../clients/subsurfaces.c:225:35: warning: passing argument 1 of
  ‘weston_platform_get_egl_display’ makes pointer from integer without a
  cast [-Wint-conversion]
    225 |   weston_platform_get_egl_display(EGL_PLATFORM_WAYLAND_KHR,
        |                                   ^~~~~~~~~~~~~~~~~~~~~~~~
        |                                   |
        |                                   int
...

Define the fallback implementation of weston_platform_get_egl_display
to take an integer which is the underlaying datatype of EGLenum.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2019-07-26 13:47:15 +02:00
Emil Velikov 3612be2302 shared/platform.h: introduce weston_platform_destroy_egl_surface()
Introduce the weston_platform_destroy_egl_surface() wrapper to
complement the weston_platform_create_egl_surface() one.

We'll use the former with the next patches trhoughout weston to
consistently destroy the surface as needed.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 16:07:05 +00:00
Krzysztof Konopko e338ced1e0 shared/platform: include weston-egl-ext.h only if ENABLE_EGL is defined
Including `weston-egl-ext.h` causes compilation failure for configurations
with EGL disabled.

Verified with `--disable-egl`, `--disable-x11-compositor`
and `--disable-drm-compositor`.

Signed-off-by: Krzysztof Konopko <kris@youview.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-09-26 16:50:31 +03:00
Emil Velikov 07448943e5 shared/platform.h: remove the local EGL platform (re)definitions
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-07-22 15:29:19 +01:00
Emil Velikov d0fcdc955e shared/platform.h: use weston_check_egl_extension over strstr
The later can give false positives.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-07-22 15:28:45 +01:00
Emil Velikov f0c3a1c112 gl-renderer: move check_extension() to shared/
... prefixing it with a "weston_". This way we can reuse it across the
board, instead of the current strstr. The latter of which can give us
false positives, thus it will be resolved with next commit(s).

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-07-22 15:28:32 +01:00
Emil Velikov 10772dba04 shared/platform.h: add missing stdbool.h include
Required by the bool type, used through the header.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-07-22 15:23:27 +01:00
Matthias Treydte cd9424ef2a platform: explicitly cast the return value of weston_platform_get_egl_proc_address
This allows the header to be consumed by C++ compilers, because C++ does
away with C's implicit cast from (void*).
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-08 23:23:26 -08:00
Ahmet Acar 64d78bba9c shared: work around EGL header idiosyncrasy
When no X11 headers are present eglplatform.h will break unless
certain defines are set prior to its inclusion.

including wayland-egl.h defines WL_EGL_PLATFORM which will stop
the attempted inclusion of the X11 headers.

Maybe this isn't the best solution to the problem, but it's harmless
and gets the job done.

Closes bug: https://bugs.freedesktop.org/show_bug.cgi?id=92104

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
(patch by Ahmet Acar, commit log by Derek Foreman)
2015-11-13 10:25:46 -06:00
Bryce Harrington 6c6164c5ba shared: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:18 -07:00
Manuel Bachmann 5d1d2ca325 toytoolkit: fix EGL surface creation for lazy drivers
Some DRI drivers, including VMware vmwgfx, do not support
calling eglQueryString() with a EGL_NO_DISPLAY parameter.

Allow toytoolkit to create EGL surfaces with them, by
falling back to the old creation method.

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-30 15:42:16 +03:00
Manuel Bachmann e812859527 toytoolkit: fix new EGL extensions fallback typedefs
The dummy typedefs for "get_platform_display()" and
"create_platform_window()" were badly defined, which
prevented building Weston on older systems.

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-30 15:26:15 +03:00
Jonny Lamb abff883d2c platform: rename create_egl_window to create_egl_surface
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-26 09:54:49 +02:00
Jonny Lamb 759fbf4d0f platform: remove global variables
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-26 09:54:49 +02:00
Jonny Lamb 0e2ab36df7 platform: provide platform_base fallbacks and remove ifdefs
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-26 09:54:49 +02:00
Jonny Lamb 4bdcb5732b clients & tests: use eglCreatePlatformWindowSurfaceEXT when supported
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-20 13:57:24 -07:00
Jonny Lamb 51a7ae5f89 clients & tests: use eglGetPlatformDisplayEXT when supported
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-20 13:56:38 -07:00