mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
treewide: use inline helper for accessing first screen
Instead of everybody directly accessing the (internal) screenInfo struct, let those consumers only interested in first screen use a little helper. Also caching the value if it's needed several times. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
d0a155c824
commit
6bc438ab5a
@@ -25,6 +25,8 @@
|
||||
#define XK_LATIN1
|
||||
#include <X11/keysymdef.h>
|
||||
|
||||
#include "dix/screenint_priv.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "os.h"
|
||||
@@ -329,7 +331,7 @@ SetPictureFilter(PicturePtr pPicture, char *name, int len, xFixed * params,
|
||||
if (pPicture->pDrawable != NULL)
|
||||
pScreen = pPicture->pDrawable->pScreen;
|
||||
else
|
||||
pScreen = screenInfo.screens[0];
|
||||
pScreen = dixGetFirstScreenPtr();
|
||||
|
||||
pFilter = PictureFindFilter(pScreen, name, len);
|
||||
|
||||
@@ -360,7 +362,7 @@ SetPicturePictFilter(PicturePtr pPicture, PictFilterPtr pFilter,
|
||||
if (pPicture->pDrawable)
|
||||
pScreen = pPicture->pDrawable->pScreen;
|
||||
else
|
||||
pScreen = screenInfo.screens[0];
|
||||
pScreen = dixGetFirstScreenPtr();
|
||||
|
||||
if (pFilter->ValidateParams) {
|
||||
int width, height;
|
||||
|
||||
Reference in New Issue
Block a user