| author | Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> | 2012-09-10 12:55:53 (GMT) |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-09-14 17:54:28 (GMT) |
| commit | d7f282b84e1729f4692488a8af7e696e4d6b69d7 (patch) (unidiff) | |
| tree | fa1066ca5015ad1ce5dd9242449b9da87b8416f2 | |
| parent | 231ba171c6af2e379c45e4ae997cb56573f87375 (diff) | |
| download | weston-d7f282b84e1729f4692488a8af7e696e4d6b69d7.zip weston-d7f282b84e1729f4692488a8af7e696e4d6b69d7.tar.gz | |
simple-egl: Set the opaque region if windowed and -o is passed
Since commit 6a615d262141de7cf094788203d9c044dfb9f08d [1], the opaque
region would be set only when running fullscreen. Having it set
properly for the windowed case is helpful to test the overlay path in
compositor-drm.
What this patch does is:
- reverts the above commit;
- remove the "if fullscreen make the window opaque" conditional, that
should have been removed when -o was introduced and was actually the
cause for the bug solved in [1];
- sets the opaque region when running fullscreen, regardless of the -o
switch.
[1] commit 6a615d262141de7cf094788203d9c044dfb9f08d
Author: Scott Moreau <oreaus@gmail.com>
Date: Thu Aug 30 14:44:16 2012 -0600
simple-egl: Only set alpha_size=0 when -o is passed.
v2: - Clarify in the commit message that this does not regress the bug
solved in [1].
- Use the correct sha1 for the reverted commit.
| -rw-r--r-- | clients/simple-egl.c | 13 |
1 files 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) | |||
| 280 | window->configured = 0; | 280 | window->configured = 0; |
| 281 | 281 | ||
| 282 | if (fullscreen) { | 282 | if (fullscreen) { |
| 283 | window->opaque = 1; | ||
| 284 | wl_shell_surface_set_fullscreen(window->shell_surface, | 283 | wl_shell_surface_set_fullscreen(window->shell_surface, |
| 285 | WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, | 284 | WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, |
| 286 | 0, NULL); | 285 | 0, NULL); |
| 287 | } else { | 286 | } else { |
| 288 | window->opaque = 0; | ||
| 289 | wl_shell_surface_set_toplevel(window->shell_surface); | 287 | wl_shell_surface_set_toplevel(window->shell_surface); |
| 290 | handle_configure(window, window->shell_surface, 0, | 288 | handle_configure(window, window->shell_surface, 0, |
| 291 | window->window_size.width, | 289 | window->window_size.width, |
| @@ -403,7 +401,7 @@ redraw(void *data, struct wl_callback *callback, uint32_t time) | |||
| 403 | 401 | ||
| 404 | eglSwapBuffers(window->display->egl.dpy, window->egl_surface); | 402 | eglSwapBuffers(window->display->egl.dpy, window->egl_surface); |
| 405 | 403 | ||
| 406 | if (window->opaque) { | 404 | if (window->opaque || window->fullscreen) { |
| 407 | region = wl_compositor_create_region(window->display->compositor); | 405 | region = wl_compositor_create_region(window->display->compositor); |
| 408 | wl_region_add(region, 0, 0, | 406 | wl_region_add(region, 0, 0, |
| 409 | window->window_size.width, | 407 | window->window_size.width, |
| @@ -594,7 +592,7 @@ main(int argc, char **argv) | |||
| 594 | struct sigaction sigint; | 592 | struct sigaction sigint; |
| 595 | struct display display = { 0 }; | 593 | struct display display = { 0 }; |
| 596 | struct window window = { 0 }; | 594 | struct window window = { 0 }; |
| 597 | int i, opaque = 0; | 595 | int i; |
| 598 | 596 | ||
| 599 | window.display = &display; | 597 | window.display = &display; |
| 600 | display.window = &window; | 598 | display.window = &window; |
| @@ -605,7 +603,7 @@ main(int argc, char **argv) | |||
| 605 | if (strcmp("-f", argv[i]) == 0) | 603 | if (strcmp("-f", argv[i]) == 0) |
| 606 | window.fullscreen = 1; | 604 | window.fullscreen = 1; |
| 607 | else if (strcmp("-o", argv[i]) == 0) | 605 | else if (strcmp("-o", argv[i]) == 0) |
| 608 | opaque = 1; | 606 | window.opaque = 1; |
| 609 | else if (strcmp("-h", argv[i]) == 0) | 607 | else if (strcmp("-h", argv[i]) == 0) |
| 610 | usage(EXIT_SUCCESS); | 608 | usage(EXIT_SUCCESS); |
| 611 | else | 609 | else |
| @@ -621,10 +619,7 @@ main(int argc, char **argv) | |||
| 621 | wl_display_get_fd(display.display, event_mask_update, &display); | 619 | wl_display_get_fd(display.display, event_mask_update, &display); |
| 622 | wl_display_iterate(display.display, WL_DISPLAY_READABLE); | 620 | wl_display_iterate(display.display, WL_DISPLAY_READABLE); |
| 623 | 621 | ||
| 624 | if (window.fullscreen) | 622 | init_egl(&display, window.opaque); |
| 625 | window.opaque = 1; | ||
| 626 | |||
| 627 | init_egl(&display, opaque); | ||
| 628 | create_surface(&window); | 623 | create_surface(&window); |
| 629 | init_gl(&window); | 624 | init_gl(&window); |
| 630 | 625 | ||
