Revert "dix: Remove usage_hint from pixmaps, store it in ->drawable.class"
This reverts commit 1564c82417
.
The drivers used the top bits of the usage_hint to store driver
private flags (intel, radeon, nouveau).
With EXA we need to get at this data so if we migrate the pixmap we
can create the correct type of pixmap in the driver, however this
commit truncates the usage_hint into 8-bit class and loses all the
good stuff.
Signed-off-by: Dave Airlie <airlied@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
dc9ce695a6
commit
d5b16b037b
|
@ -712,7 +712,7 @@ typedef struct _ExaDriver {
|
||||||
* driver MUST fill out new_fb_pitch with valid pitch of pixmap
|
* driver MUST fill out new_fb_pitch with valid pitch of pixmap
|
||||||
*/
|
*/
|
||||||
void *(*CreatePixmap2)(ScreenPtr pScreen, int width, int height,
|
void *(*CreatePixmap2)(ScreenPtr pScreen, int width, int height,
|
||||||
int depth, int class, int bitsPerPixel,
|
int depth, int usage_hint, int bitsPerPixel,
|
||||||
int *new_fb_pitch);
|
int *new_fb_pitch);
|
||||||
/** @} */
|
/** @} */
|
||||||
} ExaDriverRec, *ExaDriverPtr;
|
} ExaDriverRec, *ExaDriverPtr;
|
||||||
|
|
|
@ -54,7 +54,7 @@ ExaGetPixmapAddress(PixmapPtr p)
|
||||||
*/
|
*/
|
||||||
PixmapPtr
|
PixmapPtr
|
||||||
exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
|
exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
|
||||||
unsigned class)
|
unsigned usage_hint)
|
||||||
{
|
{
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
ExaPixmapPrivPtr pExaPixmap;
|
ExaPixmapPrivPtr pExaPixmap;
|
||||||
|
@ -66,7 +66,7 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
|
||||||
return NullPixmap;
|
return NullPixmap;
|
||||||
|
|
||||||
swap(pExaScr, pScreen, CreatePixmap);
|
swap(pExaScr, pScreen, CreatePixmap);
|
||||||
pPixmap = pScreen->CreatePixmap (pScreen, w, h, depth, class);
|
pPixmap = pScreen->CreatePixmap (pScreen, w, h, depth, usage_hint);
|
||||||
swap(pExaScr, pScreen, CreatePixmap);
|
swap(pExaScr, pScreen, CreatePixmap);
|
||||||
|
|
||||||
if (!pPixmap)
|
if (!pPixmap)
|
||||||
|
|
|
@ -48,7 +48,7 @@ ExaGetPixmapAddress(PixmapPtr p)
|
||||||
*/
|
*/
|
||||||
PixmapPtr
|
PixmapPtr
|
||||||
exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
|
exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
|
||||||
unsigned class)
|
unsigned usage_hint)
|
||||||
{
|
{
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
ExaPixmapPrivPtr pExaPixmap;
|
ExaPixmapPrivPtr pExaPixmap;
|
||||||
|
@ -60,7 +60,7 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
|
||||||
return NullPixmap;
|
return NullPixmap;
|
||||||
|
|
||||||
swap(pExaScr, pScreen, CreatePixmap);
|
swap(pExaScr, pScreen, CreatePixmap);
|
||||||
pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, class);
|
pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, usage_hint);
|
||||||
swap(pExaScr, pScreen, CreatePixmap);
|
swap(pExaScr, pScreen, CreatePixmap);
|
||||||
|
|
||||||
if (!pPixmap)
|
if (!pPixmap)
|
||||||
|
@ -78,7 +78,7 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
|
||||||
|
|
||||||
if (pExaScr->info->CreatePixmap2) {
|
if (pExaScr->info->CreatePixmap2) {
|
||||||
int new_pitch = 0;
|
int new_pitch = 0;
|
||||||
pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, class, bpp, &new_pitch);
|
pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, usage_hint, bpp, &new_pitch);
|
||||||
paddedWidth = pExaPixmap->fb_pitch = new_pitch;
|
paddedWidth = pExaPixmap->fb_pitch = new_pitch;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -39,7 +39,7 @@ exaCreateDriverPixmap_mixed(PixmapPtr pPixmap)
|
||||||
ExaPixmapPriv(pPixmap);
|
ExaPixmapPriv(pPixmap);
|
||||||
int w = pPixmap->drawable.width, h = pPixmap->drawable.height;
|
int w = pPixmap->drawable.width, h = pPixmap->drawable.height;
|
||||||
int depth = pPixmap->drawable.depth, bpp = pPixmap->drawable.bitsPerPixel;
|
int depth = pPixmap->drawable.depth, bpp = pPixmap->drawable.bitsPerPixel;
|
||||||
int class = pPixmap->drawable.class;
|
int usage_hint = pPixmap->usage_hint;
|
||||||
int paddedWidth = pExaPixmap->sys_pitch;
|
int paddedWidth = pExaPixmap->sys_pitch;
|
||||||
|
|
||||||
/* Already done. */
|
/* Already done. */
|
||||||
|
@ -55,7 +55,7 @@ exaCreateDriverPixmap_mixed(PixmapPtr pPixmap)
|
||||||
|
|
||||||
if (pExaScr->info->CreatePixmap2) {
|
if (pExaScr->info->CreatePixmap2) {
|
||||||
int new_pitch = 0;
|
int new_pitch = 0;
|
||||||
pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, class, bpp, &new_pitch);
|
pExaPixmap->driverPriv = pExaScr->info->CreatePixmap2(pScreen, w, h, depth, usage_hint, bpp, &new_pitch);
|
||||||
paddedWidth = pExaPixmap->fb_pitch = new_pitch;
|
paddedWidth = pExaPixmap->fb_pitch = new_pitch;
|
||||||
} else {
|
} else {
|
||||||
if (paddedWidth < pExaPixmap->fb_pitch)
|
if (paddedWidth < pExaPixmap->fb_pitch)
|
||||||
|
|
|
@ -47,7 +47,7 @@ ExaGetPixmapAddress(PixmapPtr p)
|
||||||
*/
|
*/
|
||||||
PixmapPtr
|
PixmapPtr
|
||||||
exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
|
exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
|
||||||
unsigned class)
|
unsigned usage_hint)
|
||||||
{
|
{
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
ExaPixmapPrivPtr pExaPixmap;
|
ExaPixmapPrivPtr pExaPixmap;
|
||||||
|
@ -59,7 +59,7 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
|
||||||
return NullPixmap;
|
return NullPixmap;
|
||||||
|
|
||||||
swap(pExaScr, pScreen, CreatePixmap);
|
swap(pExaScr, pScreen, CreatePixmap);
|
||||||
pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, class);
|
pPixmap = pScreen->CreatePixmap(pScreen, 0, 0, depth, usage_hint);
|
||||||
swap(pExaScr, pScreen, CreatePixmap);
|
swap(pExaScr, pScreen, CreatePixmap);
|
||||||
|
|
||||||
if (!pPixmap)
|
if (!pPixmap)
|
||||||
|
|
|
@ -588,7 +588,7 @@ extern const GCFuncs exaGCFuncs;
|
||||||
/* exa_classic.c */
|
/* exa_classic.c */
|
||||||
PixmapPtr
|
PixmapPtr
|
||||||
exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
|
exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
|
||||||
unsigned class);
|
unsigned usage_hint);
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, int depth,
|
exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, int depth,
|
||||||
|
@ -603,7 +603,7 @@ exaPixmapHasGpuCopy_classic(PixmapPtr pPixmap);
|
||||||
/* exa_driver.c */
|
/* exa_driver.c */
|
||||||
PixmapPtr
|
PixmapPtr
|
||||||
exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
|
exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
|
||||||
unsigned class);
|
unsigned usage_hint);
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height, int depth,
|
exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height, int depth,
|
||||||
|
@ -618,7 +618,7 @@ exaPixmapHasGpuCopy_driver(PixmapPtr pPixmap);
|
||||||
/* exa_mixed.c */
|
/* exa_mixed.c */
|
||||||
PixmapPtr
|
PixmapPtr
|
||||||
exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
|
exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
|
||||||
unsigned class);
|
unsigned usage_hint);
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
|
exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
|
||||||
|
|
4
fb/fb.h
4
fb/fb.h
|
@ -1625,11 +1625,11 @@ fbPictureInit (ScreenPtr pScreen,
|
||||||
|
|
||||||
extern _X_EXPORT PixmapPtr
|
extern _X_EXPORT PixmapPtr
|
||||||
fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
|
fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
|
||||||
unsigned class);
|
unsigned usage_hint);
|
||||||
|
|
||||||
extern _X_EXPORT PixmapPtr
|
extern _X_EXPORT PixmapPtr
|
||||||
fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
|
fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
|
||||||
unsigned class);
|
unsigned usage_hint);
|
||||||
|
|
||||||
extern _X_EXPORT Bool
|
extern _X_EXPORT Bool
|
||||||
fbDestroyPixmap (PixmapPtr pPixmap);
|
fbDestroyPixmap (PixmapPtr pPixmap);
|
||||||
|
|
|
@ -546,7 +546,7 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel)
|
||||||
pNewTile = pScreen->CreatePixmap(pScreen, pOldTile->drawable.width,
|
pNewTile = pScreen->CreatePixmap(pScreen, pOldTile->drawable.width,
|
||||||
pOldTile->drawable.height,
|
pOldTile->drawable.height,
|
||||||
pOldTile->drawable.depth,
|
pOldTile->drawable.depth,
|
||||||
pOldTile->drawable.class);
|
pOldTile->usage_hint);
|
||||||
if (!pNewTile)
|
if (!pNewTile)
|
||||||
return 0;
|
return 0;
|
||||||
fbGetDrawable (&pOldTile->drawable,
|
fbGetDrawable (&pOldTile->drawable,
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
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 class)
|
unsigned usage_hint)
|
||||||
{
|
{
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
size_t datasize;
|
size_t datasize;
|
||||||
|
@ -54,7 +54,7 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
|
||||||
if (!pPixmap)
|
if (!pPixmap)
|
||||||
return NullPixmap;
|
return NullPixmap;
|
||||||
pPixmap->drawable.type = DRAWABLE_PIXMAP;
|
pPixmap->drawable.type = DRAWABLE_PIXMAP;
|
||||||
pPixmap->drawable.class = class;
|
pPixmap->drawable.class = 0;
|
||||||
pPixmap->drawable.pScreen = pScreen;
|
pPixmap->drawable.pScreen = pScreen;
|
||||||
pPixmap->drawable.depth = depth;
|
pPixmap->drawable.depth = depth;
|
||||||
pPixmap->drawable.bitsPerPixel = bpp;
|
pPixmap->drawable.bitsPerPixel = bpp;
|
||||||
|
@ -78,12 +78,14 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
|
||||||
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 class)
|
unsigned usage_hint)
|
||||||
{
|
{
|
||||||
int bpp;
|
int bpp;
|
||||||
bpp = BitsPerPixel (depth);
|
bpp = BitsPerPixel (depth);
|
||||||
|
@ -91,7 +93,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, class);
|
return fbCreatePixmapBpp (pScreen, width, height, depth, bpp, usage_hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
|
|
|
@ -82,7 +82,7 @@ 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 class)
|
unsigned usage_hint)
|
||||||
{
|
{
|
||||||
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
|
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
|
@ -104,7 +104,7 @@ PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
||||||
return NullPixmap;
|
return NullPixmap;
|
||||||
|
|
||||||
pPixmap->drawable.type = DRAWABLE_PIXMAP;
|
pPixmap->drawable.type = DRAWABLE_PIXMAP;
|
||||||
pPixmap->drawable.class = class;
|
pPixmap->drawable.class = 0;
|
||||||
pPixmap->drawable.pScreen = pScreen;
|
pPixmap->drawable.pScreen = pScreen;
|
||||||
pPixmap->drawable.depth = depth;
|
pPixmap->drawable.depth = depth;
|
||||||
pPixmap->drawable.bitsPerPixel = bpp;
|
pPixmap->drawable.bitsPerPixel = bpp;
|
||||||
|
@ -116,6 +116,7 @@ PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
||||||
pPixmap->drawable.height = height;
|
pPixmap->drawable.height = height;
|
||||||
pPixmap->devKind = PixmapBytePad(width, bpp);
|
pPixmap->devKind = PixmapBytePad(width, bpp);
|
||||||
pPixmap->refcnt = 1;
|
pPixmap->refcnt = 1;
|
||||||
|
pPixmap->usage_hint = usage_hint;
|
||||||
|
|
||||||
pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
|
pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
|
||||||
pPixPriv->pixmap = (Pixmap)0;
|
pPixPriv->pixmap = (Pixmap)0;
|
||||||
|
|
|
@ -50,7 +50,7 @@ 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 class);
|
unsigned usage_hint);
|
||||||
extern Bool dmxDestroyPixmap(PixmapPtr pPixmap);
|
extern Bool dmxDestroyPixmap(PixmapPtr pPixmap);
|
||||||
extern RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap);
|
extern RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap);
|
||||||
|
|
||||||
|
|
|
@ -369,13 +369,13 @@ VGAarbiterClearToBackground (
|
||||||
}
|
}
|
||||||
|
|
||||||
static PixmapPtr
|
static PixmapPtr
|
||||||
VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned class)
|
VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint)
|
||||||
{
|
{
|
||||||
PixmapPtr pPix;
|
PixmapPtr pPix;
|
||||||
|
|
||||||
SCREEN_PROLOG ( CreatePixmap);
|
SCREEN_PROLOG ( CreatePixmap);
|
||||||
VGAGet(pScreen);
|
VGAGet(pScreen);
|
||||||
pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, class);
|
pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SCREEN_EPILOG (CreatePixmap, VGAarbiterCreatePixmap);
|
SCREEN_EPILOG (CreatePixmap, VGAarbiterCreatePixmap);
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ static void VGAarbiterCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
|
||||||
static void VGAarbiterClearToBackground (WindowPtr pWin, int x, int y, int w,
|
static void VGAarbiterClearToBackground (WindowPtr pWin, int x, int y, int w,
|
||||||
int h, Bool generateExposures);
|
int h, Bool generateExposures);
|
||||||
static PixmapPtr VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h,
|
static PixmapPtr VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h,
|
||||||
int depth, unsigned int class);
|
int depth, unsigned int usage_hint);
|
||||||
static Bool VGAarbiterCreateGC(GCPtr pGC);
|
static Bool VGAarbiterCreateGC(GCPtr pGC);
|
||||||
static Bool VGAarbiterSaveScreen(ScreenPtr pScreen, Bool unblank);
|
static Bool VGAarbiterSaveScreen(ScreenPtr pScreen, Bool unblank);
|
||||||
static void VGAarbiterStoreColors (ColormapPtr pmap, int ndef, xColorItem
|
static void VGAarbiterStoreColors (ColormapPtr pmap, int ndef, xColorItem
|
||||||
|
|
|
@ -34,7 +34,7 @@ static void XAAGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
|
||||||
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 class);
|
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);
|
||||||
|
@ -331,7 +331,7 @@ XAAInitializeOffscreenDepths (ScreenPtr pScreen)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PixmapPtr
|
static PixmapPtr
|
||||||
XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned class)
|
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];
|
||||||
|
@ -346,7 +346,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned class)
|
||||||
XAAInitializeOffscreenDepths (pScreen);
|
XAAInitializeOffscreenDepths (pScreen);
|
||||||
|
|
||||||
if(pScrn->vtSema &&
|
if(pScrn->vtSema &&
|
||||||
(class != CREATE_PIXMAP_USAGE_GLYPH_PICTURE) &&
|
(usage_hint != CREATE_PIXMAP_USAGE_GLYPH_PICTURE) &&
|
||||||
(infoRec->offscreenDepths & (1 << (depth - 1))) &&
|
(infoRec->offscreenDepths & (1 << (depth - 1))) &&
|
||||||
(size >= MIN_OFFPIX_SIZE) && !SwitchedOut &&
|
(size >= MIN_OFFPIX_SIZE) && !SwitchedOut &&
|
||||||
(!infoRec->maxOffPixWidth || (w <= infoRec->maxOffPixWidth)) &&
|
(!infoRec->maxOffPixWidth || (w <= infoRec->maxOffPixWidth)) &&
|
||||||
|
@ -379,7 +379,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned class)
|
||||||
}
|
}
|
||||||
|
|
||||||
XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
|
XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
|
||||||
pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, class);
|
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) {
|
||||||
|
@ -411,7 +411,7 @@ XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned class)
|
||||||
}
|
}
|
||||||
BAILOUT:
|
BAILOUT:
|
||||||
XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
|
XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
|
||||||
pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, class);
|
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) {
|
||||||
|
|
|
@ -37,7 +37,7 @@ DevPrivateKeyRec xnestPixmapPrivateKeyRec;
|
||||||
|
|
||||||
PixmapPtr
|
PixmapPtr
|
||||||
xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
||||||
unsigned class)
|
unsigned usage_hint)
|
||||||
{
|
{
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
||||||
if (!pPixmap)
|
if (!pPixmap)
|
||||||
return NullPixmap;
|
return NullPixmap;
|
||||||
pPixmap->drawable.type = DRAWABLE_PIXMAP;
|
pPixmap->drawable.type = DRAWABLE_PIXMAP;
|
||||||
pPixmap->drawable.class = class;
|
pPixmap->drawable.class = 0;
|
||||||
pPixmap->drawable.depth = depth;
|
pPixmap->drawable.depth = depth;
|
||||||
pPixmap->drawable.bitsPerPixel = depth;
|
pPixmap->drawable.bitsPerPixel = depth;
|
||||||
pPixmap->drawable.id = 0;
|
pPixmap->drawable.id = 0;
|
||||||
|
@ -57,6 +57,7 @@ xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
||||||
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||||
pPixmap->refcnt = 1;
|
pPixmap->refcnt = 1;
|
||||||
pPixmap->devKind = PixmapBytePad(width, depth);
|
pPixmap->devKind = PixmapBytePad(width, depth);
|
||||||
|
pPixmap->usage_hint = usage_hint;
|
||||||
if (width && height)
|
if (width && height)
|
||||||
xnestPixmapPriv(pPixmap)->pixmap =
|
xnestPixmapPriv(pPixmap)->pixmap =
|
||||||
XCreatePixmap(xnestDisplay,
|
XCreatePixmap(xnestDisplay,
|
||||||
|
|
|
@ -30,7 +30,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, unsigned class);
|
int depth, unsigned usage_hint);
|
||||||
Bool xnestDestroyPixmap(PixmapPtr pPixmap);
|
Bool xnestDestroyPixmap(PixmapPtr pPixmap);
|
||||||
RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap);
|
RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap);
|
||||||
|
|
||||||
|
|
|
@ -1069,7 +1069,7 @@ winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen);
|
||||||
|
|
||||||
PixmapPtr
|
PixmapPtr
|
||||||
winCreatePixmapNativeGDI (ScreenPtr pScreen, int width, int height, int depth,
|
winCreatePixmapNativeGDI (ScreenPtr pScreen, int width, int height, int depth,
|
||||||
unsigned class);
|
unsigned usage_hint);
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
winDestroyPixmapNativeGDI (PixmapPtr pPixmap);
|
winDestroyPixmapNativeGDI (PixmapPtr pPixmap);
|
||||||
|
|
|
@ -57,7 +57,7 @@ winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix,
|
||||||
PixmapPtr
|
PixmapPtr
|
||||||
winCreatePixmapNativeGDI (ScreenPtr pScreen,
|
winCreatePixmapNativeGDI (ScreenPtr pScreen,
|
||||||
int iWidth, int iHeight,
|
int iWidth, int iHeight,
|
||||||
int iDepth, unsigned class)
|
int iDepth, unsigned usage_hint)
|
||||||
{
|
{
|
||||||
winPrivPixmapPtr pPixmapPriv = NULL;
|
winPrivPixmapPtr pPixmapPriv = NULL;
|
||||||
PixmapPtr pPixmap = NULL;
|
PixmapPtr pPixmap = NULL;
|
||||||
|
@ -72,13 +72,13 @@ winCreatePixmapNativeGDI (ScreenPtr pScreen,
|
||||||
|
|
||||||
#if CYGDEBUG
|
#if CYGDEBUG
|
||||||
winDebug ("winCreatePixmap () - w %d h %d d %d uh %d bw %d\n",
|
winDebug ("winCreatePixmap () - w %d h %d d %d uh %d bw %d\n",
|
||||||
iWidth, iHeight, iDepth, class,
|
iWidth, iHeight, iDepth, usage_hint,
|
||||||
PixmapBytePad (iWidth, iDepth));
|
PixmapBytePad (iWidth, iDepth));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Setup pixmap values */
|
/* Setup pixmap values */
|
||||||
pPixmap->drawable.type = DRAWABLE_PIXMAP;
|
pPixmap->drawable.type = DRAWABLE_PIXMAP;
|
||||||
pPixmap->drawable.class = class;
|
pPixmap->drawable.class = 0;
|
||||||
pPixmap->drawable.pScreen = pScreen;
|
pPixmap->drawable.pScreen = pScreen;
|
||||||
pPixmap->drawable.depth = iDepth;
|
pPixmap->drawable.depth = iDepth;
|
||||||
pPixmap->drawable.bitsPerPixel = BitsPerPixel (iDepth);
|
pPixmap->drawable.bitsPerPixel = BitsPerPixel (iDepth);
|
||||||
|
@ -91,6 +91,7 @@ winCreatePixmapNativeGDI (ScreenPtr pScreen,
|
||||||
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;
|
||||||
|
|
||||||
/* Pixmap privates are allocated by AllocatePixmap */
|
/* Pixmap privates are allocated by AllocatePixmap */
|
||||||
pPixmapPriv = winGetPixmapPriv (pPixmap);
|
pPixmapPriv = winGetPixmapPriv (pPixmap);
|
||||||
|
|
|
@ -80,6 +80,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 */
|
||||||
|
|
|
@ -208,7 +208,7 @@ typedef PixmapPtr (* CreatePixmapProcPtr)(
|
||||||
int /*width*/,
|
int /*width*/,
|
||||||
int /*height*/,
|
int /*height*/,
|
||||||
int /*depth*/,
|
int /*depth*/,
|
||||||
unsigned /*class*/);
|
unsigned /*usage_hint*/);
|
||||||
|
|
||||||
typedef Bool (* DestroyPixmapProcPtr)(
|
typedef Bool (* DestroyPixmapProcPtr)(
|
||||||
PixmapPtr /*pPixmap*/);
|
PixmapPtr /*pPixmap*/);
|
||||||
|
|
Loading…
Reference in New Issue