* the drawable is not associated with a direct-rendering context.
*/
_X_HIDDEN __GLXDRIdrawable *
-GetGLXDRIDrawable(Display * dpy, GLXDrawable drawable, int *const scrn_num)
+GetGLXDRIDrawable(Display * dpy, GLXDrawable drawable)
{
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
__GLXDRIdrawable *pdraw;
if (priv == NULL)
return NULL;
- if (__glxHashLookup(priv->drawHash, drawable, (void *) &pdraw) == 0) {
- if (scrn_num != NULL)
- *scrn_num = pdraw->psc->scr;
+ if (__glxHashLookup(priv->drawHash, drawable, (void *) &pdraw) == 0)
return pdraw;
- }
return NULL;
}
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
{
__GLXdisplayPrivate *const priv = __glXInitialize(dpy);
- __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, glxpixmap, NULL);
+ __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, glxpixmap);
if (pdraw != NULL) {
(*pdraw->destroyDrawable) (pdraw);
#endif
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
- __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
+ __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
if (pdraw != NULL) {
glFlush();
#ifdef GLX_DIRECT_RENDERING
if (gc->driContext && psc->driScreen && psc->driScreen->setSwapInterval) {
- __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(gc->currentDpy,
- gc->currentDrawable,
- NULL);
+ __GLXDRIdrawable *pdraw =
+ GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
psc->driScreen->setSwapInterval(pdraw, interval);
return 0;
}
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
if (psc->driScreen && psc->driScreen->setSwapInterval) {
- __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(gc->currentDpy,
- gc->currentDrawable, NULL);
+ __GLXDRIdrawable *pdraw =
+ GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
return psc->driScreen->setSwapInterval(pdraw, interval);
}
}
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
if (psc->driScreen && psc->driScreen->getSwapInterval) {
- __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(gc->currentDpy,
- gc->currentDrawable, NULL);
+ __GLXDRIdrawable *pdraw =
+ GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
return psc->driScreen->getSwapInterval(pdraw);
}
}
psc = GetGLXScreenConfigs(gc->currentDpy, gc->screen);
#ifdef GLX_DIRECT_RENDERING
- pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
+ pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
#endif
/* FIXME: Looking at the GLX_SGI_video_sync spec in the extension registry,
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
#ifdef GLX_DIRECT_RENDERING
- pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable, NULL);
+ pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
#endif
#ifdef GLX_DIRECT_RENDERING
int64_t * ust, int64_t * msc, int64_t * sbc)
{
__GLXdisplayPrivate * const priv = __glXInitialize(dpy);
- int i, ret;
+ int ret;
#ifdef GLX_DIRECT_RENDERING
__GLXDRIdrawable *pdraw;
#endif
return False;
#ifdef GLX_DIRECT_RENDERING
- pdraw = GetGLXDRIDrawable(dpy, drawable, &i);
- psc = priv->screenConfigs[i];
- if (pdraw && psc && psc->driScreen && psc->driScreen->getDrawableMSC) {
+ pdraw = GetGLXDRIDrawable(dpy, drawable);
+ psc = pdraw ? pdraw->psc : NULL;
+ if (pdraw && psc->driScreen->getDrawableMSC) {
ret = psc->driScreen->getDrawableMSC(psc, pdraw, ust, msc, sbc);
return ret;
}
int32_t * numerator, int32_t * denominator)
{
#if defined( GLX_DIRECT_RENDERING ) && defined( XF86VIDMODE )
- __GLXDRIdrawable *draw = GetGLXDRIDrawable(dpy, drawable, NULL);
+ __GLXDRIdrawable *draw = GetGLXDRIDrawable(dpy, drawable);
if (draw == NULL)
return False;
int64_t target_msc, int64_t divisor, int64_t remainder)
{
GLXContext gc = __glXGetCurrentContext();
- int screen;
#ifdef GLX_DIRECT_RENDERING
- __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
+ __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
+ __GLXscreenConfigs *psc = pdraw ? pdraw->psc : NULL;
#endif
- __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen);
if (!gc) /* no GLX for this */
return -1;
int64_t remainder, int64_t * ust,
int64_t * msc, int64_t * sbc)
{
- int screen;
#ifdef GLX_DIRECT_RENDERING
- __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
+ __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
#endif
- __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen );
+ __GLXscreenConfigs *psc = pdraw ? pdraw->psc : NULL;
int ret;
int64_t target_sbc, int64_t * ust,
int64_t * msc, int64_t * sbc)
{
- int screen;
#ifdef GLX_DIRECT_RENDERING
- __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
+ __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
#endif
- __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen);
+ __GLXscreenConfigs *psc = pdraw ? pdraw->psc : NULL;
int ret;
/* The OML_sync_control spec says this should "generate a GLX_BAD_VALUE
CARD8 opcode;
#ifdef __DRI_COPY_SUB_BUFFER
- int screen;
- __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
+ __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
if (pdraw != NULL) {
- __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen);
+ __GLXscreenConfigs *psc = pdraw->psc;
if (psc->driScreen->copySubBuffer != NULL) {
glFlush();
(*psc->driScreen->copySubBuffer) (pdraw, x, y, width, height);