mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 07:00:03 +01:00
Fix alphamap interactions with wfb
Set a destructor function on pixman images and call fbFinishAccess()
from there, rather than directly from free_pixman_pict(). This ensures
that fbFinishAccess() gets called even if pixman still has a reference
to the image after free_pixman_pict(), as is the case for alphamaps.
[ajax: Squash an unused variable warning in the non-wfb build]
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Arcady Goldmints-Orlov <arcadyg@nvidia.com>
Reviewed-by: Søren Sandmann <ssp@redhat.com>
(cherry picked from commit fbac451724)
This commit is contained in:
parent
62e2aa02ef
commit
025ae119a7
1 changed files with 11 additions and 2 deletions
13
fb/fbpict.c
13
fb/fbpict.c
|
|
@ -345,6 +345,11 @@ static pixman_image_t *image_from_pict_internal(PicturePtr pict, Bool has_clip,
|
||||||
int *xoff, int *yoff,
|
int *xoff, int *yoff,
|
||||||
Bool is_alpha_map);
|
Bool is_alpha_map);
|
||||||
|
|
||||||
|
static void image_destroy(pixman_image_t *image, void *data)
|
||||||
|
{
|
||||||
|
fbFinishAccess((DrawablePtr)data);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_image_properties(pixman_image_t * image, PicturePtr pict, Bool has_clip,
|
set_image_properties(pixman_image_t * image, PicturePtr pict, Bool has_clip,
|
||||||
int *xoff, int *yoff, Bool is_alpha_map)
|
int *xoff, int *yoff, Bool is_alpha_map)
|
||||||
|
|
@ -429,6 +434,10 @@ set_image_properties(pixman_image_t * image, PicturePtr pict, Bool has_clip,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pict->pDrawable)
|
||||||
|
pixman_image_set_destroy_function(image, &image_destroy,
|
||||||
|
pict->pDrawable);
|
||||||
|
|
||||||
pixman_image_set_filter(image, filter,
|
pixman_image_set_filter(image, filter,
|
||||||
(pixman_fixed_t *) pict->filter_params,
|
(pixman_fixed_t *) pict->filter_params,
|
||||||
pict->filter_nparams);
|
pict->filter_nparams);
|
||||||
|
|
@ -481,8 +490,8 @@ image_from_pict(PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
|
||||||
void
|
void
|
||||||
free_pixman_pict(PicturePtr pict, pixman_image_t * image)
|
free_pixman_pict(PicturePtr pict, pixman_image_t * image)
|
||||||
{
|
{
|
||||||
if (image && pixman_image_unref(image) && pict->pDrawable)
|
if (image)
|
||||||
fbFinishAccess(pict->pDrawable);
|
pixman_image_unref(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue