aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c
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/nxagent/Pixmap.c
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/nxagent/Pixmap.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Pixmap.c32
1 files changed, 19 insertions, 13 deletions
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;