aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2017-04-10 16:33:27 +0200
committerMihai Moldovan <ionic@ionic.de>2017-04-10 16:33:27 +0200
commit2d700b147a94fbb92ad9ad90b265a3bc1ceca6e3 (patch)
tree563d66344108d7b00cbf01068cd3e6a88017b0e9 /nx-X11/programs/Xserver/hw
parentcc24d8ba254f1e5062c21adfa07f8b58bb2c5eaa (diff)
parent8b5bb2cdafe5f7bd77826a1fd28f07b7329be899 (diff)
downloadnx-libs-2d700b147a94fbb92ad9ad90b265a3bc1ceca6e3.tar.gz
nx-libs-2d700b147a94fbb92ad9ad90b265a3bc1ceca6e3.tar.bz2
nx-libs-2d700b147a94fbb92ad9ad90b265a3bc1ceca6e3.zip
Merge branch 'sunweaver-pr/createpixmap-alloc-hints-abi-change' into 3.6.x
Attributes GH PR #410: https://github.com/ArcticaProject/nx-libs/pull/410
Diffstat (limited to 'nx-X11/programs/Xserver/hw')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Drawable.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXglyph.c4
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c3
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXrender.c3
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXshm.c7
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXwindow.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pixmap.c32
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Screen.c2
9 files changed, 34 insertions, 23 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
index 8d6f4139d..917f460ba 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
@@ -2702,7 +2702,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable)
* 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)
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c
index 7bf285d1f..34195808d 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c
@@ -245,7 +245,9 @@ miGlyphs (CARD8 op,
return;
width = extents.x2 - extents.x1;
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)
return;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c
index 8b875555f..549ab4333 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c
@@ -114,7 +114,8 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns
/* zeroing the (pad) bits seems to help some ddx cursor handling */
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);
if (!ppix || !pGC)
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
index ef288db0b..c1a4577bd 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c
@@ -1266,7 +1266,8 @@ ProcRenderCreateCursor (ClientPtr client)
free (mskbits);
return (BadImplementation);
}
- pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32);
+ pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32,
+ CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap)
{
free (argbbits);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
index f251f3b9f..2ffca8066 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
@@ -173,7 +173,8 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
nxagentShmTrap = 1;
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)
{
nxagentShmTrap = 1;
@@ -387,7 +388,7 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
nxagentShmPixmapTrap = 1;
- pPixmap = (*pScreen->CreatePixmap)(pScreen, width, height, depth);
+ pPixmap = (*pScreen->CreatePixmap)(pScreen, width, height, depth, 0);
if (!pPixmap)
{
@@ -397,7 +398,7 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
}
#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
if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth,
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
index adff36569..7de25ca28 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
@@ -162,7 +162,7 @@ MakeRootTile(WindowPtr pWin)
register int i, j;
pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4,
- pScreen->rootDepth);
+ pScreen->rootDepth, 0);
pWin->backgroundState = BackgroundPixmap;
pGC = GetScratchGC(pScreen->rootDepth, pScreen);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
index 05558e34f..be5408d13 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
@@ -96,8 +96,8 @@ struct nxagentPixmapPair
PixmapPtr pMap;
};
-PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
- int height, int depth)
+PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
+ int depth, unsigned usage_hint)
{
nxagentPrivPixmapPtr pPixmapPriv, pVirtualPriv;
@@ -106,7 +106,8 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
#ifdef DEBUG
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
/*
@@ -120,7 +121,8 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
{
#ifdef WARNING
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
return NullPixmap;
@@ -144,6 +146,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
pPixmap -> devKind = 0;
pPixmap -> refcnt = 1;
pPixmap -> devPrivate.ptr = NULL;
+ pPixmap -> usage_hint = usage_hint;
/*
* Initialize the privates of the real picture.
@@ -242,13 +245,14 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
* Create the pixmap in the virtual framebuffer.
*/
- pVirtual = fbCreatePixmap(pScreen, width, height, depth);
+ pVirtual = fbCreatePixmap(pScreen, width, height, depth, usage_hint);
if (pVirtual == NULL)
{
#ifdef PANIC
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
nxagentDestroyPixmap(pPixmap);
@@ -257,8 +261,9 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
}
#ifdef TEST
- fprintf(stderr,"nxagentCreatePixmap: Allocated memory for the Virtual %sPixmap %p of real Pixmap %p (%dx%d)\n",
- nxagentShmPixmapTrap ? "Shm " : "", (void *) pVirtual, (void *) pPixmap, width, height);
+ fprintf(stderr,"nxagentCreatePixmap: Allocated memory for the Virtual %sPixmap %p of real Pixmap %p (%dx%d),",
+ "allocation hint [%d].\n",
+ nxagentShmPixmapTrap ? "Shm " : "", (void *) pVirtual, (void *) pPixmap, width, height, usage_hint);
#endif
pPixmapPriv -> pVirtualPixmap = pVirtual;
@@ -330,10 +335,11 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
"bits per pixel.\n", (void *) pVirtual);
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.bitsPerPixel);
-
+ pPixmap -> drawable.bitsPerPixel,
+ usage_hint);
#endif
if (!nxagentRenderTrap)
@@ -352,8 +358,8 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
#ifdef TEST
fprintf(stderr, "nxagentCreatePixmap: Created pixmap at [%p] virtual at [%p] with width [%d] "
- "height [%d] depth [%d].\n", (void *) pPixmap, (void *) pVirtual,
- width, height, depth);
+ "height [%d] depth [%d] and allocation hint [%d].\n",
+ (void *) pPixmap, (void *) pVirtual, width, height, depth, usage_hint);
#endif
return pPixmap;
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h b/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h
index d823cd77b..00cc39c5f 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h
@@ -117,7 +117,7 @@ extern int nxagentPixmapPrivateIndex;
PixmapPtr nxagentPixmapPtr(Pixmap pixmap);
PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
- int height, int depth);
+ int height, int depth, unsigned usage_hint);
Bool nxagentDestroyPixmap(PixmapPtr pPixmap);
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index 8fb4ce710..1c3e76580 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -2855,7 +2855,7 @@ int nxagentShadowCreateMainWindow(ScreenPtr pScreen, WindowPtr pWin, int width,
DeleteWindow(nxagentShadowWindowPtr, accessWindowID);
}
- nxagentShadowPixmapPtr = nxagentCreatePixmap(pScreen, nxagentShadowWidth, nxagentShadowHeight, nxagentShadowDepth);
+ nxagentShadowPixmapPtr = nxagentCreatePixmap(pScreen, nxagentShadowWidth, nxagentShadowHeight, nxagentShadowDepth, 0);
if (nxagentShadowPixmapPtr)
{