mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-15 13:50:33 +01:00
Bug #7366: Fix crashes when setting filters on source pictures.
Now, filters may only be set on source pictures when the filter is common to all screens. Also, like SetPictureTransform, ChangePictureFilter is now not called on source pictures. (cherry picked fromf5e92542a1commit) (cherry picked from25d871d984commit)
This commit is contained in:
parent
c5bdc9aea0
commit
3413f75e52
2 changed files with 30 additions and 7 deletions
|
|
@ -271,11 +271,24 @@ PictureResetFilters (ScreenPtr pScreen)
|
|||
int
|
||||
SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams)
|
||||
{
|
||||
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
PictFilterPtr pFilter = PictureFindFilter (pScreen, name, len);
|
||||
PictFilterPtr pFilter;
|
||||
xFixed *new_params;
|
||||
int i, result;
|
||||
int i, s, result;
|
||||
|
||||
pFilter = PictureFindFilter (screenInfo.screens[0], name, len);
|
||||
|
||||
if (pPicture->pDrawable == NULL) {
|
||||
/* For source pictures, the picture isn't tied to a screen. So, ensure
|
||||
* that all screens can handle a filter we set for the picture.
|
||||
*/
|
||||
for (s = 0; s < screenInfo.numScreens; s++) {
|
||||
if (PictureFindFilter (screenInfo.screens[s], name, len)->id !=
|
||||
pFilter->id)
|
||||
{
|
||||
return BadMatch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!pFilter)
|
||||
return BadName;
|
||||
|
|
@ -300,8 +313,13 @@ SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int
|
|||
pPicture->filter_params[i] = params[i];
|
||||
pPicture->filter = pFilter->id;
|
||||
|
||||
result = (*ps->ChangePictureFilter) (pPicture, pPicture->filter,
|
||||
params, nparams);
|
||||
return result;
|
||||
if (pPicture->pDrawable) {
|
||||
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
|
||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||
|
||||
result = (*ps->ChangePictureFilter) (pPicture, pPicture->filter,
|
||||
params, nparams);
|
||||
return result;
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -355,7 +355,12 @@ typedef struct _PictureScreen {
|
|||
*/
|
||||
ChangePictureTransformProcPtr ChangePictureTransform;
|
||||
|
||||
/**
|
||||
* Called immediately after a picture's transform is changed through the
|
||||
* SetPictureFilter request. Not called for source-only pictures.
|
||||
*/
|
||||
ChangePictureFilterProcPtr ChangePictureFilter;
|
||||
|
||||
DestroyPictureFilterProcPtr DestroyPictureFilter;
|
||||
|
||||
TrapezoidsProcPtr Trapezoids;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue