MIT-SHM pixmaps, if they exist, are ZPixmap.

This commit is contained in:
Adam Jackson 2008-08-28 13:49:35 -04:00
parent ee7c684f21
commit 040212ee60
3 changed files with 1 additions and 25 deletions

View File

@ -137,8 +137,6 @@ _X_EXPORT int BadShmSegCode;
_X_EXPORT RESTYPE ShmSegType; _X_EXPORT RESTYPE ShmSegType;
static ShmDescPtr Shmsegs; static ShmDescPtr Shmsegs;
static Bool sharedPixmaps; static Bool sharedPixmaps;
static int pixmapFormat;
static int shmPixFormat[MAXSCREENS];
static ShmFuncsPtr shmFuncs[MAXSCREENS]; static ShmFuncsPtr shmFuncs[MAXSCREENS];
static DestroyPixmapProcPtr destroyPixmap[MAXSCREENS]; static DestroyPixmapProcPtr destroyPixmap[MAXSCREENS];
static DevPrivateKey shmPixmapPrivate = &shmPixmapPrivate; static DevPrivateKey shmPixmapPrivate = &shmPixmapPrivate;
@ -231,24 +229,15 @@ ShmExtensionInit(INITARGS)
#endif #endif
sharedPixmaps = xFalse; sharedPixmaps = xFalse;
pixmapFormat = 0;
{ {
sharedPixmaps = xTrue; sharedPixmaps = xTrue;
pixmapFormat = shmPixFormat[0];
for (i = 0; i < screenInfo.numScreens; i++) for (i = 0; i < screenInfo.numScreens; i++)
{ {
if (!shmFuncs[i]) if (!shmFuncs[i])
shmFuncs[i] = &miFuncs; shmFuncs[i] = &miFuncs;
if (!shmFuncs[i]->CreatePixmap) if (!shmFuncs[i]->CreatePixmap)
sharedPixmaps = xFalse; sharedPixmaps = xFalse;
if (shmPixFormat[i] && (shmPixFormat[i] != pixmapFormat))
{
sharedPixmaps = xFalse;
pixmapFormat = 0;
} }
}
if (!pixmapFormat)
pixmapFormat = ZPixmap;
if (sharedPixmaps) if (sharedPixmaps)
for (i = 0; i < screenInfo.numScreens; i++) for (i = 0; i < screenInfo.numScreens; i++)
{ {
@ -278,7 +267,6 @@ ShmResetProc(ExtensionEntry *extEntry)
for (i = 0; i < MAXSCREENS; i++) for (i = 0; i < MAXSCREENS; i++)
{ {
shmFuncs[i] = (ShmFuncsPtr)NULL; shmFuncs[i] = (ShmFuncsPtr)NULL;
shmPixFormat[i] = 0;
} }
} }
@ -288,12 +276,6 @@ ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs)
shmFuncs[pScreen->myNum] = funcs; shmFuncs[pScreen->myNum] = funcs;
} }
_X_EXPORT void
ShmSetPixmapFormat(ScreenPtr pScreen, int format)
{
shmPixFormat[pScreen->myNum] = format;
}
static Bool static Bool
ShmDestroyPixmap (PixmapPtr pPixmap) ShmDestroyPixmap (PixmapPtr pPixmap)
{ {
@ -332,7 +314,7 @@ ProcShmQueryVersion(ClientPtr client)
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.sharedPixmaps = sharedPixmaps; rep.sharedPixmaps = sharedPixmaps;
rep.pixmapFormat = pixmapFormat; rep.pixmapFormat = sharedPixmaps ? ZPixmap : 0;
rep.majorVersion = SHM_MAJOR_VERSION; rep.majorVersion = SHM_MAJOR_VERSION;
rep.minorVersion = SHM_MINOR_VERSION; rep.minorVersion = SHM_MINOR_VERSION;
rep.uid = geteuid(); rep.uid = geteuid();

View File

@ -33,9 +33,6 @@
void void
ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs); ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs);
void
ShmSetPixmapFormat(ScreenPtr pScreen, int format);
void void
ShmRegisterFbFuncs(ScreenPtr pScreen); ShmRegisterFbFuncs(ScreenPtr pScreen);

View File

@ -66,9 +66,6 @@ extern void ResExtensionInit(INITARGS);
#ifdef SHM #ifdef SHM
extern void ShmExtensionInit(INITARGS); extern void ShmExtensionInit(INITARGS);
#include <X11/extensions/shmstr.h> #include <X11/extensions/shmstr.h>
extern void ShmSetPixmapFormat(
ScreenPtr pScreen,
int format);
extern void ShmRegisterFuncs( extern void ShmRegisterFuncs(
ScreenPtr pScreen, ScreenPtr pScreen,
ShmFuncsPtr funcs); ShmFuncsPtr funcs);