Add CreatePixmap allocation hints.

These hints allow an acceleration architecture to optimize allocation of certain
types of pixmaps, such as pixmaps that will serve as backing pixmaps for
redirected windows.
This commit is contained in:
Aaron Plattner 2007-10-31 14:15:35 -07:00
parent 3f1b6765aa
commit f2e310132f
65 changed files with 150 additions and 97 deletions

View File

@ -1252,7 +1252,7 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId,
__glXenterServer(GL_FALSE); __glXenterServer(GL_FALSE);
pPixmap = (*pGlxScreen->pScreen->CreatePixmap) (pGlxScreen->pScreen, pPixmap = (*pGlxScreen->pScreen->CreatePixmap) (pGlxScreen->pScreen,
width, height, config->rgbBits); width, height, config->rgbBits, 0);
__glXleaveServer(GL_FALSE); __glXleaveServer(GL_FALSE);
return DoCreateGLXDrawable(client, pGlxScreen, config, &pPixmap->drawable, return DoCreateGLXDrawable(client, pGlxScreen, config, &pPixmap->drawable,

View File

@ -403,7 +403,7 @@ CreateImageBuffers (pWin, nbuf, ids, action, hint)
pMultibuffer->pMultibuffers = pMultibuffers; pMultibuffer->pMultibuffers = pMultibuffers;
if (!AddResource (ids[i], MultibufferResType, (pointer) pMultibuffer)) if (!AddResource (ids[i], MultibufferResType, (pointer) pMultibuffer))
break; break;
pMultibuffer->pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, depth); pMultibuffer->pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, depth, 0);
if (!pMultibuffer->pPixmap) if (!pMultibuffer->pPixmap)
break; break;
if (!AddResource (ids[i], MultibufferDrawableResType, (pointer) pMultibuffer->pPixmap)) if (!AddResource (ids[i], MultibufferDrawableResType, (pointer) pMultibuffer->pPixmap))
@ -1576,7 +1576,8 @@ MultibufferPositionWindow (pWin, x, y)
{ {
pMultibuffer = &pMultibuffers->buffers[i]; pMultibuffer = &pMultibuffers->buffers[i];
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
pWin->drawable.depth); pWin->drawable.depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) if (!pPixmap)
{ {
DestroyImageBuffers (pWin); DestroyImageBuffers (pWin);

View File

@ -155,7 +155,7 @@ pixCreateImageBuffers (pWin, nbuf, ids, action, hint)
{ {
pMBBuffer = &pMBWindow->buffers[i]; pMBBuffer = &pMBWindow->buffers[i];
pMBBuffer->pDrawable = (DrawablePtr) pMBBuffer->pDrawable = (DrawablePtr)
(*pScreen->CreatePixmap) (pScreen, width, height, depth); (*pScreen->CreatePixmap) (pScreen, width, height, depth, 0);
if (!pMBBuffer->pDrawable) if (!pMBBuffer->pDrawable)
break; break;
@ -542,7 +542,8 @@ pixPositionWindow (pWin, x, y)
for (i = 0; i < pMBWindow->numMultibuffer; i++) for (i = 0; i < pMBWindow->numMultibuffer; i++)
{ {
pMBBuffer = &pMBWindow->buffers[i]; pMBBuffer = &pMBWindow->buffers[i];
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pWin->drawable.depth); pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pWin->drawable.depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) if (!pPixmap)
{ {
(* MB_SCREEN_PRIV(pScreen)->DestroyImageBuffers)(pWin); (* MB_SCREEN_PRIV(pScreen)->DestroyImageBuffers)(pWin);

View File

@ -543,7 +543,8 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
putGC = GetScratchGC(depth, dst->pScreen); putGC = GetScratchGC(depth, dst->pScreen);
if (!putGC) if (!putGC)
return; return;
pmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth); pmap = (*dst->pScreen->CreatePixmap)(dst->pScreen, sw, sh, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pmap) if (!pmap)
{ {
FreeScratchGC(putGC); FreeScratchGC(putGC);
@ -1070,7 +1071,7 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
{ {
register PixmapPtr pPixmap; register PixmapPtr pPixmap;
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth); pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0);
if (!pPixmap) if (!pPixmap)
return NullPixmap; return NullPixmap;

View File

@ -483,7 +483,8 @@ extern PixmapPtr afbCreatePixmap(
ScreenPtr /*pScreen*/, ScreenPtr /*pScreen*/,
int /*width*/, int /*width*/,
int /*height*/, int /*height*/,
int /*depth*/ int /*depth*/,
unsigned /*usage_hint*/
); );
extern Bool afbDestroyPixmap( extern Bool afbDestroyPixmap(

View File

@ -72,7 +72,8 @@ afbPutImage(pDraw, pGC, depth, x, y, width, height, leftPad, format, pImage)
int depthDst; int depthDst;
/* Create a tmp pixmap */ /* Create a tmp pixmap */
pPixmap = (pScreen->CreatePixmap)(pScreen, width, height, depth); pPixmap = (pScreen->CreatePixmap)(pScreen, width, height, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) if (!pPixmap)
return; return;

View File

@ -70,11 +70,12 @@ SOFTWARE.
#include "mfb.h" #include "mfb.h"
PixmapPtr PixmapPtr
afbCreatePixmap(pScreen, width, height, depth) afbCreatePixmap(pScreen, width, height, depth, usage_hint)
ScreenPtr pScreen; ScreenPtr pScreen;
int width; int width;
int height; int height;
int depth; int depth;
unsigned usage_hint;
{ {
PixmapPtr pPixmap; PixmapPtr pPixmap;
size_t datasize; size_t datasize;
@ -127,8 +128,10 @@ afbCopyPixmap(PixmapPtr pSrc)
size = pSrc->drawable.height * pSrc->devKind * pSrc->drawable.depth; size = pSrc->drawable.height * pSrc->devKind * pSrc->drawable.depth;
pScreen = pSrc->drawable.pScreen; pScreen = pSrc->drawable.pScreen;
pDst = (*pScreen->CreatePixmap)(pScreen, pSrc->drawable.width, pDst = (*pScreen->CreatePixmap)(pScreen,
pSrc->drawable.height, pSrc->drawable.depth); pSrc->drawable.width,
pSrc->drawable.height,
pSrc->drawable.depth, 0);
if (!pDst) if (!pDst)
return(NullPixmap); return(NullPixmap);
memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size); memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size);

View File

@ -739,7 +739,8 @@ extern PixmapPtr cfbCreatePixmap(
ScreenPtr /*pScreen*/, ScreenPtr /*pScreen*/,
int /*width*/, int /*width*/,
int /*height*/, int /*height*/,
int /*depth*/ int /*depth*/,
unsigned /*usage_hint*/
); );
extern Bool cfbDestroyPixmap( extern Bool cfbDestroyPixmap(

View File

@ -1407,7 +1407,8 @@ RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable,
ScreenPtr pScreen = pSrcDrawable->pScreen; ScreenPtr pScreen = pSrcDrawable->pScreen;
GCPtr pGC1; GCPtr pGC1;
pBitmap = (*pScreen->CreatePixmap) (pScreen, width, height, 1); pBitmap = (*pScreen->CreatePixmap) (pScreen, width, height, 1,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pBitmap) if (!pBitmap)
return NULL; return NULL;
pGC1 = GetScratchGC (1, pScreen); pGC1 = GetScratchGC (1, pScreen);

View File

@ -65,11 +65,12 @@ SOFTWARE.
#include "cfbmskbits.h" #include "cfbmskbits.h"
PixmapPtr PixmapPtr
cfbCreatePixmap (pScreen, width, height, depth) cfbCreatePixmap (pScreen, width, height, depth, usage_hint)
ScreenPtr pScreen; ScreenPtr pScreen;
int width; int width;
int height; int height;
int depth; int depth;
unsigned usage_hint;
{ {
PixmapPtr pPixmap; PixmapPtr pPixmap;
size_t datasize; size_t datasize;
@ -122,7 +123,7 @@ cfbCopyPixmap(pSrc)
size = pSrc->drawable.height * pSrc->devKind; size = pSrc->drawable.height * pSrc->devKind;
pScreen = pSrc->drawable.pScreen; pScreen = pSrc->drawable.pScreen;
pDst = (*pScreen->CreatePixmap) (pScreen, pSrc->drawable.width, pDst = (*pScreen->CreatePixmap) (pScreen, pSrc->drawable.width,
pSrc->drawable.height, pSrc->drawable.depth); pSrc->drawable.height, pSrc->drawable.depth, 0);
if (!pDst) if (!pDst)
return NullPixmap; return NullPixmap;
memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size); memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size);

View File

@ -462,7 +462,8 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
WindowPtr pParent = pWin->parent; WindowPtr pParent = pWin->parent;
PixmapPtr pPixmap; PixmapPtr pPixmap;
pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth); pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth,
CREATE_PIXMAP_USAGE_BACKING_PIXMAP);
if (!pPixmap) if (!pPixmap)
return 0; return 0;

View File

@ -177,7 +177,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
if (!(pDbeWindowPrivPriv->pFrontBuffer = if (!(pDbeWindowPrivPriv->pFrontBuffer =
(*pScreen->CreatePixmap)(pScreen, pDbeWindowPriv->width, (*pScreen->CreatePixmap)(pScreen, pDbeWindowPriv->width,
pDbeWindowPriv->height, pDbeWindowPriv->height,
pWin->drawable.depth))) pWin->drawable.depth, 0)))
{ {
return(BadAlloc); return(BadAlloc);
} }
@ -186,7 +186,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
if (!(pDbeWindowPrivPriv->pBackBuffer = if (!(pDbeWindowPrivPriv->pBackBuffer =
(*pScreen->CreatePixmap)(pScreen, pDbeWindowPriv->width, (*pScreen->CreatePixmap)(pScreen, pDbeWindowPriv->width,
pDbeWindowPriv->height, pDbeWindowPriv->height,
pWin->drawable.depth))) pWin->drawable.depth, 0)))
{ {
(*pScreen->DestroyPixmap)(pDbeWindowPrivPriv->pFrontBuffer); (*pScreen->DestroyPixmap)(pDbeWindowPrivPriv->pFrontBuffer);
return(BadAlloc); return(BadAlloc);
@ -648,10 +648,10 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
/* Create DBE buffer pixmaps equal to size of resized window. */ /* Create DBE buffer pixmaps equal to size of resized window. */
pFrontBuffer = (*pScreen->CreatePixmap)(pScreen, width, height, pFrontBuffer = (*pScreen->CreatePixmap)(pScreen, width, height,
pWin->drawable.depth); pWin->drawable.depth, 0);
pBackBuffer = (*pScreen->CreatePixmap)(pScreen, width, height, pBackBuffer = (*pScreen->CreatePixmap)(pScreen, width, height,
pWin->drawable.depth); pWin->drawable.depth, 0);
if (!pFrontBuffer || !pBackBuffer) if (!pFrontBuffer || !pBackBuffer)
{ {

View File

@ -1554,7 +1554,7 @@ ProcCreatePixmap(ClientPtr client)
CreatePmap: CreatePmap:
pMap = (PixmapPtr)(*pDraw->pScreen->CreatePixmap) pMap = (PixmapPtr)(*pDraw->pScreen->CreatePixmap)
(pDraw->pScreen, stuff->width, (pDraw->pScreen, stuff->width,
stuff->height, stuff->depth); stuff->height, stuff->depth, 0);
if (pMap) if (pMap)
{ {
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;

View File

@ -694,7 +694,7 @@ CreateDefaultTile (GCPtr pGC)
(*pGC->pScreen->QueryBestSize)(TileShape, &w, &h, pGC->pScreen); (*pGC->pScreen->QueryBestSize)(TileShape, &w, &h, pGC->pScreen);
pTile = (PixmapPtr) pTile = (PixmapPtr)
(*pGC->pScreen->CreatePixmap)(pGC->pScreen, (*pGC->pScreen->CreatePixmap)(pGC->pScreen,
w, h, pGC->depth); w, h, pGC->depth, 0);
pgcScratch = GetScratchGC(pGC->depth, pGC->pScreen); pgcScratch = GetScratchGC(pGC->depth, pGC->pScreen);
if (!pTile || !pgcScratch) if (!pTile || !pgcScratch)
{ {
@ -1036,7 +1036,7 @@ CreateDefaultStipple(int screenNum)
h = 16; h = 16;
(* pScreen->QueryBestSize)(StippleShape, &w, &h, pScreen); (* pScreen->QueryBestSize)(StippleShape, &w, &h, pScreen);
if (!(pScreen->PixmapPerDepth[0] = if (!(pScreen->PixmapPerDepth[0] =
(*pScreen->CreatePixmap)(pScreen, w, h, 1))) (*pScreen->CreatePixmap)(pScreen, w, h, 1, 0)))
return FALSE; return FALSE;
/* fill stipple with 1 */ /* fill stipple with 1 */
tmpval[0] = GXcopy; tmpval[1] = 1; tmpval[2] = FillSolid; tmpval[0] = GXcopy; tmpval[1] = 1; tmpval[2] = FillSolid;

View File

@ -98,7 +98,8 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm, unsigned cha
bzero(pbits, nby); bzero(pbits, nby);
ppix = (PixmapPtr)(*pScreen->CreatePixmap)(pScreen, cm->width, ppix = (PixmapPtr)(*pScreen->CreatePixmap)(pScreen, cm->width,
cm->height, 1); cm->height, 1,
CREATE_PIXMAP_USAGE_SCRATCH);
pGC = GetScratchGC(1, pScreen); pGC = GetScratchGC(1, pScreen);
if (!ppix || !pGC) if (!ppix || !pGC)
{ {

View File

@ -59,7 +59,7 @@ GetScratchPixmapHeader(ScreenPtr pScreen, int width, int height, int depth,
pScreen->pScratchPixmap = NULL; pScreen->pScratchPixmap = NULL;
else else
/* width and height of 0 means don't allocate any pixmap data */ /* width and height of 0 means don't allocate any pixmap data */
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth); pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0);
if (pPixmap) { if (pPixmap) {
if ((*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, if ((*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth,

View File

@ -312,7 +312,7 @@ MakeRootTile(WindowPtr pWin)
int i, j; int i, j;
pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4, pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4,
pScreen->rootDepth); pScreen->rootDepth, 0);
pWin->backgroundState = BackgroundPixmap; pWin->backgroundState = BackgroundPixmap;
pGC = GetScratchGC(pScreen->rootDepth, pScreen); pGC = GetScratchGC(pScreen->rootDepth, pScreen);

View File

@ -234,7 +234,8 @@ exaLog2(int val)
* for scratch pixmaps, or to represent the visible screen. * for scratch pixmaps, or to represent the visible screen.
*/ */
static PixmapPtr static PixmapPtr
exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth) exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
unsigned usage_hint)
{ {
PixmapPtr pPixmap; PixmapPtr pPixmap;
ExaPixmapPrivPtr pExaPixmap; ExaPixmapPrivPtr pExaPixmap;
@ -246,10 +247,10 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
return NullPixmap; return NullPixmap;
if (!pExaScr->info->CreatePixmap) { if (!pExaScr->info->CreatePixmap) {
pPixmap = fbCreatePixmap (pScreen, w, h, depth); pPixmap = fbCreatePixmap (pScreen, w, h, depth, usage_hint);
} else { } else {
driver_alloc = 1; driver_alloc = 1;
pPixmap = fbCreatePixmap(pScreen, 0, 0, depth); pPixmap = fbCreatePixmap(pScreen, 0, 0, depth, usage_hint);
} }
if (!pPixmap) if (!pPixmap)

View File

@ -774,7 +774,7 @@ exaCreateAlphaPicture (ScreenPtr pScreen,
} }
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
pPictFormat->depth); pPictFormat->depth, 0);
if (!pPixmap) if (!pPixmap)
return 0; return 0;
pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); pGC = GetScratchGC (pPixmap->drawable.depth, pScreen);

View File

@ -1624,7 +1624,8 @@ PixmapPtr
fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp); fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp);
PixmapPtr PixmapPtr
fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth); fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
unsigned usage_hint);
Bool Bool
fbDestroyPixmap (PixmapPtr pPixmap); fbDestroyPixmap (PixmapPtr pPixmap);

View File

@ -137,7 +137,7 @@ fbOverlayCreateScreenResources(ScreenPtr pScreen)
pbits = pScrPriv->layer[i].u.init.pbits; pbits = pScrPriv->layer[i].u.init.pbits;
width = pScrPriv->layer[i].u.init.width; width = pScrPriv->layer[i].u.init.width;
depth = pScrPriv->layer[i].u.init.depth; depth = pScrPriv->layer[i].u.init.depth;
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth); pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0);
if (!pPixmap) if (!pPixmap)
return FALSE; return FALSE;
if (!(*pScreen->ModifyPixmapHeader)(pPixmap, pScreen->width, if (!(*pScreen->ModifyPixmapHeader)(pPixmap, pScreen->width,

View File

@ -80,7 +80,8 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp)
} }
PixmapPtr PixmapPtr
fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth) fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
unsigned usage_hint)
{ {
int bpp; int bpp;
bpp = BitsPerPixel (depth); bpp = BitsPerPixel (depth);

View File

@ -275,7 +275,7 @@ xxCreateScreenResources(ScreenPtr pScreen)
* (BitsPerPixel(depth) >> 3)); * (BitsPerPixel(depth) >> 3));
if (!pBits) return FALSE; if (!pBits) return FALSE;
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth); pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0);
if (!pPixmap) { if (!pPixmap) {
xfree(pBits); xfree(pBits);
return FALSE; return FALSE;

View File

@ -81,7 +81,8 @@ void dmxBECreatePixmap(PixmapPtr pPixmap)
/** Create a pixmap for \a pScreen with the specified \a width, \a /** Create a pixmap for \a pScreen with the specified \a width, \a
* height, and \a depth. */ * height, and \a depth. */
PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth) PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
unsigned usage_hint)
{ {
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
PixmapPtr pPixmap; PixmapPtr pPixmap;

View File

@ -49,7 +49,8 @@ typedef struct _dmxPixPriv {
extern Bool dmxInitPixmap(ScreenPtr pScreen); extern Bool dmxInitPixmap(ScreenPtr pScreen);
extern PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, extern PixmapPtr dmxCreatePixmap(ScreenPtr pScreen,
int width, int height, int depth); int width, int height, int depth,
unsigned usage_hint);
extern Bool dmxDestroyPixmap(PixmapPtr pPixmap); extern Bool dmxDestroyPixmap(PixmapPtr pPixmap);
extern RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap); extern RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap);

View File

@ -294,7 +294,7 @@ kaaDestroyPixmap (PixmapPtr pPixmap)
} }
static PixmapPtr static PixmapPtr
kaaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth) kaaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
{ {
PixmapPtr pPixmap; PixmapPtr pPixmap;
KaaPixmapPrivPtr pKaaPixmap; KaaPixmapPrivPtr pKaaPixmap;

View File

@ -432,7 +432,7 @@ xf86SetDGAMode(
} }
if(pMode->flags & DGA_PIXMAP_AVAILABLE) { if(pMode->flags & DGA_PIXMAP_AVAILABLE) {
if((pPix = (*pScreen->CreatePixmap)(pScreen, 0, 0, pMode->depth))) { if((pPix = (*pScreen->CreatePixmap)(pScreen, 0, 0, pMode->depth, 0))) {
(*pScreen->ModifyPixmapHeader)(pPix, (*pScreen->ModifyPixmapHeader)(pPix,
pMode->pixmapWidth, pMode->pixmapHeight, pMode->pixmapWidth, pMode->pixmapHeight,
pMode->depth, pMode->bitsPerPixel, pMode->depth, pMode->bitsPerPixel,

View File

@ -141,7 +141,8 @@ static void RACCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
RegionPtr prgnSrc ); RegionPtr prgnSrc );
static void RACClearToBackground (WindowPtr pWin, int x, int y, static void RACClearToBackground (WindowPtr pWin, int x, int y,
int w, int h, Bool generateExposures ); int w, int h, Bool generateExposures );
static PixmapPtr RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth); static PixmapPtr RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
unsigned usage_hint);
static Bool RACCreateGC(GCPtr pGC); static Bool RACCreateGC(GCPtr pGC);
static Bool RACSaveScreen(ScreenPtr pScreen, Bool unblank); static Bool RACSaveScreen(ScreenPtr pScreen, Bool unblank);
static void RACStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs); static void RACStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs);
@ -450,14 +451,14 @@ RACClearToBackground (
} }
static PixmapPtr static PixmapPtr
RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth) RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
{ {
PixmapPtr pPix; PixmapPtr pPix;
DPRINT_S("RACCreatePixmap",pScreen->myNum); DPRINT_S("RACCreatePixmap",pScreen->myNum);
SCREEN_PROLOG ( CreatePixmap); SCREEN_PROLOG ( CreatePixmap);
ENABLE; ENABLE;
pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth); pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
SCREEN_EPILOG (CreatePixmap, RACCreatePixmap); SCREEN_EPILOG (CreatePixmap, RACCreatePixmap);
return pPix; return pPix;

View File

@ -30,7 +30,8 @@ static void XAAGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
char *pdstLine); char *pdstLine);
static void XAAGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, static void XAAGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
int *pwidth, int nspans, char *pdstStart); int *pwidth, int nspans, char *pdstStart);
static PixmapPtr XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth); static PixmapPtr XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
unsigned usage_hint);
static Bool XAADestroyPixmap(PixmapPtr pPixmap); static Bool XAADestroyPixmap(PixmapPtr pPixmap);
static Bool XAAEnterVT (int index, int flags); static Bool XAAEnterVT (int index, int flags);
static void XAALeaveVT (int index, int flags); static void XAALeaveVT (int index, int flags);
@ -306,7 +307,8 @@ XAAPixmapBPP (ScreenPtr pScreen, int depth)
DestroyPixmapProcPtr destroyPixmap; DestroyPixmapProcPtr destroyPixmap;
XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap); XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
pPix = (*pScreen->CreatePixmap) (pScreen, 1, 1, depth); pPix = (*pScreen->CreatePixmap) (pScreen, 1, 1, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap); XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap);
if (!pPix) if (!pPix)
return 0; return 0;
@ -337,7 +339,7 @@ XAAInitializeOffscreenDepths (ScreenPtr pScreen)
} }
static PixmapPtr static PixmapPtr
XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth) XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
{ {
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
@ -383,7 +385,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
} }
XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap); XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth); pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, usage_hint);
XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap); XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap);
if (!pPix) { if (!pPix) {
@ -415,7 +417,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
} }
BAILOUT: BAILOUT:
XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap); XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth); pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap); XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap);
if(pPix) { if(pPix) {

View File

@ -146,7 +146,7 @@ v16CreateScreenResources
/* create a pixmap with no data, then redirect it to point to /* create a pixmap with no data, then redirect it to point to
* the screen * the screen
*/ */
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth); pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0);
if (!pPixmap) if (!pPixmap)
return FALSE; return FALSE;

View File

@ -79,7 +79,8 @@ xf4bppGetImage( pDraw, sx, sy, w, h, format, planeMask, pdstLine )
!= (unsigned)( 1 << pDraw->depth ) - 1 ) { != (unsigned)( 1 << pDraw->depth ) - 1 ) {
pGC = GetScratchGC( depth, pDraw->pScreen ) ; pGC = GetScratchGC( depth, pDraw->pScreen ) ;
pPixmap = (PixmapPtr) pPixmap = (PixmapPtr)
(* pDraw->pScreen->CreatePixmap)( pDraw->pScreen, w, h, depth ) ; (* pDraw->pScreen->CreatePixmap)( pDraw->pScreen, w, h, depth,
CREATE_PIXMAP_USAGE_SCRATCH) ;
gcv[0] = GXcopy ; gcv[0] = GXcopy ;
gcv[1] = planeMask ; gcv[1] = planeMask ;
DoChangeGC( pGC, GCPlaneMask | GCFunction, gcv, 0 ) ; DoChangeGC( pGC, GCPlaneMask | GCFunction, gcv, 0 ) ;

View File

@ -82,16 +82,17 @@ SOFTWARE.
#include "scrnintstr.h" #include "scrnintstr.h"
PixmapPtr PixmapPtr
xf4bppCreatePixmap( pScreen, width, height, depth ) xf4bppCreatePixmap( pScreen, width, height, depth, usage_hint )
ScreenPtr pScreen ; ScreenPtr pScreen ;
int width ; int width ;
int height ; int height ;
int depth ; int depth ;
unsigned usage_hint ;
{ {
register PixmapPtr pPixmap = (PixmapPtr)NULL; register PixmapPtr pPixmap = (PixmapPtr)NULL;
size_t size ; size_t size ;
TRACE(("xf4bppCreatePixmap(pScreen=0x%x, width=%d, height=%d, depth=%d)\n", pScreen, width, height, depth)) ; TRACE(("xf4bppCreatePixmap(pScreen=0x%x, width=%d, height=%d, depth=%d, usage_hint=%d)\n", pScreen, width, height, depth, usage_hint)) ;
if ( depth > 8 ) if ( depth > 8 )
return (PixmapPtr) NULL ; return (PixmapPtr) NULL ;

View File

@ -183,7 +183,8 @@ PixmapPtr xf4bppCreatePixmap(
ScreenPtr, ScreenPtr,
int, int,
int, int,
int int,
unsigned
); );
PixmapPtr xf4bppCopyPixmap( PixmapPtr xf4bppCopyPixmap(
PixmapPtr PixmapPtr

View File

@ -32,7 +32,7 @@
static Bool OverlayCloseScreen (int, ScreenPtr); static Bool OverlayCloseScreen (int, ScreenPtr);
static Bool OverlayCreateGC(GCPtr pGC); static Bool OverlayCreateGC(GCPtr pGC);
static Bool OverlayDestroyPixmap(PixmapPtr); static Bool OverlayDestroyPixmap(PixmapPtr);
static PixmapPtr OverlayCreatePixmap(ScreenPtr, int, int, int); static PixmapPtr OverlayCreatePixmap(ScreenPtr, int, int, int, unsigned);
static Bool OverlayChangeWindowAttributes(WindowPtr, unsigned long); static Bool OverlayChangeWindowAttributes(WindowPtr, unsigned long);
/** Funcs **/ /** Funcs **/
@ -339,13 +339,14 @@ OverlayCreateGC(GCPtr pGC)
} }
static PixmapPtr static PixmapPtr
OverlayCreatePixmap(ScreenPtr pScreen, int w, int h, int depth) OverlayCreatePixmap(ScreenPtr pScreen, int w, int h, int depth,
unsigned usage_hint)
{ {
OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen); OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
PixmapPtr pPix; PixmapPtr pPix;
pScreen->CreatePixmap = pScreenPriv->CreatePixmap; pScreen->CreatePixmap = pScreenPriv->CreatePixmap;
pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth); pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
pScreen->CreatePixmap = OverlayCreatePixmap; pScreen->CreatePixmap = OverlayCreatePixmap;
/* We initialize all the privates */ /* We initialize all the privates */
@ -439,7 +440,7 @@ OverlayRefreshPixmap(PixmapPtr pix8)
PixmapPtr newPix; PixmapPtr newPix;
newPix = (*pScreen->CreatePixmap)(pScreen, pix8->drawable.width, newPix = (*pScreen->CreatePixmap)(pScreen, pix8->drawable.width,
pix8->drawable.height, 24); pix8->drawable.height, 24, 0);
newPix->drawable.depth = 8; /* Bad Mark! Bad Mark! */ newPix->drawable.depth = 8; /* Bad Mark! Bad Mark! */
pixPriv->pix32 = newPix; pixPriv->pix32 = newPix;
} }

View File

@ -870,7 +870,8 @@ PixmapPtr
xglCreatePixmap (ScreenPtr pScreen, xglCreatePixmap (ScreenPtr pScreen,
int width, int width,
int height, int height,
int depth); int depth,
unsigned usage_hint);
void void
xglFiniPixmap (PixmapPtr pPixmap); xglFiniPixmap (PixmapPtr pPixmap);

View File

@ -1075,7 +1075,8 @@ xglGlyphs (CARD8 op,
pPixmap = (*pScreen->CreatePixmap) (pScreen, pPixmap = (*pScreen->CreatePixmap) (pScreen,
rect.width, rect.height, rect.width, rect.height,
maskFormat->depth); maskFormat->depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) if (!pPixmap)
return; return;

View File

@ -494,7 +494,7 @@ xglSyncPicture (ScreenPtr pScreen,
return FALSE; return FALSE;
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
pFormat->depth); pFormat->depth, 0);
if (!pPixmap) if (!pPixmap)
return FALSE; return FALSE;

View File

@ -222,7 +222,8 @@ PixmapPtr
xglCreatePixmap (ScreenPtr pScreen, xglCreatePixmap (ScreenPtr pScreen,
int width, int width,
int height, int height,
int depth) int depth,
unsigned usage_hint)
{ {
xglPixmapPtr pPixmapPriv; xglPixmapPtr pPixmapPriv;
PixmapPtr pPixmap; PixmapPtr pPixmap;

View File

@ -447,7 +447,7 @@ xglCreateSolidAlphaPicture (ScreenPtr pScreen)
if (!pGC) if (!pGC)
return; return;
pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, pFormat->depth); pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, pFormat->depth, 0);
if (!pPixmap) if (!pPixmap)
return; return;

View File

@ -64,7 +64,8 @@ xglShmPutImage (DrawablePtr pDrawable,
} }
else else
{ {
pPixmap = (*pScreen->CreatePixmap) (pScreen, sw, sh, depth); pPixmap = (*pScreen->CreatePixmap) (pScreen, sw, sh, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (pPixmap) if (pPixmap)
{ {
GCPtr pScratchGC; GCPtr pScratchGC;

View File

@ -194,7 +194,8 @@ xglTrapezoids (CARD8 op,
pPixmap = (*pScreen->CreatePixmap) (pScreen, pPixmap = (*pScreen->CreatePixmap) (pScreen,
rect.width, rect.height, rect.width, rect.height,
maskFormat->depth); maskFormat->depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) if (!pPixmap)
return; return;

View File

@ -290,7 +290,7 @@ xglXvPutImage (ClientPtr client,
if (!pPortPriv->pPixmap) if (!pPortPriv->pPixmap)
{ {
pPortPriv->pPixmap = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth); pPortPriv->pPixmap = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, 0);
if (!pPortPriv->pPixmap) if (!pPortPriv->pPixmap)
return BadAlloc; return BadAlloc;
} }

View File

@ -35,7 +35,8 @@ is" without express or implied warranty.
int xnestPixmapPrivateIndex; int xnestPixmapPrivateIndex;
PixmapPtr PixmapPtr
xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth) xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
unsigned usage_hint)
{ {
PixmapPtr pPixmap; PixmapPtr pPixmap;

View File

@ -29,7 +29,7 @@ typedef struct {
#define xnestSharePixmap(pPixmap) ((pPixmap)->refcnt++) #define xnestSharePixmap(pPixmap) ((pPixmap)->refcnt++)
PixmapPtr xnestCreatePixmap(ScreenPtr pScreen, int width, int height, PixmapPtr xnestCreatePixmap(ScreenPtr pScreen, int width, int height,
int depth); int depth, unsigned usage_hint);
Bool xnestDestroyPixmap(PixmapPtr pPixmap); Bool xnestDestroyPixmap(PixmapPtr pPixmap);
RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap); RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap);

View File

@ -415,7 +415,8 @@ PclCopyPlane(DrawablePtr pSrc,
* know how to do a CopyArea. * know how to do a CopyArea.
*/ */
scratchPix = (*pDst->pScreen->CreatePixmap)( pDst->pScreen, width, scratchPix = (*pDst->pScreen->CreatePixmap)( pDst->pScreen, width,
height, pDst->depth ); height, pDst->depth,
CREATE_PIXMAP_USAGE_SCRATCH );
scratchGC = GetScratchGC( pDst->depth, pDst->pScreen ); scratchGC = GetScratchGC( pDst->depth, pDst->pScreen );
CopyGC( pGC, scratchGC, ~0L ); CopyGC( pGC, scratchGC, ~0L );

View File

@ -709,7 +709,8 @@ PclUpdateDrawableGC(
scratchPix = scratchPix =
(*pGC->pScreen->CreatePixmap)( pGC->pScreen, (*pGC->pScreen->CreatePixmap)( pGC->pScreen,
w, h, pGC->depth ); w, h, pGC->depth,
CREATE_PIXMAP_USAGE_SCRATCH );
scratchGC = GetScratchGC( pGC->depth, pGC->pScreen ); scratchGC = GetScratchGC( pGC->depth, pGC->pScreen );
CopyGC( pGC, scratchGC, ~0L ); CopyGC( pGC, scratchGC, ~0L );

View File

@ -574,7 +574,7 @@ extern void PsSetFillColor(DrawablePtr pDrawable, GCPtr pGC, PsOutPtr psOut,
*/ */
extern PixmapPtr PsCreatePixmap(ScreenPtr pScreen, int width, int height, extern PixmapPtr PsCreatePixmap(ScreenPtr pScreen, int width, int height,
int depth); int depth, unsigned usage_hint);
extern void PsScrubPixmap(PixmapPtr pPixmap); extern void PsScrubPixmap(PixmapPtr pPixmap);
extern Bool PsDestroyPixmap(PixmapPtr pPixmap); extern Bool PsDestroyPixmap(PixmapPtr pPixmap);
extern DisplayListPtr PsGetFreeDisplayBlock(PsPixmapPrivPtr priv); extern DisplayListPtr PsGetFreeDisplayBlock(PsPixmapPrivPtr priv);

View File

@ -91,7 +91,8 @@ PsCreatePixmap(
ScreenPtr pScreen, ScreenPtr pScreen,
int width, int width,
int height, int height,
int depth) int depth,
unsigned usage_hint)
{ {
PixmapPtr pPixmap; PixmapPtr pPixmap;

View File

@ -1036,7 +1036,8 @@ winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen);
*/ */
PixmapPtr PixmapPtr
winCreatePixmapNativeGDI (ScreenPtr pScreen, int width, int height, int depth); winCreatePixmapNativeGDI (ScreenPtr pScreen, int width, int height, int depth,
unsigned usage_hint);
Bool Bool
winDestroyPixmapNativeGDI (PixmapPtr pPixmap); winDestroyPixmapNativeGDI (PixmapPtr pPixmap);

View File

@ -64,7 +64,7 @@ winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix,
PixmapPtr PixmapPtr
winCreatePixmapNativeGDI (ScreenPtr pScreen, winCreatePixmapNativeGDI (ScreenPtr pScreen,
int iWidth, int iHeight, int iWidth, int iHeight,
int iDepth) int iDepth, unsigned usage_hint)
{ {
winPrivPixmapPtr pPixmapPriv = NULL; winPrivPixmapPtr pPixmapPriv = NULL;
PixmapPtr pPixmap = NULL; PixmapPtr pPixmap = NULL;
@ -78,8 +78,8 @@ winCreatePixmapNativeGDI (ScreenPtr pScreen,
} }
#if CYGDEBUG #if CYGDEBUG
winDebug ("winCreatePixmap () - w %d h %d d %d bw %d\n", winDebug ("winCreatePixmap () - w %d h %d d %d uh %d bw %d\n",
iWidth, iHeight, iDepth, iWidth, iHeight, iDepth, usage_hint,
PixmapBytePad (iWidth, iDepth)); PixmapBytePad (iWidth, iDepth));
#endif #endif

View File

@ -197,11 +197,19 @@ typedef void (* ClipNotifyProcPtr)(
int /*dx*/, int /*dx*/,
int /*dy*/); int /*dy*/);
/* pixmap will exist only for the duration of the current rendering operation */
#define CREATE_PIXMAP_USAGE_SCRATCH 1
/* pixmap will be the backing pixmap for a redirected window */
#define CREATE_PIXMAP_USAGE_BACKING_PIXMAP 2
/* pixmap will contain a glyph */
#define CREATE_PIMXAP_USAGE_GLYPH_PICTURE 3
typedef PixmapPtr (* CreatePixmapProcPtr)( typedef PixmapPtr (* CreatePixmapProcPtr)(
ScreenPtr /*pScreen*/, ScreenPtr /*pScreen*/,
int /*width*/, int /*width*/,
int /*height*/, int /*height*/,
int /*depth*/); int /*depth*/,
unsigned /*usage_hint*/);
typedef Bool (* DestroyPixmapProcPtr)( typedef Bool (* DestroyPixmapProcPtr)(
PixmapPtr /*pPixmap*/); PixmapPtr /*pPixmap*/);

View File

@ -587,7 +587,8 @@ extern PixmapPtr mfbCreatePixmap(
ScreenPtr /*pScreen*/, ScreenPtr /*pScreen*/,
int /*width*/, int /*width*/,
int /*height*/, int /*height*/,
int /*depth*/ int /*depth*/,
unsigned /*usage_hint*/
); );
extern Bool mfbDestroyPixmap( extern Bool mfbDestroyPixmap(

View File

@ -69,11 +69,12 @@ SOFTWARE.
PixmapPtr PixmapPtr
mfbCreatePixmap (pScreen, width, height, depth) mfbCreatePixmap (pScreen, width, height, depth, usage_hint)
ScreenPtr pScreen; ScreenPtr pScreen;
int width; int width;
int height; int height;
int depth; int depth;
unsigned usage_hint;
{ {
PixmapPtr pPixmap; PixmapPtr pPixmap;
size_t datasize; size_t datasize;
@ -129,7 +130,7 @@ mfbCopyPixmap(pSrc)
size = pSrc->drawable.height * pSrc->devKind; size = pSrc->drawable.height * pSrc->devKind;
pScreen = pSrc->drawable.pScreen; pScreen = pSrc->drawable.pScreen;
pDst = (*pScreen->CreatePixmap) (pScreen, pSrc->drawable.width, pDst = (*pScreen->CreatePixmap) (pScreen, pSrc->drawable.width,
pSrc->drawable.height, pSrc->drawable.depth); pSrc->drawable.height, pSrc->drawable.depth, 0);
if (!pDst) if (!pDst)
return NullPixmap; return NullPixmap;
memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size); memmove((char *)pDst->devPrivate.ptr, (char *)pSrc->devPrivate.ptr, size);

View File

@ -1155,7 +1155,8 @@ miPolyArc(pDraw, pGC, narcs, parcs)
/* allocate a 1 bit deep pixmap of the appropriate size, and /* allocate a 1 bit deep pixmap of the appropriate size, and
* validate it */ * validate it */
pDrawTo = (DrawablePtr)(*pDraw->pScreen->CreatePixmap) pDrawTo = (DrawablePtr)(*pDraw->pScreen->CreatePixmap)
(pDraw->pScreen, pixmapWidth, pixmapHeight, 1); (pDraw->pScreen, pixmapWidth, pixmapHeight, 1,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pDrawTo) if (!pDrawTo)
{ {
FreeScratchGC(pGCTo); FreeScratchGC(pGCTo);

View File

@ -1605,7 +1605,7 @@ miBankCreateScreenResources(
/* Get shadow pixmap; width & height of 0 means no pixmap data */ /* Get shadow pixmap; width & height of 0 means no pixmap data */
pScreenPriv->pBankPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreenPriv->pBankPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0,
pScreenPriv->pScreenPixmap->drawable.depth); pScreenPriv->pScreenPixmap->drawable.depth, 0);
if (!pScreenPriv->pBankPixmap) if (!pScreenPriv->pBankPixmap)
retval = FALSE; retval = FALSE;
} }

View File

@ -416,7 +416,8 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
RegionPtr prgnSrcClip; RegionPtr prgnSrcClip;
pPixmap = (*pDraw->pScreen->CreatePixmap) pPixmap = (*pDraw->pScreen->CreatePixmap)
(pDraw->pScreen, w + srcx, h, 1); (pDraw->pScreen, w + srcx, h, 1,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) if (!pPixmap)
return; return;
@ -667,7 +668,8 @@ miGetImage(pDraw, sx, sy, w, h, format, planeMask, pDst)
if (!pGC) if (!pGC)
return; return;
pPixmap = (*pDraw->pScreen->CreatePixmap) pPixmap = (*pDraw->pScreen->CreatePixmap)
(pDraw->pScreen, w, 1, depth); (pDraw->pScreen, w, 1, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) if (!pPixmap)
{ {
FreeScratchGC(pGC); FreeScratchGC(pGC);

View File

@ -270,7 +270,8 @@ miDCRealize (
pPriv->sourceBits = 0; pPriv->sourceBits = 0;
pPriv->maskBits = 0; pPriv->maskBits = 0;
pPixmap = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pPixmap = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width,
pCursor->bits->height, 32); pCursor->bits->height, 32,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) if (!pPixmap)
{ {
xfree ((pointer) pPriv); xfree ((pointer) pPriv);
@ -302,13 +303,13 @@ miDCRealize (
} }
pPriv->pPicture = 0; pPriv->pPicture = 0;
#endif #endif
pPriv->sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1); pPriv->sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1, 0);
if (!pPriv->sourceBits) if (!pPriv->sourceBits)
{ {
xfree ((pointer) pPriv); xfree ((pointer) pPriv);
return (miDCCursorPtr)NULL; return (miDCCursorPtr)NULL;
} }
pPriv->maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1); pPriv->maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1, 0);
if (!pPriv->maskBits) if (!pPriv->maskBits)
{ {
(*pScreen->DestroyPixmap) (pPriv->sourceBits); (*pScreen->DestroyPixmap) (pPriv->sourceBits);
@ -527,7 +528,7 @@ miDCSaveUnderCursor (pScreen, x, y, w, h)
if (pSave) if (pSave)
(*pScreen->DestroyPixmap) (pSave); (*pScreen->DestroyPixmap) (pSave);
pScreenPriv->pSave = pSave = pScreenPriv->pSave = pSave =
(*pScreen->CreatePixmap) (pScreen, w, h, pScreen->rootDepth); (*pScreen->CreatePixmap) (pScreen, w, h, pScreen->rootDepth, 0);
if (!pSave) if (!pSave)
return FALSE; return FALSE;
} }
@ -737,7 +738,7 @@ miDCMoveCursor (pScreen, pCursor, x, y, w, h, dx, dy, source, mask)
} }
#endif #endif
pScreenPriv->pTemp = pTemp = (*pScreen->CreatePixmap) pScreenPriv->pTemp = pTemp = (*pScreen->CreatePixmap)
(pScreen, w, h, pScreenPriv->pSave->drawable.depth); (pScreen, w, h, pScreenPriv->pSave->drawable.depth, 0);
if (!pTemp) if (!pTemp)
return FALSE; return FALSE;
} }

View File

@ -120,7 +120,8 @@ miPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
FONTMAXBOUNDS(pfont,descent); FONTMAXBOUNDS(pfont,descent);
pPixmap = (*pDrawable->pScreen->CreatePixmap)(pDrawable->pScreen, pPixmap = (*pDrawable->pScreen->CreatePixmap)(pDrawable->pScreen,
width, height, 1); width, height, 1,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) if (!pPixmap)
return; return;

View File

@ -158,7 +158,7 @@ miCreateScreenResources(pScreen)
/* create a pixmap with no data, then redirect it to point to /* create a pixmap with no data, then redirect it to point to
* the screen * the screen
*/ */
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth); pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0);
if (!pPixmap) if (!pPixmap)
return FALSE; return FALSE;

View File

@ -84,7 +84,7 @@ RootlessUpdateScreenPixmap(ScreenPtr pScreen)
pPix = (*pScreen->GetScreenPixmap)(pScreen); pPix = (*pScreen->GetScreenPixmap)(pScreen);
if (pPix == NULL) { if (pPix == NULL) {
pPix = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth); pPix = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0);
(*pScreen->SetScreenPixmap)(pPix); (*pScreen->SetScreenPixmap)(pPix);
} }

View File

@ -240,7 +240,7 @@ shadowInit(ScreenPtr pScreen, ShadowUpdateProc update, ShadowWindowProc window)
PixmapPtr pPixmap; PixmapPtr pPixmap;
pPixmap = pScreen->CreatePixmap(pScreen, pScreen->width, pScreen->height, pPixmap = pScreen->CreatePixmap(pScreen, pScreen->width, pScreen->height,
pScreen->rootDepth); pScreen->rootDepth, 0);
if (!pPixmap) if (!pPixmap)
return FALSE; return FALSE;

View File

@ -969,7 +969,8 @@ miGlyphs (CARD8 op,
width = extents.x2 - extents.x1; width = extents.x2 - extents.x1;
height = extents.y2 - extents.y1; height = extents.y2 - extents.y1;
pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
maskFormat->depth); maskFormat->depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pMaskPixmap) if (!pMaskPixmap)
return; return;
component_alpha = NeedsComponent(maskFormat->format); component_alpha = NeedsComponent(maskFormat->format);

View File

@ -135,8 +135,8 @@ miCompositeRects (CARD8 op,
if (!rgbaFormat) if (!rgbaFormat)
goto bail1; goto bail1;
pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, rgbaFormat->depth,
rgbaFormat->depth); CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) if (!pPixmap)
goto bail2; goto bail2;

View File

@ -61,7 +61,7 @@ miCreateAlphaPicture (ScreenPtr pScreen,
} }
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
pPictFormat->depth); pPictFormat->depth, 0);
if (!pPixmap) if (!pPixmap)
return 0; return 0;
pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); pGC = GetScratchGC (pPixmap->drawable.depth, pScreen);

View File

@ -1202,7 +1202,8 @@ ProcRenderAddGlyphs (ClientPtr client)
} }
pDstPix = (pScreen->CreatePixmap) (pScreen, pDstPix = (pScreen->CreatePixmap) (pScreen,
width, height, depth); width, height, depth,
CREATE_PIMXAP_USAGE_GLYPH_PICTURE);
GlyphPicture (glyph)[screen] = pDst = GlyphPicture (glyph)[screen] = pDst =
CreatePicture (0, &pDstPix->drawable, CreatePicture (0, &pDstPix->drawable,
@ -1636,7 +1637,8 @@ ProcRenderCreateCursor (ClientPtr client)
xfree (mskbits); xfree (mskbits);
return (BadImplementation); return (BadImplementation);
} }
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32); pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) if (!pPixmap)
{ {
xfree (argbbits); xfree (argbbits);