xwayland: Don't create wl_buffer backing pixmap
In non-rootless mode, not all pixmaps need a wl_buffer backing. Suggested-by: Twaik Yont (@twaik) in #834 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
This commit is contained in:
parent
edf964434e
commit
0f19381f49
|
@ -66,7 +66,8 @@ xwl_realize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor)
|
||||||
PixmapPtr pixmap;
|
PixmapPtr pixmap;
|
||||||
|
|
||||||
pixmap = xwl_shm_create_pixmap(screen, cursor->bits->width,
|
pixmap = xwl_shm_create_pixmap(screen, cursor->bits->width,
|
||||||
cursor->bits->height, 32, 0);
|
cursor->bits->height, 32,
|
||||||
|
CREATE_PIXMAP_USAGE_BACKING_PIXMAP);
|
||||||
dixSetPrivate(&cursor->devPrivates, &xwl_cursor_private_key, pixmap);
|
dixSetPrivate(&cursor->devPrivates, &xwl_cursor_private_key, pixmap);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -212,9 +212,9 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen,
|
||||||
PixmapPtr pixmap = NULL;
|
PixmapPtr pixmap = NULL;
|
||||||
|
|
||||||
if (width > 0 && height > 0 && depth >= 15 &&
|
if (width > 0 && height > 0 && depth >= 15 &&
|
||||||
(hint == 0 ||
|
(hint == CREATE_PIXMAP_USAGE_BACKING_PIXMAP ||
|
||||||
hint == CREATE_PIXMAP_USAGE_BACKING_PIXMAP ||
|
hint == CREATE_PIXMAP_USAGE_SHARED ||
|
||||||
hint == CREATE_PIXMAP_USAGE_SHARED)) {
|
(xwl_screen->rootless && hint == 0))) {
|
||||||
uint32_t format = gbm_format_for_depth(depth);
|
uint32_t format = gbm_format_for_depth(depth);
|
||||||
|
|
||||||
#ifdef GBM_BO_WITH_MODIFIERS
|
#ifdef GBM_BO_WITH_MODIFIERS
|
||||||
|
|
|
@ -202,6 +202,7 @@ xwl_shm_create_pixmap(ScreenPtr screen,
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
if (hint == CREATE_PIXMAP_USAGE_GLYPH_PICTURE ||
|
if (hint == CREATE_PIXMAP_USAGE_GLYPH_PICTURE ||
|
||||||
|
(!xwl_screen->rootless && hint != CREATE_PIXMAP_USAGE_BACKING_PIXMAP) ||
|
||||||
(width == 0 && height == 0) || depth < 15)
|
(width == 0 && height == 0) || depth < 15)
|
||||||
return fbCreatePixmap(screen, width, height, depth, hint);
|
return fbCreatePixmap(screen, width, height, depth, hint);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue