Change the devPrivates API to require dixRegisterPrivateKey

This patch only changes the API, not the implementation of the
devPrivates infrastructure. This will permit a new devPrivates
implementation to be layed into the server without requiring
simultaneous changes in every devPrivates user.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
This commit is contained in:
Keith Packard
2010-04-26 17:22:21 -07:00
parent c865a24401
commit faeebead7b
139 changed files with 1108 additions and 714 deletions

View File

@@ -91,6 +91,11 @@ FreeScratchPixmapHeader(PixmapPtr pPixmap)
Bool
CreateScratchPixmapsForScreen(int scrnum)
{
unsigned int pixmap_size;
pixmap_size = sizeof(PixmapRec) + dixPrivatesSize(PRIVATE_PIXMAP);
screenInfo.screens[scrnum]->totalPixmapSize = BitmapBytePad(pixmap_size * 8);
/* let it be created on first use */
screenInfo.screens[scrnum]->pScratchPixmap = NULL;
return TRUE;
@@ -110,6 +115,8 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize)
{
PixmapPtr pPixmap;
assert(pScreen->totalPixmapSize > 0);
if (pScreen->totalPixmapSize > ((size_t)-1) - pixDataSize)
return NullPixmap;
@@ -117,6 +124,14 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize)
if (!pPixmap)
return NullPixmap;
pPixmap->devPrivates = NULL;
dixInitPrivates(pPixmap, pPixmap + 1, PRIVATE_PIXMAP);
return pPixmap;
}
/* callable by ddx */
void
FreePixmap(PixmapPtr pPixmap)
{
dixFiniPrivates(pPixmap, PRIVATE_PIXMAP);
free(pPixmap);
}