mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-16 00:20:32 +01:00
xwayland/present: Redirect surface window as needed for page flips
It's needed when the surface window is a depth 24 descendant of a depth
32 toplevel window.
xwl_source_validate ensures the toplevel window pixmap has valid
contents when a client reads from it, or when the window hierarchy /
geometry changes. It's never called in the normal fullscreen application
case, so there's no GPU copy overhead with that.
v2:
* Don't try to redirect a depth 32 descendant of different-depth
ancestors, the alpha channel wouldn't be handled correctly.
(Olivier Fourdan)
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1300>
(cherry picked from commit c7d56b0e29)
This commit is contained in:
parent
fba908ab35
commit
d0cdffebe6
1 changed files with 7 additions and 2 deletions
|
|
@ -45,6 +45,7 @@
|
|||
#include "xwayland-dmabuf.h"
|
||||
#include "xwayland-glamor.h"
|
||||
#include "xwayland-glamor-gbm.h"
|
||||
#include "xwayland-present.h"
|
||||
#include "xwayland-screen.h"
|
||||
#include "xwayland-window.h"
|
||||
#include "xwayland-window-buffers.h"
|
||||
|
|
@ -95,8 +96,12 @@ xwl_glamor_check_flip(WindowPtr present_window, PixmapPtr pixmap)
|
|||
ScreenPtr screen = pixmap->drawable.pScreen;
|
||||
PixmapPtr backing_pixmap = screen->GetWindowPixmap(present_window);
|
||||
|
||||
if (pixmap->drawable.depth != backing_pixmap->drawable.depth)
|
||||
return FALSE;
|
||||
if (pixmap->drawable.depth != backing_pixmap->drawable.depth) {
|
||||
if (pixmap->drawable.depth == 32)
|
||||
return FALSE;
|
||||
|
||||
return xwl_present_maybe_redirect_window(present_window, pixmap);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue