Commit 8b5bb2cd authored by Mike Gabriel's avatar Mike Gabriel

hw/nxagent/Pixmap.c et al.: Propagate usage_hint through nxagentCreatePixmap, as well.

parent 560c9564
...@@ -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;
......
...@@ -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;
...@@ -243,13 +245,14 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, ...@@ -243,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, 0); 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);
...@@ -258,8 +261,9 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, ...@@ -258,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;
...@@ -331,10 +335,11 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, ...@@ -331,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)
...@@ -353,8 +358,8 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, ...@@ -353,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)
{ {
......
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