本文整理汇总了C++中ScreenPtr类的典型用法代码示例。如果您正苦于以下问题:C++ ScreenPtr类的具体用法?C++ ScreenPtr怎么用?C++ ScreenPtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ScreenPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rdpRRScreenSetSize
Bool
rdpRRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
CARD32 mmWidth, CARD32 mmHeight)
{
WindowPtr root;
PixmapPtr screenPixmap;
BoxRec box;
rdpPtr dev;
LLOGLN(0, ("rdpRRScreenSetSize: width %d height %d mmWidth %d mmHeight %d",
width, height, (int)mmWidth, (int)mmHeight));
dev = rdpGetDevFromScreen(pScreen);
root = rdpGetRootWindowPtr(pScreen);
if ((width < 1) || (height < 1))
{
LLOGLN(10, (" error width %d height %d", width, height));
return FALSE;
}
dev->width = width;
dev->height = height;
dev->paddedWidthInBytes = PixmapBytePad(dev->width, dev->depth);
dev->sizeInBytes = dev->paddedWidthInBytes * dev->height;
pScreen->width = width;
pScreen->height = height;
pScreen->mmWidth = mmWidth;
pScreen->mmHeight = mmHeight;
screenPixmap = pScreen->GetScreenPixmap(pScreen);
g_free(dev->pfbMemory_alloc);
dev->pfbMemory_alloc = (char *) g_malloc(dev->sizeInBytes + 16, 1);
dev->pfbMemory = (char *) RDPALIGN(dev->pfbMemory_alloc, 16);
if (screenPixmap != 0)
{
pScreen->ModifyPixmapHeader(screenPixmap, width, height,
-1, -1,
dev->paddedWidthInBytes,
dev->pfbMemory);
}
box.x1 = 0;
box.y1 = 0;
box.x2 = width;
box.y2 = height;
rdpRegionInit(&root->winSize, &box, 1);
rdpRegionInit(&root->borderSize, &box, 1);
rdpRegionReset(&root->borderClip, &box);
rdpRegionBreak(&root->clipList);
root->drawable.width = width;
root->drawable.height = height;
ResizeChildrenWinSize(root, 0, 0, 0, 0);
RRGetInfo(pScreen, 1);
LLOGLN(0, (" screen resized to %dx%d", pScreen->width, pScreen->height));
RRScreenSizeNotify(pScreen);
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0)
xf86EnableDisableFBAccess(pScreen->myNum, FALSE);
xf86EnableDisableFBAccess(pScreen->myNum, TRUE);
#else
xf86EnableDisableFBAccess(xf86Screens[pScreen->myNum], FALSE);
xf86EnableDisableFBAccess(xf86Screens[pScreen->myNum], TRUE);
#endif
return TRUE;
}
示例2: RootlessPaintWindowBackground
static void
RootlessPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what)
{
int oldBackgroundState = 0;
PixUnion oldBackground;
ScreenPtr pScreen = pWin->drawable.pScreen;
SCREEN_UNWRAP(pScreen, PaintWindowBackground);
RL_DEBUG_MSG("paintwindowbackground start (win 0x%x) ", pWin);
if (IsFramedWindow(pWin)) {
if (IsRoot(pWin)) {
// set root background to magic transparent color
oldBackgroundState = pWin->backgroundState;
oldBackground = pWin->background;
pWin->backgroundState = BackgroundPixel;
pWin->background.pixel = 0x00fffffe;
}
}
pScreen->PaintWindowBackground(pWin, pRegion, what);
if (IsFramedWindow(pWin)) {
RootlessDamageRegion(pWin, pRegion);
if (IsRoot(pWin)) {
pWin->backgroundState = oldBackgroundState;
pWin->background = oldBackground;
}
}
SCREEN_WRAP(pScreen, PaintWindowBackground);
RL_DEBUG_MSG("paintwindowbackground end\n");
}
示例3: vivante_dri2_CreateBuffer
static DRI2Buffer2Ptr
vivante_dri2_CreateBuffer(DrawablePtr drawable, unsigned int attachment,
unsigned int format)
{
struct vivante_dri2_buffer *buf;
struct vivante_pixmap *vpix;
ScreenPtr pScreen = drawable->pScreen;
PixmapPtr pixmap = NULL;
uint32_t name;
fprintf(stderr, "%s: %p %u %u\n", __func__, drawable, attachment, format);
if (attachment == DRI2BufferFrontLeft) {
pixmap = vivante_dri2_get_front_pixmap(drawable);
if (!pixmap) {
drawable = &pixmap->drawable;
pixmap = NULL;
}
}
if (pixmap == NULL) {
int width = drawable->width;
int height = drawable->height;
int depth = format ? format : drawable->depth;
pixmap = pScreen->CreatePixmap(pScreen, width, height, depth, 0);
if (!pixmap)
goto err;
}
vpix = vivante_get_pixmap_priv(pixmap);
if (!vpix)
goto err;
buf = calloc(1, sizeof *buf);
if (!buf)
goto err;
if (!vpix->bo || drm_armada_bo_flink(vpix->bo, &name)) {
free(buf);
goto err;
}
buf->dri2.attachment = attachment;
buf->dri2.name = name;
buf->dri2.pitch = pixmap->devKind;
buf->dri2.cpp = pixmap->drawable.bitsPerPixel / 8;
buf->dri2.flags = 0;
buf->dri2.format = format;
buf->dri2.driverPrivate = buf;
buf->pixmap = pixmap;
buf->ref = 1;
return &buf->dri2;
err:
if (pixmap)
pScreen->DestroyPixmap(pixmap);
return NULL;
}
示例4: rdpRRScreenSetSize
Bool
rdpRRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
CARD32 mmWidth, CARD32 mmHeight)
{
PixmapPtr screenPixmap;
BoxRec box;
ErrorF("rdpRRScreenSetSize: width %d height %d mmWidth %d mmHeight %d\n",
width, height, (int)mmWidth, (int)mmHeight);
if ((width < 1) || (height < 1))
{
ErrorF(" error width %d height %d\n", width, height);
return FALSE;
}
g_rdpScreen.width = width;
g_rdpScreen.height = height;
g_rdpScreen.paddedWidthInBytes =
PixmapBytePad(g_rdpScreen.width, g_rdpScreen.depth);
g_rdpScreen.sizeInBytes =
g_rdpScreen.paddedWidthInBytes * g_rdpScreen.height;
pScreen->width = width;
pScreen->height = height;
pScreen->mmWidth = mmWidth;
pScreen->mmHeight = mmHeight;
screenPixmap = pScreen->GetScreenPixmap(pScreen);
if (screenPixmap != 0)
{
ErrorF(" resizing screenPixmap [%p] to %dx%d, currently at %dx%d\n",
(void *)screenPixmap, width, height,
screenPixmap->drawable.width, screenPixmap->drawable.height);
pScreen->ModifyPixmapHeader(screenPixmap, width, height,
g_rdpScreen.depth, g_rdpScreen.bitsPerPixel,
g_rdpScreen.paddedWidthInBytes,
g_rdpScreen.pfbMemory);
ErrorF(" pixmap resized to %dx%d\n",
screenPixmap->drawable.width, screenPixmap->drawable.height);
}
DEBUG_OUT((" root window %p\n", (void *)pScreen->root));
box.x1 = 0;
box.y1 = 0;
box.x2 = width;
box.y2 = height;
RegionInit(&pScreen->root->winSize, &box, 1);
RegionInit(&pScreen->root->borderSize, &box, 1);
RegionReset(&pScreen->root->borderClip, &box);
RegionBreak(&pScreen->root->clipList);
pScreen->root->drawable.width = width;
pScreen->root->drawable.height = height;
ResizeChildrenWinSize(pScreen->root, 0, 0, 0, 0);
RRGetInfo(pScreen, 1);
rdpInvalidateArea(g_pScreen, 0, 0, g_rdpScreen.width, g_rdpScreen.height);
ErrorF(" screen resized to %dx%d\n",
pScreen->width, pScreen->height);
return TRUE;
}
示例5: glamor_egl_close_screen
static Bool
glamor_egl_close_screen(ScreenPtr screen)
{
ScrnInfoPtr scrn;
struct glamor_egl_screen_private *glamor_egl;
PixmapPtr screen_pixmap;
EGLImageKHR back_image;
scrn = xf86ScreenToScrn(screen);
glamor_egl = glamor_egl_get_screen_private(scrn);
screen_pixmap = screen->GetScreenPixmap(screen);
eglDestroyImageKHR(glamor_egl->display,glamor_egl->front_image);
dixSetPrivate(&screen_pixmap->devPrivates, glamor_egl_pixmap_private_key,
NULL);
glamor_egl->front_image = NULL;
if (glamor_egl->back_pixmap && *glamor_egl->back_pixmap) {
back_image = dixLookupPrivate(&(*glamor_egl->back_pixmap)->devPrivates,
glamor_egl_pixmap_private_key);
if (back_image != NULL && back_image != EGL_NO_IMAGE_KHR) {
eglDestroyImageKHR(glamor_egl->display, back_image);
dixSetPrivate(&(*glamor_egl->back_pixmap)->devPrivates,
glamor_egl_pixmap_private_key, NULL);
}
}
screen->CloseScreen = glamor_egl->saved_close_screen;
return screen->CloseScreen(screen);
}
示例6: glWinCopyWindow
void
glWinCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
ScreenPtr pScreen = pWindow->drawable.pScreen;
glWinScreenRec *screenPriv = &glWinScreens[pScreen->myNum];
__GLXdrawablePrivate *glxPriv;
/* Check if the window is attached and discard any drawing request */
glxPriv = __glXFindDrawablePrivate(pWindow->drawable.id);
if (glxPriv) {
__GLXcontext *gx;
/* GL contexts bound to this window for drawing */
for (gx = glxPriv->drawGlxc; gx != NULL; gx = gx->next) {
/*
GLWIN_DEBUG_MSG("glWinCopyWindow - calling glDrawBuffer\n");
glDrawBuffer(GL_FRONT);
*/
return;
}
/* GL contexts bound to this window for reading */
for (gx = glxPriv->readGlxc; gx != NULL; gx = gx->next) {
return;
}
}
GLWIN_DEBUG_MSG("glWinCopyWindow - passing to hw layer\n");
pScreen->CopyWindow = screenPriv->CopyWindow;
pScreen->CopyWindow(pWindow, ptOldOrg, prgnSrc);
pScreen->CopyWindow = glWinCopyWindow;
}
示例7: ExaSrcValidate
static void
ExaSrcValidate(DrawablePtr pDrawable,
int x,
int y,
int width,
int height)
{
ScreenPtr pScreen = pDrawable->pScreen;
ExaScreenPriv(pScreen);
PixmapPtr pPix = exaGetDrawablePixmap (pDrawable);
BoxRec box;
RegionRec reg;
RegionPtr dst;
int xoff, yoff;
exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff);
box.x1 = x + xoff;
box.y1 = y + yoff;
box.x2 = box.x1 + width;
box.y2 = box.y1 + height;
dst = (pExaScr->srcPix == pPix) ? &pExaScr->srcReg :
&pExaScr->maskReg;
REGION_INIT(pScreen, ®, &box, 1);
REGION_UNION(pScreen, dst, dst, ®);
REGION_UNINIT(pScreen, ®);
if (pExaScr->SavedSourceValidate) {
swap(pExaScr, pScreen, SourceValidate);
pScreen->SourceValidate(pDrawable, x, y, width, height);
swap(pExaScr, pScreen, SourceValidate);
}
}
示例8: rdpRealizeWindow
Bool
rdpRealizeWindow(WindowPtr pWindow)
{
ScreenPtr pScreen;
rdpWindowRec *priv;
Bool rv;
LLOGLN(10, ("rdpRealizeWindow:"));
priv = GETWINPRIV(pWindow);
pScreen = pWindow->drawable.pScreen;
pScreen->RealizeWindow = g_rdpScreen.RealizeWindow;
rv = pScreen->RealizeWindow(pWindow);
pScreen->RealizeWindow = rdpRealizeWindow;
if (g_use_rail)
{
if ((pWindow != g_invalidate_window) && (pWindow->parent != 0))
{
if (XR_IS_ROOT(pWindow->parent))
{
LLOGLN(10, ("rdpRealizeWindow:"));
LLOGLN(10, (" pWindow %p id 0x%x pWindow->parent %p id 0x%x x %d "
"y %d width %d height %d",
pWindow, (int)(pWindow->drawable.id),
pWindow->parent, (int)(pWindow->parent->drawable.id),
pWindow->drawable.x, pWindow->drawable.y,
pWindow->drawable.width, pWindow->drawable.height));
priv->status = 1;
rdpup_create_window(pWindow, priv);
}
}
}
return rv;
}
示例9: rdpUnrealizeWindow
Bool
rdpUnrealizeWindow(WindowPtr pWindow)
{
ScreenPtr pScreen;
rdpWindowRec *priv;
Bool rv;
LLOGLN(10, ("rdpUnrealizeWindow:"));
priv = GETWINPRIV(pWindow);
pScreen = pWindow->drawable.pScreen;
pScreen->UnrealizeWindow = g_rdpScreen.UnrealizeWindow;
rv = pScreen->UnrealizeWindow(pWindow);
pScreen->UnrealizeWindow = rdpUnrealizeWindow;
if (g_use_rail)
{
if (priv->status == 1)
{
LLOGLN(10, ("rdpUnrealizeWindow:"));
priv->status = 0;
rdpup_delete_window(pWindow, priv);
}
}
return rv;
}
示例10: rdpPositionWindow
Bool
rdpPositionWindow(WindowPtr pWindow, int x, int y)
{
ScreenPtr pScreen;
rdpWindowRec *priv;
Bool rv;
LLOGLN(10, ("rdpPositionWindow:"));
priv = GETWINPRIV(pWindow);
pScreen = pWindow->drawable.pScreen;
pScreen->PositionWindow = g_rdpScreen.PositionWindow;
rv = pScreen->PositionWindow(pWindow, x, y);
pScreen->PositionWindow = rdpPositionWindow;
if (g_use_rail)
{
if (priv->status == 1)
{
LLOGLN(10, ("rdpPositionWindow:"));
LLOGLN(10, (" x %d y %d", x, y));
}
}
return rv;
}
示例11: rdpDestroyPixmap
Bool
rdpDestroyPixmap(PixmapPtr pPixmap)
{
Bool rv;
ScreenPtr pScreen;
rdpPixmapRec *priv;
LLOGLN(10, ("rdpDestroyPixmap:"));
priv = GETPIXPRIV(pPixmap);
LLOGLN(10, ("status %d refcnt %d", priv->status, pPixmap->refcnt));
if (pPixmap->refcnt < 2)
{
if (XRDP_IS_OS(priv))
{
rdpup_remove_os_bitmap(priv->rdpindex);
rdpup_delete_os_surface(priv->rdpindex);
draw_item_remove_all(priv);
}
}
pScreen = pPixmap->drawable.pScreen;
pScreen->DestroyPixmap = g_rdpScreen.DestroyPixmap;
rv = pScreen->DestroyPixmap(pPixmap);
pScreen->DestroyPixmap = rdpDestroyPixmap;
return rv;
}
示例12: vfbCloseScreen
vfbCloseScreen(ScreenPtr pScreen)
#endif
{
#if XORG < 113
vfbScreenInfoPtr pvfb = &vfbScreens[index];
#else
vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
#endif
int i;
pScreen->CloseScreen = pvfb->closeScreen;
/*
* XXX probably lots of stuff to clean. For now,
* clear installed colormaps so that server reset works correctly.
*/
#if XORG < 113
for (i = 0; i < MAXSCREENS; i++)
InstalledMaps[i] = NULL;
return pScreen->CloseScreen(index, pScreen);
#else
for (i = 0; i < screenInfo.numScreens; i++)
SetInstalledColormap(screenInfo.screens[i], NULL);
/*
* fb overwrites miCloseScreen, so do this here
*/
if (pScreen->devPrivate)
(*pScreen->DestroyPixmap) ((PixmapPtr) pScreen->devPrivate);
pScreen->devPrivate = NULL;
return pScreen->CloseScreen(pScreen);
#endif
}
示例13: radeon_glamor_set_shared_pixmap_backing
static Bool
radeon_glamor_set_shared_pixmap_backing(PixmapPtr pixmap, void *handle)
{
ScreenPtr screen = pixmap->drawable.pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
struct radeon_surface surface;
struct radeon_pixmap *priv;
if (!radeon_set_shared_pixmap_backing(pixmap, handle, &surface))
return FALSE;
priv = radeon_get_pixmap_private(pixmap);
priv->surface = surface;
if (!radeon_glamor_create_textured_pixmap(pixmap, priv)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Failed to get PRIME drawable for glamor pixmap.\n");
return FALSE;
}
screen->ModifyPixmapHeader(pixmap,
pixmap->drawable.width,
pixmap->drawable.height,
0, 0, 0, NULL);
return TRUE;
}
示例14: rdpCreatePixmap
PixmapPtr
rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
unsigned usage_hint)
{
PixmapPtr rv;
rdpPixmapRec* priv;
int org_width;
org_width = width;
/* width must be a multiple of 4 in rdp */
width = (width + 3) & ~3;
LLOGLN(10, ("rdpCreatePixmap: width %d org_width %d", width, org_width));
pScreen->CreatePixmap = g_rdpScreen.CreatePixmap;
rv = pScreen->CreatePixmap(pScreen, width, height, depth, usage_hint);
priv = GETPIXPRIV(rv);
priv->rdpindex = -1;
if ((rv->drawable.depth == g_rdpScreen.depth) &&
(org_width > 1) && (height > 1))
{
priv->allocBytes = width * height * g_Bpp;
priv->rdpindex = rdpup_add_os_bitmap(rv, priv);
if (priv->rdpindex >= 0)
{
priv->status = 1;
rdpup_create_os_surface(priv->rdpindex, width, height);
}
}
pScreen->ModifyPixmapHeader(rv, org_width, 0, 0, 0, 0, 0);
pScreen->CreatePixmap = rdpCreatePixmap;
return rv;
}
示例15: MSMDRI2DestroyBuffer
/**
* Destroy Buffer
*/
static void
MSMDRI2DestroyBuffer(DrawablePtr pDraw, DRI2BufferPtr buffer)
{
MSMDRI2BufferPtr buf = MSMBUF(buffer);
ScreenPtr pScreen = buf->pPixmap->drawable.pScreen;
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
if (--buf->refcnt)
return;
DEBUG_MSG("pDraw=%p, buffer=%p, attachment=%d",
pDraw, buffer, buffer->attachment);
/* if drawable has already gone away, 3rd buf is cleaned
* up in MSMDRI2DrawableGone()
*/
if ((buffer->attachment == DRI2BufferBackLeft) && pDraw) {
MSMDRI2DrawablePtr pPriv = MSMDRI2GetDrawable(pDraw);
if (pPriv->pThirdBuffer) {
MSMDRI2DestroyBuffer(pDraw, pPriv->pThirdBuffer);
pPriv->pThirdBuffer = NULL;
}
}
pScreen->DestroyPixmap(buf->pPixmap);
free(buf);
}