Commit Graph

20 Commits

Author SHA1 Message Date
Jonny Lamb a3e6a4a87a gl-renderer: move all EGL_PLATFORM_* defines here
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-26 09:54:48 +02:00
Jonny Lamb 445fb697a5 gl-renderer: fix build with --disable-egl
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-26 09:54:48 +02:00
Jonny Lamb 62185f42ea compositor-{drm, x11, wayland}: stop including EGL headers here
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-26 09:54:48 +02:00
Jonny Lamb 671148f064 gl-renderer: use eglCreatePlatformWindowSurfaceEXT to get EGLSurfaces
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-20 13:57:14 -07:00
Jonny Lamb 70eba3fbde gl-renderer: use eglGetPlatformDisplayEXT to get an EGLDisplay
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-20 13:55:46 -07:00
John Kåre Alsaker 791324cc06 gl-renderer: Remove gl_renderer_interface from gl-renderer.h
The rationale here is, that this line would create an instance of
gl_renderer_interface in every compilation unit that included
gl-renderer.h. This is not necessary, and it can actually be harmful by
masking the real exported gl_renderer_interface symbol, if you added
another compilation unit to gl-renderer.so, causing a runtime failure in
loading it.

gl-renderer.c already creates the exported symbol.
2014-04-21 15:43:05 -07:00
Jason Ekstrand c107306db7 gl-renderer: Fix a typo in the output_set_border description
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-11 09:59:26 -07:00
Neil Roberts 77c1a5b7dc Add support for having different GBM formats for different outputs
The gbm-format configuration option can now be specified per-output as
well as in the core config section. If it is not specified it will
default to the format specified in the core section. The
EGL_MESA_configless_context extension is required for this to work. If
this extension is available it will create a context without an
EGLConfig and then it will potentially use a different EGLConfig for
each output.

The gl-renderer interface has been changed so that it takes the EGL
attributes and visual ID in the create_output function as well as in
the create function.
2014-03-12 14:44:02 -07:00
Pekka Paalanen e47d0d986c gl: fix fallback definition of EGL_DEFAULT_DISPLAY
Compiling fbdev backend on RaspberryPi caused the following warning:

compositor-fbdev.c: In function 'fbdev_compositor_create':
compositor-fbdev.c:929:6: warning: passing argument 2 of
'gl_renderer->create' makes integer from pointer without a cast [enabled
by default]
compositor-fbdev.c:929:6: note: expected 'EGLNativeDisplayType' but
argument is of type 'void *'

Fix the definition of EGL_DEFAULT_DISPLAY to match the definition in
EGL/egl.h (of Mesa).

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-12-04 11:37:57 -08:00
Jason Ekstrand 310382fb2f gl-renderer: Remove the renderer-global border support
This was only ever used by the wayland backend and is no longer used there.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-07 16:34:13 -08:00
Jason Ekstrand 0b61bf444b gl-renderer: Add support for per-output multi-texture borders.
The first advantage of this new API is that it is per-output instead of
global to the gl_renderer instance.  This means that different windows can
have different titles, different button states, etc.  The new api also uses
four textures (one for each side) instead of one.  This allows you to draw
real borders with text and buttons in them instead of a simple image that
gets streached.

Images will be scaled as needed, so the right and left can be one pixel
tall if desired.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-11-07 16:34:08 -08:00
Ander Conselvan de Oliveira 97f2952bca gl-renderer: Build as a loadable module
The time spent loading EGL and GLES libraries from disk can be a
considerable hit in some embedded use cases. If Weston is compiled
with EGL support, the binary will depend on those libraries, even if
a software renderer is in use.

This patch splits the GL renderer into a separate loadable module,
and moves the dependency on EGL and GLES to it. The backends still
need the EGL headers for the native types and EGLint. The function
load_module() is renamed to weston_load_module() and exported, so
that it can be used by the backends.

The gl renderer interface is changed so that there is only one symbol
that needs to be dlsym()'d. This symbol contains pointers to all the
functions and data necessary to interact with the renderer. As a side
effect, this change simplifies gl-renderer.h a great deal.
2013-10-14 15:02:20 -07:00
Kristian Høgsberg 9acd374822 fbdev: Fix compilation without EGL
We have to duplicate #defines and typedefs for the EGL types and constants
we use in gl-renderer.h so we can compile the fbdev backend without EGL.

https://bugs.freedesktop.org/show_bug.cgi?id=70392
2013-10-11 15:26:35 -07:00
Daniel Stone c228e23b05 configure.ac: Enable AC_USE_SYSTEM_EXTENSIONS
AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar
macros to expose the largest extent of functionality supported by the
underlying system.  This is required since these macros are often
limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually
on some systems hide declarations which are not part of the X/Open spec.

Since this goes into config.h rather than the command line, ensure all
source is consistently including config.h before anything else,
including system libraries.  This doesn't need to be guarded by a
HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org
modular transition.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>

[pq: rebased and converted more files]
2013-06-05 01:16:34 -04:00
Vasily Khoruzhick 26def5ca8e gl-renderer: make EGL typedefs similar to EGL/egl.h when building without EGL support
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
2013-01-15 16:00:16 -05:00
Vasily Khoruzhick 1bfe2e6f4b Make EGL/GLESv2 dependencies optional
Introduce --disable-egl switch for configure to disable
EGL/GLESv2 support.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
2013-01-08 15:32:00 -05:00
Vasily Khoruzhick 52cfd61cdb renderer: introduce destroy callback
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
2013-01-08 15:31:08 -05:00
Pekka Paalanen 326529f900 gl, rpi: consolidate print_egl_error_state()
Rename print_egl_error_state() to gl_renderer_print_egl_error_state()
and exports it.

Remove the copy of that function from the rpi backend, and call
the exported function instead.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-11-27 11:12:48 -05:00
John Kåre Alsaker 779b52ac3a Rename gles2-renderer to gl-renderer. 2012-11-13 17:06:19 -05:00
John Kåre Alsaker 30d2b1fd4b Move EGL and GL includes to a gles2-renderer header. 2012-11-13 17:03:47 -05:00