Lines Matching refs:pGlxPixmap
59 static void stubXshmUpdateImageRect(Display *dpy, GLXDrawable draw, GLX_Pixmap_t *pGlxPixmap, XRectangle *pRect);
641 GLX_Pixmap_t *pGlxPixmap;
649 GLX_Pixmap_t *pGlxPixmap = (GLX_Pixmap_t *) crHashtableSearch(pCtx->pGLXPixmapsHash, (unsigned int) pParms->draw);
651 if (pGlxPixmap)
654 pParms->pGlxPixmap = pGlxPixmap;
669 GLX_Pixmap_t *pGlxPixmap = (GLX_Pixmap_t *) crHashtableSearch(stub.pGLXPixmapsHash, (unsigned int) drawable);
671 if (!pGlxPixmap)
674 parms.pGlxPixmap = NULL;
677 pGlxPixmap = parms.pGlxPixmap;
680 if (pGlxPixmap)
1618 GLX_Pixmap_t *pGlxPixmap;
1646 pGlxPixmap = crCalloc(sizeof(GLX_Pixmap_t));
1647 if (!pGlxPixmap)
1660 pGlxPixmap->format = pVis->depth==24 ? GL_RGB:GL_RGBA;
1661 pGlxPixmap->target = GL_TEXTURE_2D;
1674 pGlxPixmap->format = GL_RGBA;
1677 pGlxPixmap->format = GL_RGB;
1688 pGlxPixmap->target = GL_TEXTURE_2D;
1691 pGlxPixmap->target = GL_TEXTURE_RECTANGLE_NV;
1702 crHashtableAdd(stub.pGLXPixmapsHash, (unsigned int) pixmap, pGlxPixmap);
1758 parms.pGlxPixmap = NULL;
1763 if (!parms.pGlxPixmap)
1770 if (parms.pGlxPixmap->gc)
1772 XFreeGC(dpy, parms.pGlxPixmap->gc);
1775 if (parms.pGlxPixmap->hShmPixmap>0)
1777 XFreePixmap(dpy, parms.pGlxPixmap->hShmPixmap);
1781 if (parms.pGlxPixmap->hDamage>0)
1783 //crDebug("Destroy: Damage for drawable 0x%x, handle 0x%x", (unsigned int) pixmap, (unsigned int) parms.pGlxPixmap->damage);
1784 XDamageDestroy(dpy, parms.pGlxPixmap->hDamage);
1787 if (parms.pGlxPixmap->pDamageRegion)
1789 XDestroyRegion(parms.pGlxPixmap->pDamageRegion);
2196 static void stubFetchDamageOnDrawable(Display *dpy, GLX_Pixmap_t *pGlxPixmap)
2198 Damage damage = pGlxPixmap->hDamage;
2220 if (pGlxPixmap->pDamageRegion)
2223 if (!pGlxPixmap->bPixmapImageDirty || !XEmptyRegion(pGlxPixmap->pDamageRegion))
2228 if (CR_MAX_DAMAGE_REGIONS_TRACKED <= pGlxPixmap->pDamageRegion->numRects)
2231 EMPTY_REGION(pGlxPixmap->pDamageRegion);
2236 XUnionRectWithRegion(&returnRects[i], pGlxPixmap->pDamageRegion, pGlxPixmap->pDamageRegion);
2244 pGlxPixmap->bPixmapImageDirty = True;
2287 GLX_Pixmap_t *pGlxPixmap;
2303 pGlxPixmap = crAlloc(sizeof(GLX_Pixmap_t));
2304 if (!pGlxPixmap)
2311 pGlxPixmap->x = x;
2312 pGlxPixmap->y = y;
2313 pGlxPixmap->w = w;
2314 pGlxPixmap->h = h;
2315 pGlxPixmap->border = border;
2316 pGlxPixmap->depth = depth;
2317 pGlxPixmap->root = root;
2318 pGlxPixmap->format = pCreateInfoPixmap->format;
2319 pGlxPixmap->target = pCreateInfoPixmap->target;
2334 pGlxPixmap->gc = XCreateGC(dpy, (Pixmap)draw, GCGraphicsExposures|GCSubwindowMode, &xgcv);
2336 pGlxPixmap->hShmPixmap = XShmCreatePixmap(dpy, pGlxPixmap->root, stub.xshmSI.shmaddr, &stub.xshmSI,
2337 pGlxPixmap->w, pGlxPixmap->h, pGlxPixmap->depth);
2341 pGlxPixmap->gc = NULL;
2342 pGlxPixmap->hShmPixmap = 0;
2349 pGlxPixmap->hDamage = XDamageCreate(dpy, (Pixmap)draw, XDamageReportNonEmpty);
2351 (unsigned int) draw, (unsigned int) pGlxPixmap->damage, (int) XDamageReportRawRectangles);*/
2352 pGlxPixmap->pDamageRegion = XCreateRegion();
2353 if (!pGlxPixmap->pDamageRegion)
2359 pGlxPixmap->bPixmapImageDirty = True;
2363 pGlxPixmap->hDamage = 0;
2364 pGlxPixmap->pDamageRegion = NULL;
2370 if (CR_MAX_TRANSFER_SIZE < 4*pGlxPixmap->w*pGlxPixmap->h)
2372 stub.spu->dispatch_table.TexImage2D(pGlxPixmap->target, 0, pGlxPixmap->format, pGlxPixmap->w, pGlxPixmap->h, 0,
2376 crHashtableAdd(pContext->pGLXPixmapsHash, (unsigned int) draw, pGlxPixmap);
2379 return pGlxPixmap;
2382 static void stubXshmUpdateWholeImage(Display *dpy, GLXDrawable draw, GLX_Pixmap_t *pGlxPixmap)
2389 if (CR_MAX_TRANSFER_SIZE < 4*pGlxPixmap->w*pGlxPixmap->h)
2393 rect.x = pGlxPixmap->x;
2394 rect.y = pGlxPixmap->y;
2395 rect.width = pGlxPixmap->w;
2396 rect.height = CR_MAX_TRANSFER_SIZE/(4*pGlxPixmap->w);
2399 pGlxPixmap->x, pGlxPixmap->y, pGlxPixmap->w, pGlxPixmap->h, rect.height);*/
2401 for (; (rect.y+rect.height)<=(pGlxPixmap->y+pGlxPixmap->h); rect.y+=rect.height)
2403 stubXshmUpdateImageRect(dpy, draw, pGlxPixmap, &rect);
2406 if (rect.y!=(pGlxPixmap->y+pGlxPixmap->h))
2408 rect.height=pGlxPixmap->h-rect.y;
2409 stubXshmUpdateImageRect(dpy, draw, pGlxPixmap, &rect);
2417 XCopyArea(dpy, (Pixmap)draw, pGlxPixmap->hShmPixmap, pGlxPixmap->gc,
2418 pGlxPixmap->x, pGlxPixmap->y, pGlxPixmap->w, pGlxPixmap->h, 0, 0);
2425 stub.spu->dispatch_table.TexImage2D(pGlxPixmap->target, 0, pGlxPixmap->format, pGlxPixmap->w, pGlxPixmap->h, 0,
2429 (unsigned int) draw, (unsigned int)pGlxPixmap->hDamage,
2430 pGlxPixmap->x, pGlxPixmap->y, pGlxPixmap->w, pGlxPixmap->h);*/
2434 static void stubXshmUpdateImageRect(Display *dpy, GLXDrawable draw, GLX_Pixmap_t *pGlxPixmap, XRectangle *pRect)
2451 stubXshmUpdateImageRect(dpy, draw, pGlxPixmap, &rect);
2457 stubXshmUpdateImageRect(dpy, draw, pGlxPixmap, &rect);
2465 XCopyArea(dpy, (Pixmap)draw, pGlxPixmap->hShmPixmap, pGlxPixmap->gc,
2473 if (pRect->width!=pGlxPixmap->w)
2475 stub.spu->dispatch_table.PixelStorei(GL_UNPACK_ROW_LENGTH, pGlxPixmap->w);
2477 stub.spu->dispatch_table.TexSubImage2D(pGlxPixmap->target, 0, pRect->x, pRect->y, pRect->width, pRect->height,
2482 (unsigned int) draw, (unsigned int)pGlxPixmap->hDamage,
2515 GLX_Pixmap_t *pGlxPixmap;
2523 pGlxPixmap = (GLX_Pixmap_t *) crHashtableSearch(context->pGLXPixmapsHash, (unsigned int) draw);
2524 if (!pGlxPixmap)
2526 pGlxPixmap = (GLX_Pixmap_t *) crHashtableSearch(stub.pGLXPixmapsHash, (unsigned int) draw);
2527 if (!pGlxPixmap)
2532 pGlxPixmap = stubInitGlxPixmap(pGlxPixmap, dpy, draw, context);
2533 if (!pGlxPixmap)
2535 crDebug("glXBindTexImageEXT failed to get pGlxPixmap");
2548 stubFetchDamageOnDrawable(dpy, pGlxPixmap);
2559 pxim = XGetImage(dpy, (Pixmap)draw, pGlxPixmap->x, pGlxPixmap->y, pGlxPixmap->w, pGlxPixmap->h, AllPlanes, ZPixmap);
2588 stub.spu->dispatch_table.TexImage2D(pGlxPixmap->target, 0, pGlxPixmap->format, pxim->width, pxim->height, 0,
2598 if (pGlxPixmap->bPixmapImageDirty)
2601 if (!pGlxPixmap->pDamageRegion || XEmptyRegion(pGlxPixmap->pDamageRegion))
2604 stubXshmUpdateWholeImage(dpy, draw, pGlxPixmap);
2611 fullArea = pGlxPixmap->w * pGlxPixmap->h;
2612 XClipBox(pGlxPixmap->pDamageRegion, &damageClipBox);
2615 //crDebug("FullSize [%i,%i,%i,%i]", pGlxPixmap->x, pGlxPixmap->y, pGlxPixmap->w, pGlxPixmap->h);
2618 for (i=0; i<pGlxPixmap->pDamageRegion->numRects; ++i)
2620 BoxPtr pBox = &pGlxPixmap->pDamageRegion->rects[i];
2629 (unsigned int)draw, pGlxPixmap->pDamageRegion->numRects, fullArea, clipdamageArea, damageArea);*/
2630 stubXshmUpdateWholeImage(dpy, draw, pGlxPixmap);
2637 (unsigned int)draw, pGlxPixmap->pDamageRegion->numRects, fullArea, clipdamageArea, damageArea);*/
2638 stubXshmUpdateWholeImage(dpy, draw, pGlxPixmap);
2643 (unsigned int)draw, pGlxPixmap->pDamageRegion->numRects, fullArea, clipdamageArea, damageArea);*/
2644 stubXshmUpdateImageRect(dpy, draw, pGlxPixmap, &damageClipBox);
2649 (unsigned int)draw, pGlxPixmap->pDamageRegion->numRects, fullArea, clipdamageArea, damageArea);*/
2650 for (i=0; i<pGlxPixmap->pDamageRegion->numRects; ++i)
2653 BoxPtr pBox = &pGlxPixmap->pDamageRegion->rects[i];
2660 stubXshmUpdateImageRect(dpy, draw, pGlxPixmap, &rect);
2667 pGlxPixmap->bPixmapImageDirty = False;
2668 if (pGlxPixmap->pDamageRegion)
2669 EMPTY_REGION(pGlxPixmap->pDamageRegion);
2674 stubXshmUpdateWholeImage(dpy, draw, pGlxPixmap);