Re: [PATCH weston RFC] compositor-wayland: Support building without EGL

2017-01-17 Thread Daniel Stone
Hi,

On 10 December 2016 at 00:21, Daniel Stone  wrote:
> On 9 December 2016 at 21:58, Armin Krezović  wrote:
>> +#ifdef ENABLE_EGL /* Defined but not used */
>> +#ifdef ENABLE_EGL /* Force pixman when EGL support is disabled */
>> b->use_pixman = new_config->use_pixman;
>> +#else
>> +   b->use_pixman = true;
>> +#endif
>
> Bikeshedding a bit, I don't think these comments really add anything,
> and I'd just ditch them when applying. But that being said:
> Acked-by: Daniel Stone 
>
> and if no-one beats me to setting up an EGL-less environment to test
> it, I'll upgrade to R-b when I do.

No-one did.

To ssh://git.freedesktop.org/git/wayland/weston
   3b7c207..b08e1a5  push -> master

Cheers,
Daniel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston RFC] compositor-wayland: Support building without EGL

2016-12-09 Thread Daniel Stone
Hi Armin,

On 9 December 2016 at 21:58, Armin Krezović  wrote:
> +#ifdef ENABLE_EGL /* Defined but not used */
> +#ifdef ENABLE_EGL /* Force pixman when EGL support is disabled */
> b->use_pixman = new_config->use_pixman;
> +#else
> +   b->use_pixman = true;
> +#endif

Bikeshedding a bit, I don't think these comments really add anything,
and I'd just ditch them when applying. But that being said:
Acked-by: Daniel Stone 

and if no-one beats me to setting up an EGL-less environment to test
it, I'll upgrade to R-b when I do.

Thanks! (And yes, I'll modify pixel-formats to suit.)

Cheers,
Daniel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston RFC] compositor-wayland: Support building without EGL

2016-12-09 Thread Armin Krezović
Signed-off-by: Armin Krezović 
---
 Makefile.am|  1 +
 configure.ac   |  9 ++---
 libweston/compositor-wayland.c | 23 ++-
 3 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2219e3d5..704d17af 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -383,6 +383,7 @@ wayland_backend_la_LDFLAGS = -module -avoid-version
 wayland_backend_la_LIBADD =\
$(COMPOSITOR_LIBS)  \
$(WAYLAND_COMPOSITOR_LIBS)  \
+   $(WAYLAND_COMPOSITOR_EGL_LIBS)  \
libshared-cairo.la
 wayland_backend_la_CFLAGS =\
$(COMPOSITOR_CFLAGS)\
diff --git a/configure.ac b/configure.ac
index 1e251bfe..0542332c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -237,11 +237,14 @@ AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, 
$ac_wayland_protocols_pkgdatadir)
 AC_ARG_ENABLE(wayland-compositor, [  --enable-wayland-compositor],,
  enable_wayland_compositor=yes)
 AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
-  test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes)
-if test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes; then
+  test x$enable_wayland_compositor = xyes)
+if test x$enable_wayland_compositor = xyes; then
   AC_DEFINE([BUILD_WAYLAND_COMPOSITOR], [1],
[Build the Wayland (nested) compositor])
-  PKG_CHECK_MODULES(WAYLAND_COMPOSITOR, [wayland-client >= 
$WAYLAND_PREREQ_VERSION wayland-egl wayland-cursor])
+  PKG_CHECK_MODULES(WAYLAND_COMPOSITOR, [wayland-client >= 
$WAYLAND_PREREQ_VERSION wayland-cursor])
+  if test x$enable_egl = xyes; then
+PKG_CHECK_MODULES(WAYLAND_COMPOSITOR_EGL, [wayland-egl])
+  fi
 fi
 
 
diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c
index d1e387df..925d2790 100644
--- a/libweston/compositor-wayland.c
+++ b/libweston/compositor-wayland.c
@@ -38,9 +38,12 @@
 #include 
 
 #include 
-#include 
 #include 
 
+#ifdef ENABLE_EGL
+#include 
+#endif
+
 #include "compositor.h"
 #include "compositor-wayland.h"
 #include "gl-renderer.h"
@@ -386,6 +389,7 @@ draw_initial_frame(struct wayland_output *output)
  output->base.current_mode->height);
 }
 
+#ifdef ENABLE_EGL /* Defined but not used */
 static void
 wayland_output_update_gl_border(struct wayland_output *output)
 {
@@ -455,6 +459,7 @@ wayland_output_update_gl_border(struct wayland_output 
*output)
   
cairo_image_surface_get_stride(output->gl.border.bottom) / 4,
   
cairo_image_surface_get_data(output->gl.border.bottom));
 }
+#endif
 
 static void
 wayland_output_start_repaint_loop(struct weston_output *output_base)
@@ -480,6 +485,7 @@ wayland_output_start_repaint_loop(struct weston_output 
*output_base)
wl_display_flush(wb->parent.wl_display);
 }
 
+#ifdef ENABLE_EGL
 static int
 wayland_output_repaint_gl(struct weston_output *output_base,
  pixman_region32_t *damage)
@@ -498,6 +504,7 @@ wayland_output_repaint_gl(struct weston_output *output_base,
 &ec->primary_plane.damage, damage);
return 0;
 }
+#endif
 
 static void
 wayland_output_update_shm_border(struct wayland_shm_buffer *buffer)
@@ -665,9 +672,11 @@ wayland_output_disable(struct weston_output *base)
 
if (b->use_pixman) {
pixman_renderer_output_destroy(&output->base);
+#ifdef ENABLE_EGL
} else {
gl_renderer->output_destroy(&output->base);
wl_egl_window_destroy(output->gl.egl_window);
+#endif
}
 
wayland_output_destroy_shm_buffers(output);
@@ -702,6 +711,7 @@ wayland_output_destroy(struct weston_output *base)
 
 static const struct wl_shell_surface_listener shell_surface_listener;
 
+#ifdef ENABLE_EGL
 static int
 wayland_output_init_gl_renderer(struct wayland_output *output)
 {
@@ -737,6 +747,7 @@ cleanup_window:
wl_egl_window_destroy(output->gl.egl_window);
return -1;
 }
+#endif
 
 static int
 wayland_output_init_pixman_renderer(struct wayland_output *output)
@@ -785,6 +796,7 @@ wayland_output_resize_surface(struct wayland_output *output)
wl_region_destroy(region);
}
 
+#ifdef ENABLE_EGL
if (output->gl.egl_window) {
wl_egl_window_resize(output->gl.egl_window,
 width, height, 0, 0);
@@ -811,6 +823,7 @@ wayland_output_resize_surface(struct wayland_output *output)
cairo_surface_destroy(output->gl.border.bottom);
output->gl.border.bottom = NULL;
}
+#endif
 
wayland_output_destroy_shm_buffers(output);
 }
@@ -1037,11 +1050,13 @@ wayland_output_switch_mode(struct weston_output 
*output_base,
pixman_renderer_output_destroy(output_base);
if (wayland_output_init_pixman_renderer(output) < 0)