Unverified Commit 2d700b14 authored by Mihai Moldovan's avatar Mihai Moldovan

Merge branch 'sunweaver-pr/createpixmap-alloc-hints-abi-change' into 3.6.x

parents cc24d8ba 8b5bb2cd
Index: Mesa/include/GL/xmesa_xf86.h
===================================================================
--- Mesa.orig/include/GL/xmesa_xf86.h
+++ Mesa/include/GL/xmesa_xf86.h
@@ -130,7 +130,7 @@ do { \
/* CreatePixmap returns a PixmapPtr; so, it cannot be inside braces */
#define XMesaCreatePixmap(__d,__b,__w,__h,__depth) \
- (*__d->CreatePixmap)(__d, __w, __h, __depth)
+ (*__d->CreatePixmap)(__d, __w, __h, __depth, 0)
#define XMesaFreePixmap(__d,__b) \
(*__d->DestroyPixmap)(__b)
4001_CreatePixmap-AllocationHints.patch
...@@ -505,7 +505,8 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) ...@@ -505,7 +505,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);
...@@ -1051,7 +1052,7 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr) ...@@ -1051,7 +1052,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;
......
...@@ -539,8 +539,8 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) ...@@ -539,8 +539,8 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
PixmapPtr pPixmap; PixmapPtr pPixmap;
/* usage_hint unsupported by our old server infrastructure. */ /* usage_hint unsupported by our old server infrastructure. */
pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth /*, pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth,
CREATE_PIXMAP_USAGE_BACKING_PIXMAP */); CREATE_PIXMAP_USAGE_BACKING_PIXMAP);
if (!pPixmap) if (!pPixmap)
return 0; return 0;
......
...@@ -188,7 +188,7 @@ miDbeAllocBackBufferName(pWin, bufId, swapAction) ...@@ -188,7 +188,7 @@ miDbeAllocBackBufferName(pWin, bufId, 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);
} }
...@@ -197,7 +197,7 @@ miDbeAllocBackBufferName(pWin, bufId, swapAction) ...@@ -197,7 +197,7 @@ miDbeAllocBackBufferName(pWin, bufId, 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);
...@@ -668,10 +668,10 @@ miDbePositionWindow(pWin, x, y) ...@@ -668,10 +668,10 @@ miDbePositionWindow(pWin, x, 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)
{ {
......
...@@ -1508,7 +1508,7 @@ ProcCreatePixmap(register ClientPtr client) ...@@ -1508,7 +1508,7 @@ ProcCreatePixmap(register 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;
......
...@@ -694,7 +694,7 @@ CreateDefaultTile (GCPtr pGC) ...@@ -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)
{ {
...@@ -1047,7 +1047,7 @@ CreateDefaultStipple(int screenNum) ...@@ -1047,7 +1047,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;
......
...@@ -99,7 +99,8 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns ...@@ -99,7 +99,8 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns
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)
{ {
......
...@@ -59,7 +59,7 @@ GetScratchPixmapHeader(ScreenPtr pScreen, int width, int height, int depth, ...@@ -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,
......
...@@ -295,7 +295,7 @@ MakeRootTile(WindowPtr pWin) ...@@ -295,7 +295,7 @@ MakeRootTile(WindowPtr pWin)
register int i, j; register 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);
......
...@@ -1596,10 +1596,11 @@ fbPictureInit (ScreenPtr pScreen, ...@@ -1596,10 +1596,11 @@ fbPictureInit (ScreenPtr pScreen,
*/ */
PixmapPtr PixmapPtr
fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp); fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
unsigned usage_hint);
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);
......
...@@ -537,7 +537,7 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel) ...@@ -537,7 +537,7 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel)
pOldTile->drawable.width, pOldTile->drawable.width,
pOldTile->drawable.height, pOldTile->drawable.height,
pOldTile->drawable.depth, pOldTile->drawable.depth,
bitsPerPixel); bitsPerPixel, 0);
if (!pNewTile) if (!pNewTile)
return 0; return 0;
fbGetDrawable (&pOldTile->drawable, fbGetDrawable (&pOldTile->drawable,
......
...@@ -140,7 +140,7 @@ fbOverlayCreateScreenResources(ScreenPtr pScreen) ...@@ -140,7 +140,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,
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
#include "fb.h" #include "fb.h"
PixmapPtr PixmapPtr
fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp) fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
unsigned usage_hint)
{ {
PixmapPtr pPixmap; PixmapPtr pPixmap;
size_t datasize; size_t datasize;
...@@ -81,12 +82,14 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp) ...@@ -81,12 +82,14 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp)
pPixmap->screen_x = 0; pPixmap->screen_x = 0;
pPixmap->screen_y = 0; pPixmap->screen_y = 0;
#endif #endif
pPixmap->usage_hint = usage_hint;
return pPixmap; return pPixmap;
} }
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);
...@@ -94,7 +97,7 @@ fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth) ...@@ -94,7 +97,7 @@ fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth)
if (bpp == 32 && depth <= 24) if (bpp == 32 && depth <= 24)
bpp = fbGetScreenPrivate(pScreen)->pix32bpp; bpp = fbGetScreenPrivate(pScreen)->pix32bpp;
#endif #endif
return fbCreatePixmapBpp (pScreen, width, height, depth, bpp); return fbCreatePixmapBpp (pScreen, width, height, depth, bpp, usage_hint);
} }
Bool Bool
......
...@@ -2702,7 +2702,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) ...@@ -2702,7 +2702,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable)
* would fail. * would fail.
*/ */
pBitmap = nxagentCreatePixmap(pDrawable -> pScreen, pDrawable -> width, pDrawable -> height, pDrawable -> depth); pBitmap = nxagentCreatePixmap(pDrawable -> pScreen, pDrawable -> width, pDrawable -> height, pDrawable -> depth, 0);
if (pBitmap == NULL) if (pBitmap == NULL)
{ {
......
...@@ -245,7 +245,9 @@ miGlyphs (CARD8 op, ...@@ -245,7 +245,9 @@ miGlyphs (CARD8 op,
return; return;
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, maskFormat->depth); pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
maskFormat->depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pMaskPixmap) if (!pMaskPixmap)
return; return;
......
...@@ -114,7 +114,8 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns ...@@ -114,7 +114,8 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns
/* zeroing the (pad) bits seems to help some ddx cursor handling */ /* zeroing the (pad) bits seems to help some ddx cursor handling */
bzero(pbits, nby); bzero(pbits, nby);
ppix = fbCreatePixmap(pScreen, cm->width, cm->height, 1); ppix = fbCreatePixmap(pScreen, cm->width, cm->height, 1,
CREATE_PIXMAP_USAGE_SCRATCH);
pGC = GetScratchGC(1, pScreen); pGC = GetScratchGC(1, pScreen);
if (!ppix || !pGC) if (!ppix || !pGC)
{ {
......
...@@ -1266,7 +1266,8 @@ ProcRenderCreateCursor (ClientPtr client) ...@@ -1266,7 +1266,8 @@ ProcRenderCreateCursor (ClientPtr client)
free (mskbits); free (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)
{ {
free (argbbits); free (argbbits);
......
...@@ -173,7 +173,8 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data) ...@@ -173,7 +173,8 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
nxagentShmTrap = 1; nxagentShmTrap = 1;
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)
{ {
nxagentShmTrap = 1; nxagentShmTrap = 1;
...@@ -387,7 +388,7 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr) ...@@ -387,7 +388,7 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
nxagentShmPixmapTrap = 1; nxagentShmPixmapTrap = 1;
pPixmap = (*pScreen->CreatePixmap)(pScreen, width, height, depth); pPixmap = (*pScreen->CreatePixmap)(pScreen, width, height, depth, 0);
if (!pPixmap) if (!pPixmap)
{ {
...@@ -397,7 +398,7 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr) ...@@ -397,7 +398,7 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
} }
#ifdef TEST #ifdef TEST
fprintf(stderr,"fbShmCreatePixmap: Width [%d] Height [%d] Depth [%d]\n", width, height, depth); fprintf(stderr,"fbShmCreatePixmap: Width [%d] Height [%d] Depth [%d] Hint[%d]\n", width, height, depth, 0);
#endif #endif
if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth,
......
...@@ -162,7 +162,7 @@ MakeRootTile(WindowPtr pWin) ...@@ -162,7 +162,7 @@ MakeRootTile(WindowPtr pWin)
register int i, j; register 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);
......
...@@ -96,8 +96,8 @@ struct nxagentPixmapPair ...@@ -96,8 +96,8 @@ struct nxagentPixmapPair
PixmapPtr pMap; PixmapPtr pMap;
}; };
PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
int height, int depth) int depth, unsigned usage_hint)
{ {
nxagentPrivPixmapPtr pPixmapPriv, pVirtualPriv; nxagentPrivPixmapPtr pPixmapPriv, pVirtualPriv;
...@@ -106,7 +106,8 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, ...@@ -106,7 +106,8 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "nxagentCreatePixmap: Creating pixmap with width [%d] " fprintf(stderr, "nxagentCreatePixmap: Creating pixmap with width [%d] "
"height [%d] depth [%d].\n", width, height, depth); "height [%d] depth [%d] and allocation hint [%d].\n",
width, height, depth, usage_hint);
#endif #endif
/* /*
...@@ -120,7 +121,8 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, ...@@ -120,7 +121,8 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentCreatePixmap: WARNING! Failed to create pixmap with " fprintf(stderr, "nxagentCreatePixmap: WARNING! Failed to create pixmap with "
"width [%d] height [%d] depth [%d].\n", width, height, depth); "width [%d] height [%d] depth [%d] and allocation hint [%d].\n",
width, height, depth, usage_hint);
#endif #endif
return NullPixmap; return NullPixmap;
...@@ -144,6 +146,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, ...@@ -144,6 +146,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
pPixmap -> devKind = 0; pPixmap -> devKind = 0;
pPixmap -> refcnt = 1; pPixmap -> refcnt = 1;
pPixmap -> devPrivate.ptr = NULL; pPixmap -> devPrivate.ptr = NULL;
pPixmap -> usage_hint = usage_hint;
/* /*
* Initialize the privates of the real picture. * Initialize the privates of the real picture.
...@@ -242,13 +245,14 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, ...@@ -242,13 +245,14 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
* Create the pixmap in the virtual framebuffer. * Create the pixmap in the virtual framebuffer.
*/ */
pVirtual = fbCreatePixmap(pScreen, width, height, depth); pVirtual = fbCreatePixmap(pScreen, width, height, depth, usage_hint);
if (pVirtual == NULL) if (pVirtual == NULL)
{ {
#ifdef PANIC #ifdef PANIC
fprintf(stderr, "nxagentCreatePixmap: PANIC! Failed to create virtual pixmap with " fprintf(stderr, "nxagentCreatePixmap: PANIC! Failed to create virtual pixmap with "
"width [%d] height [%d] depth [%d].\n", width, height, depth); "width [%d] height [%d] depth [%d] and allocation hint [%d].\n",
width, height, depth, usage_hint);
#endif #endif
nxagentDestroyPixmap(pPixmap); nxagentDestroyPixmap(pPixmap);
...@@ -257,8 +261,9 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, ...@@ -257,8 +261,9 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
} }
#ifdef TEST #ifdef TEST
fprintf(stderr,"nxagentCreatePixmap: Allocated memory for the Virtual %sPixmap %p of real Pixmap %p (%dx%d)\n", fprintf(stderr,"nxagentCreatePixmap: Allocated memory for the Virtual %sPixmap %p of real Pixmap %p (%dx%d),",
nxagentShmPixmapTrap ? "Shm " : "", (void *) pVirtual, (void *) pPixmap, width, height); "allocation hint [%d].\n",
nxagentShmPixmapTrap ? "Shm " : "", (void *) pVirtual, (void *) pPixmap, width, height, usage_hint);
#endif #endif
pPixmapPriv -> pVirtualPixmap = pVirtual; pPixmapPriv -> pVirtualPixmap = pVirtual;
...@@ -330,10 +335,11 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, ...@@ -330,10 +335,11 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
"bits per pixel.\n", (void *) pVirtual); "bits per pixel.\n", (void *) pVirtual);
fprintf(stderr, "nxagentCreatePixmap: WARNING! Real pixmap created with width [%d] " fprintf(stderr, "nxagentCreatePixmap: WARNING! Real pixmap created with width [%d] "
"height [%d] depth [%d] bits per pixel [%d].\n", pPixmap -> drawable.width, "height [%d] depth [%d] bits per pixel [%d] and allocation hint [%d].\n",
pPixmap -> drawable.width,
pPixmap -> drawable.height = height, pPixmap -> drawable.depth, pPixmap -> drawable.height = height, pPixmap -> drawable.depth,
pPixmap -> drawable.bitsPerPixel); pPixmap -> drawable.bitsPerPixel,
usage_hint);
#endif #endif
if (!nxagentRenderTrap) if (!nxagentRenderTrap)
...@@ -352,8 +358,8 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, ...@@ -352,8 +358,8 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentCreatePixmap: Created pixmap at [%p] virtual at [%p] with width [%d] " fprintf(stderr, "nxagentCreatePixmap: Created pixmap at [%p] virtual at [%p] with width [%d] "
"height [%d] depth [%d].\n", (void *) pPixmap, (void *) pVirtual, "height [%d] depth [%d] and allocation hint [%d].\n",
width, height, depth); (void *) pPixmap, (void *) pVirtual, width, height, depth, usage_hint);
#endif #endif
return pPixmap; return pPixmap;
......
...@@ -117,7 +117,7 @@ extern int nxagentPixmapPrivateIndex; ...@@ -117,7 +117,7 @@ extern int nxagentPixmapPrivateIndex;
PixmapPtr nxagentPixmapPtr(Pixmap pixmap); PixmapPtr nxagentPixmapPtr(Pixmap pixmap);
PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
int height, int depth); int height, int depth, unsigned usage_hint);
Bool nxagentDestroyPixmap(PixmapPtr pPixmap); Bool nxagentDestroyPixmap(PixmapPtr pPixmap);
......
...@@ -2855,7 +2855,7 @@ int nxagentShadowCreateMainWindow(ScreenPtr pScreen, WindowPtr pWin, int width, ...@@ -2855,7 +2855,7 @@ int nxagentShadowCreateMainWindow(ScreenPtr pScreen, WindowPtr pWin, int width,
DeleteWindow(nxagentShadowWindowPtr, accessWindowID); DeleteWindow(nxagentShadowWindowPtr, accessWindowID);
} }
nxagentShadowPixmapPtr = nxagentCreatePixmap(pScreen, nxagentShadowWidth, nxagentShadowHeight, nxagentShadowDepth); nxagentShadowPixmapPtr = nxagentCreatePixmap(pScreen, nxagentShadowWidth, nxagentShadowHeight, nxagentShadowDepth, 0);
if (nxagentShadowPixmapPtr) if (nxagentShadowPixmapPtr)
{ {
......
...@@ -82,6 +82,7 @@ typedef struct _Pixmap { ...@@ -82,6 +82,7 @@ typedef struct _Pixmap {
short screen_x; short screen_x;
short screen_y; short screen_y;
#endif #endif
unsigned usage_hint; /* see CREATE_PIXMAP_USAGE_* */
} PixmapRec; } PixmapRec;
#endif /* PIXMAPSTRUCT_H */ #endif /* PIXMAPSTRUCT_H */
...@@ -196,11 +196,19 @@ typedef void (* ClipNotifyProcPtr)( ...@@ -196,11 +196,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_PIXMAP_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*/);
......
...@@ -1184,7 +1184,8 @@ miPolyArc(pDraw, pGC, narcs, parcs) ...@@ -1184,7 +1184,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);
......
...@@ -420,7 +420,8 @@ miOpqStipDrawable(pDraw, pGC, prgnSrc, pbits, srcx, w, h, dstx, dsty) ...@@ -420,7 +420,8 @@ miOpqStipDrawable(pDraw, pGC, prgnSrc, pbits, srcx, w, h, dstx, dsty)
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;
...@@ -671,7 +672,8 @@ miGetImage(pDraw, sx, sy, w, h, format, planeMask, pDst) ...@@ -671,7 +672,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);
......
...@@ -493,7 +493,8 @@ miBSGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine) ...@@ -493,7 +493,8 @@ miBSGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine)
XID subWindowMode = IncludeInferiors; XID subWindowMode = IncludeInferiors;
int x, y; int x, y;
pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, depth); pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) if (!pPixmap)
goto punt; goto punt;
pGC = GetScratchGC (depth, pScreen); pGC = GetScratchGC (depth, pScreen);
...@@ -2737,7 +2738,7 @@ miResizeBackingStore( ...@@ -2737,7 +2738,7 @@ miResizeBackingStore(
pNewPixmap = (PixmapPtr)(*pScreen->CreatePixmap) pNewPixmap = (PixmapPtr)(*pScreen->CreatePixmap)
(pScreen, (pScreen,
nw, nh, nw, nh,
pWin->drawable.depth); pWin->drawable.depth, 0);
if (!pNewPixmap) if (!pNewPixmap)
{ {
#ifdef BSEAGER #ifdef BSEAGER
...@@ -3737,7 +3738,7 @@ miCreateBSPixmap (pWin, pExtents) ...@@ -3737,7 +3738,7 @@ miCreateBSPixmap (pWin, pExtents)
(pScreen, (pScreen,
extents->x2 - extents->x1, extents->x2 - extents->x1,
extents->y2 - extents->y1, extents->y2 - extents->y1,
pWin->drawable.depth); pWin->drawable.depth, 0);
} }
if (!pBackingStore->pBackingPixmap) if (!pBackingStore->pBackingPixmap)
{ {
......
...@@ -266,7 +266,8 @@ miDCRealize ( ...@@ -266,7 +266,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)
{ {
free ((void *) pPriv); free ((void *) pPriv);
...@@ -298,13 +299,13 @@ miDCRealize ( ...@@ -298,13 +299,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)
{ {
free ((void *) pPriv); free ((void *) 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);
...@@ -525,7 +526,7 @@ miDCSaveUnderCursor (pScreen, x, y, w, h) ...@@ -525,7 +526,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;
} }
...@@ -735,7 +736,7 @@ miDCMoveCursor (pScreen, pCursor, x, y, w, h, dx, dy, source, mask) ...@@ -735,7 +736,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;
} }
......
...@@ -125,7 +125,8 @@ miPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) ...@@ -125,7 +125,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;
......
...@@ -160,7 +160,7 @@ miCreateScreenResources(pScreen) ...@@ -160,7 +160,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;
......
...@@ -137,7 +137,8 @@ miCompositeRects (CARD8 op, ...@@ -137,7 +137,8 @@ miCompositeRects (CARD8 op,
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;
......
...@@ -62,7 +62,7 @@ miCreateAlphaPicture (ScreenPtr pScreen, ...@@ -62,7 +62,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);
......
...@@ -1570,7 +1570,8 @@ ProcRenderCreateCursor (ClientPtr client) ...@@ -1570,7 +1570,8 @@ ProcRenderCreateCursor (ClientPtr client)
free (mskbits); free (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)
{ {
free (argbbits); free (argbbits);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment