当前位置: 首页>>代码示例>>C++>>正文


C++ ScreenPtr::GetWindowPixmap方法代码示例

本文整理汇总了C++中ScreenPtr::GetWindowPixmap方法的典型用法代码示例。如果您正苦于以下问题:C++ ScreenPtr::GetWindowPixmap方法的具体用法?C++ ScreenPtr::GetWindowPixmap怎么用?C++ ScreenPtr::GetWindowPixmap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ScreenPtr的用法示例。


在下文中一共展示了ScreenPtr::GetWindowPixmap方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

static inline Bool
canexchange(DrawablePtr pDraw, struct armsoc_bo *src_bo, struct armsoc_bo *dst_bo)
{
	Bool ret = FALSE;
	ScreenPtr pScreen = pDraw->pScreen;
	PixmapPtr pRootPixmap, pWindowPixmap;
	int src_fb_id, dst_fb_id;

	pRootPixmap = pScreen->GetWindowPixmap(pScreen->root);
	pWindowPixmap = pDraw->type == DRAWABLE_PIXMAP ? (PixmapPtr)pDraw : pScreen->GetWindowPixmap((WindowPtr)pDraw);

	src_fb_id = armsoc_bo_get_fb(src_bo);
	dst_fb_id = armsoc_bo_get_fb(dst_bo);

	if (pRootPixmap != pWindowPixmap &&
	    armsoc_bo_width(src_bo) == armsoc_bo_width(dst_bo) &&
	    armsoc_bo_height(src_bo) == armsoc_bo_height(dst_bo) &&
	    armsoc_bo_bpp(src_bo) == armsoc_bo_bpp(dst_bo) &&
	    armsoc_bo_width(src_bo) == pDraw->width &&
	    armsoc_bo_height(src_bo) == pDraw->height &&
	    armsoc_bo_bpp(src_bo) == pDraw->bitsPerPixel &&
	    src_fb_id == 0 && dst_fb_id == 0) {
		ret = TRUE;
	}

	return ret;
}
开发者ID:freedesktop-unofficial-mirror,项目名称:xorg__driver__xf86-video-armsoc,代码行数:27,代码来源:armsoc_dri2.c

示例2: exaGetDrawableDeltas

void
ExaCheckCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
    DrawablePtr pDrawable = &pWin->drawable;
    ScreenPtr pScreen = pDrawable->pScreen;

    EXA_PRE_FALLBACK(pScreen);
    EXA_FALLBACK(("from %p\n", pWin));

    /* Only need the source bits, the destination region will be overwritten */
    if (pExaScr->prepare_access_reg) {
        PixmapPtr pPixmap = pScreen->GetWindowPixmap(pWin);
        int xoff, yoff;

        exaGetDrawableDeltas(&pWin->drawable, pPixmap, &xoff, &yoff);
        RegionTranslate(prgnSrc, xoff, yoff);
        pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, prgnSrc);
        RegionTranslate(prgnSrc, -xoff, -yoff);
    }
    else
        exaPrepareAccess(pDrawable, EXA_PREPARE_SRC);

    swap(pExaScr, pScreen, CopyWindow);
    pScreen->CopyWindow(pWin, ptOldOrg, prgnSrc);
    swap(pExaScr, pScreen, CopyWindow);
    exaFinishAccess(pDrawable, EXA_PREPARE_SRC);
    EXA_POST_FALLBACK(pScreen);
}
开发者ID:MrKepzie,项目名称:xserver,代码行数:28,代码来源:exa_unaccel.c

示例3:

static unsigned long
DRI2DrawableSerial(DrawablePtr pDraw)
{
    ScreenPtr pScreen = pDraw->pScreen;
    PixmapPtr pPix;

    if (pDraw->type != DRAWABLE_WINDOW)
        return pDraw->serialNumber;

    pPix = pScreen->GetWindowPixmap((WindowPtr) pDraw);
    return pPix->drawable.serialNumber;
}
开发者ID:csulmone,项目名称:X11,代码行数:12,代码来源:dri2.c

示例4: calloc

static DRI2Buffer2Ptr MaliDRI2CreateBuffer(DrawablePtr  pDraw,
        unsigned int attachment,
        unsigned int format)
{
    ScreenPtr                pScreen  = pDraw->pScreen;
    ScrnInfoPtr              pScrn    = xf86Screens[pScreen->myNum];
    PixmapPtr                pPixmap  = NULL;
    DRI2Buffer2Ptr           buffer   = calloc(1, sizeof *buffer);
    MaliDRI2BufferPrivatePtr privates = calloc(1, sizeof *privates);
    ump_handle               handle;
    size_t                   size;

    if (pDraw->type == DRAWABLE_WINDOW) {
        pPixmap = pScreen->GetWindowPixmap((WindowPtr)pDraw);
    } else {
        ErrorF("Unexpected pDraw->type (%d) in MaliDRI2CreateBuffer\n", pDraw->type);
        return NULL;
    }

    /* initialize buffer info to default values */
    buffer->attachment    = attachment;
    buffer->driverPrivate = privates;
    buffer->format        = format;
    buffer->flags         = 0;
    buffer->cpp           = pPixmap->drawable.bitsPerPixel / 8;
    buffer->pitch         = PixmapBytePad(pDraw->width, pDraw->depth);

    /* allocate UMP buffer */
    size   = pDraw->height * buffer->pitch;
    handle = ump_ref_drv_allocate(size, UMP_REF_DRV_CONSTRAINT_PHYSICALLY_LINEAR |
                                  UMP_REF_DRV_CONSTRAINT_USE_CACHE);
    if (handle == UMP_INVALID_MEMORY_HANDLE) {
        ErrorF("invalid UMP handle, bufsize=%d\n", (int)size);
    }

    privates->size   = size;
    privates->handle = handle;
    privates->addr   = ump_mapped_pointer_get(handle);
    privates->width  = pDraw->width;
    privates->height = pDraw->height;
    privates->depth  = pDraw->depth;

    buffer->name     = ump_secure_id_get(handle);
    buffer->flags    = 0; /* offset */

//    ErrorF("MaliDRI2CreateBuffer attachment=%d %p, format=%d, cpp=%d, depth=%d\n",
//           attachment, buffer, format, buffer->cpp, privates->depth);
    return buffer;
}
开发者ID:Galland,项目名称:xf86-video-fbdev,代码行数:49,代码来源:mali_dri2.c

示例5: FBDEVPTR

static DRI2Buffer2Ptr MaliDRI2CreateBuffer(DrawablePtr  pDraw,
                                           unsigned int attachment,
                                           unsigned int format)
{
    ScreenPtr                pScreen  = pDraw->pScreen;
    ScrnInfoPtr              pScrn    = xf86Screens[pScreen->myNum];
    DRI2Buffer2Ptr           buffer;
    MaliDRI2BufferPrivatePtr privates;
    ump_handle               handle;
    FBDevPtr pMxv = FBDEVPTR(pScrn);
    Rk30MaliPtr rk_3d = pMxv->Rk30Mali;
    OvlHWPtr overlay = pMxv->OvlHW;
    Bool                     can_use_overlay = TRUE;
    PixmapPtr                pWindowPixmap;

    if (pDraw->type == DRAWABLE_WINDOW &&
        (pWindowPixmap = pScreen->GetWindowPixmap((WindowPtr)pDraw)))
    {
        DebugMsg("win=%p (w=%d, h=%d, x=%d, y=%d) has backing pix=%p (w=%d, h=%d, screen_x=%d, screen_y=%d)\n",
                 pDraw, pDraw->width, pDraw->height, pDraw->x, pDraw->y,
                 pWindowPixmap, pWindowPixmap->drawable.width, pWindowPixmap->drawable.height,
                 pWindowPixmap->screen_x, pWindowPixmap->screen_y);
    }

    if(attachment != DRI2BufferBackLeft && rk_3d->buf_back != NULL){
	DebugMsg("DRI2 return NullBuffer\n");
	return rk_3d->buf_back;
    }

    if (!(buffer = calloc(1, sizeof *buffer))) {
        ErrorF("MaliDRI2CreateBuffer: calloc failed\n");
        return NULL;
    }


    /* If it is a pixmap, just migrate this pixmap to UMP buffer */
    if (pDraw->type == DRAWABLE_PIXMAP)
    {
        if (!(privates = MigratePixmapToUMP((PixmapPtr)pDraw))) {
            ErrorF("MaliDRI2CreateBuffer: MigratePixmapToUMP failed\n");
            free(buffer);
            return NULL;
        }
        privates->refcount++;
        buffer->attachment    = attachment;
        buffer->driverPrivate = privates;
        buffer->format        = format;
        buffer->flags         = 0;
        buffer->cpp           = pDraw->bitsPerPixel / 8;
        buffer->pitch         = ((PixmapPtr)pDraw)->devKind;
        buffer->name = ump_secure_id_get(privates->handle);

        DebugMsg("DRI2CreateBuffer pix=%p, buf=%p:%p, att=%d, ump=%d:%d, w=%d, h=%d, cpp=%d, depth=%d\n",
                 pDraw, buffer, privates, attachment, buffer->name, buffer->flags,
                 privates->width, privates->height, buffer->cpp, privates->depth);

        return buffer;
    }

    /* The drawable must be a window for using hardware overlays */
    if (pDraw->type != DRAWABLE_WINDOW){
        ErrorF("Unexpected pDraw->type (%d) in MaliDRI2CreateBuffer\n", pDraw->type);
        return NULL;
    }

    if (!(privates = calloc(1, sizeof *privates))) {
        ErrorF("MaliDRI2CreateBuffer: calloc failed\n");
        free(buffer);
        return NULL;
    }

    /* We could not get framebuffer secure id */
    if (rk_3d->ump_fb_secure_id1 == UMP_INVALID_SECURE_ID)
        can_use_overlay = FALSE;

    /* Overlay is already used by a different window */
    if (rk_3d->pOverlayWin && rk_3d->pOverlayWin != (void *)pDraw)
        can_use_overlay = FALSE;

    /* TODO: try to support other color depths later */
    if (pDraw->bitsPerPixel != 32)
        can_use_overlay = FALSE;

    /* The default common values */
    buffer->attachment    = attachment;
    buffer->driverPrivate = privates;
    buffer->format        = format;
    buffer->flags         = 0;
    buffer->cpp           = pDraw->bitsPerPixel / 8;
    /* Stride must be 8 bytes aligned for Mali400 */
//    buffer->pitch         = ((buffer->cpp * pDraw->width + 7) / 8) * 8;
    buffer->pitch         = ((buffer->cpp * overlay->cur_var.xres_virtual + 7) / 8) * 8;
    privates->size     = pDraw->height * buffer->pitch;
    privates->width    = pDraw->width;
    privates->height   = pDraw->height;
    privates->depth    = pDraw->depth;

/*    if (disp && disp->framebuffer_size - disp->gfx_layer_size < privates->size) {
        DebugMsg("Not enough space in the offscreen framebuffer (wanted %d for DRI2)\n",
                 privates->size);
//.........这里部分代码省略.........
开发者ID:davidftv,项目名称:xf86-video-fbdev,代码行数:101,代码来源:mali_dri2.c


注:本文中的ScreenPtr::GetWindowPixmap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。