[PATCH 1/3] simple-egl: Set the opaque region if windowed and -o is passed
Scott Moreau
oreaus at gmail.com
Fri Sep 7 13:23:45 PDT 2012
On Fri, Sep 7, 2012 at 7:32 AM, Ander Conselvan de Oliveira <
conselvan2 at gmail.com> wrote:
> Since commit d523a87d2d8c0099d8ac323375b3d083aafccf9a [1],
I'm not sure where you got this sha from but it's wrong. There is no such
commit in weston.
> window.opaque
> would be 1 only in fullscreen mode, causing the opaque region to be set
> only when running in fullscreen mode. Having it set properly for the
> windowed case is helpful to test the overlay path in compositor-drm.
>
> This reverts that commit and makes window.opaque independent of the -f
> switch. Instead, we set the opaque region if the window is fullscreen
> or -o was passed and leave window.opaque alone in the case -f was
> passed.
>
Did you read the entire commit message? It seems you have cut it here so I
will post it:
commit 6a615d262141de7cf094788203d9c044dfb9f08d
Author: Scott Moreau <oreaus at gmail.com>
Date: Thu Aug 30 14:44:16 2012 -0600
simple-egl: Only set alpha_size=0 when -o is passed.
When starting simple-egl with -f for fullscreen and toggling to
'windowed' mode with F11,
the surface is opaque instead of semi-trnasparent as it is when
starting without -f. We
only want to create the surface with alpha_size=0 when the user
explicitly passes -o
because otherwise it will never have the ability to use alpha.
> [1] commit d523a87d2d8c0099d8ac323375b3d083aafccf9a
>
The correct commit id is 6a615d262141de7cf094788203d9c044dfb9f08d, see
above.
> Author: Scott Moreau <oreaus at gmail.com>
> Date: Thu Aug 30 14:44:16 2012 -0600
>
> simple-egl: Only set alpha_size=0 when -o is passed.
> ---
> clients/simple-egl.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/clients/simple-egl.c b/clients/simple-egl.c
> index 808c2ee..a67ce2f 100644
> --- a/clients/simple-egl.c
> +++ b/clients/simple-egl.c
> @@ -280,12 +280,10 @@ toggle_fullscreen(struct window *window, int
> fullscreen)
> window->configured = 0;
>
> if (fullscreen) {
> - window->opaque = 1;
> wl_shell_surface_set_fullscreen(window->shell_surface,
>
> WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
> 0, NULL);
> } else {
> - window->opaque = 0;
> wl_shell_surface_set_toplevel(window->shell_surface);
> handle_configure(window, window->shell_surface, 0,
> window->window_size.width,
> @@ -403,7 +401,7 @@ redraw(void *data, struct wl_callback *callback,
> uint32_t time)
>
> eglSwapBuffers(window->display->egl.dpy, window->egl_surface);
>
> - if (window->opaque) {
> + if (window->opaque || window->fullscreen) {
> region =
> wl_compositor_create_region(window->display->compositor);
> wl_region_add(region, 0, 0,
> window->window_size.width,
> @@ -594,7 +592,7 @@ main(int argc, char **argv)
> struct sigaction sigint;
> struct display display = { 0 };
> struct window window = { 0 };
> - int i, opaque = 0;
> + int i;
>
> window.display = &display;
> display.window = &window;
> @@ -605,7 +603,7 @@ main(int argc, char **argv)
> if (strcmp("-f", argv[i]) == 0)
> window.fullscreen = 1;
> else if (strcmp("-o", argv[i]) == 0)
> - opaque = 1;
> + window.opaque = 1;
> else if (strcmp("-h", argv[i]) == 0)
> usage(EXIT_SUCCESS);
> else
> @@ -621,10 +619,7 @@ main(int argc, char **argv)
> wl_display_get_fd(display.display, event_mask_update, &display);
> wl_display_iterate(display.display, WL_DISPLAY_READABLE);
>
> - if (window.fullscreen)
> - window.opaque = 1;
> -
> - init_egl(&display, opaque);
> + init_egl(&display, window.opaque);
> create_surface(&window);
> init_gl(&window);
>
> --
> 1.7.9.5
>
>
I'm not sure what you're trying to do with your patches here but please
note the problem that this commit fixed and do not break it.
Thanks,
Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20120907/1cd215de/attachment.html>
More information about the wayland-devel
mailing list