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.
This commit is contained in:
Michel Dänzer 2023-06-24 11:27:21 +02:00 committed by Michel Dänzer
parent a504f65d89
commit ff27ffa1c1

View File

@ -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 * if we were writing to it and then unbind it to release the memory
*/ */
static void void
glamor_fini_pixmap(PixmapPtr pixmap) glamor_finish_access(DrawablePtr drawable)
{ {
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv)) if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv))
@ -161,7 +162,7 @@ glamor_fini_pixmap(PixmapPtr pixmap)
} }
if (priv->map_access == GLAMOR_ACCESS_RW) { if (priv->map_access == GLAMOR_ACCESS_RW) {
glamor_upload_boxes(&pixmap->drawable, glamor_upload_boxes(drawable,
RegionRects(&priv->prepare_region), RegionRects(&priv->prepare_region),
RegionNumRects(&priv->prepare_region), RegionNumRects(&priv->prepare_region),
0, 0, 0, 0, pixmap->devPrivate.ptr, pixmap->devKind); 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); 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. * Make a picture ready to use with fb.
*/ */