From ff27ffa1c11c690b80e6b9febd182e8c49ec20ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Sat, 24 Jun 2023 11:27:21 +0200 Subject: [PATCH] glamor: Eliminate glamor_fini_pixmap Pass the DrawablePtr directly from glamor_finish_access to glamor_upload_boxes. This will allow for better results if the window depth doesn't match the backing pixmap depth. --- glamor/glamor_prepare.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c index 7600e4f6b..f7bb5d254 100644 --- a/glamor/glamor_prepare.c +++ b/glamor/glamor_prepare.c @@ -143,9 +143,10 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box) * if we were writing to it and then unbind it to release the memory */ -static void -glamor_fini_pixmap(PixmapPtr pixmap) +void +glamor_finish_access(DrawablePtr drawable) { + PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv)) @@ -161,7 +162,7 @@ glamor_fini_pixmap(PixmapPtr pixmap) } if (priv->map_access == GLAMOR_ACCESS_RW) { - glamor_upload_boxes(&pixmap->drawable, + glamor_upload_boxes(drawable, RegionRects(&priv->prepare_region), RegionNumRects(&priv->prepare_region), 0, 0, 0, 0, pixmap->devPrivate.ptr, pixmap->devKind); @@ -213,12 +214,6 @@ glamor_prepare_access_box(DrawablePtr drawable, glamor_access_t access, return glamor_prep_pixmap_box(pixmap, access, &box); } -void -glamor_finish_access(DrawablePtr drawable) -{ - glamor_fini_pixmap(glamor_get_drawable_pixmap(drawable)); -} - /* * Make a picture ready to use with fb. */