From: Narlo, i. J. C <jc...@in...> - 2000-05-23 20:41:27
|
Window Clipping We are trying to implement window clipping for our graphics adapter. We have already implemented an X driver and are currently working on the OpenGL DRI based driver code. We need a method to get information from X when a window has changed (i.e., moved, resized, etc...) down to the hardware when OpenGL driver flushes a buffer so that we can setup the proper drawing areas in our 3D graphics window. We don't want to draw into another window that may occlude our window. I have been looking at the code currently in place, and I see that the MGA driver uses a BlockHandler for this purpose. It takes information out of the shared memory area and uses that to set up clip regions. I have not seen where any other driver is using clipping information. I also found where I can wrap the ClipNotify func pointer in the X driver. In the xxxDRIScreenInit() function, a DRIInfoPtr is created. There are server function pointers within this structure. One of these is ClipNotify. If this wrapper is set, it seems that you can implement your own clipping notification strategy in the X driver. An implementation could be something like this: DRIInfoPtr pDRIInfo; pDRIInfo = DRICreateInfoRec(); ... ... ... pDriInfo->wrap.ClipNotify = xxxDRIClipNotify; where xxxDRIClipNotify is our routine for handling clipping changes. Now, when a window changes, the function xxxDRIClipNotify is called. The problem I am having is that this function is called with only 3 parameters. These are WindowPtr pWin int dx int dy Unfortunately, I do not know how to discern the needed window information from the pWin pointer so that I can update the SAREA for later use by the OpenGL driver or DRM to setup clipping regions. In the OpenGL driver, I have drawables that are identified by the X Windows unique number that is passed back at window creation time. The WindowPtr structure does not contain any unique window ID's that I can use to identify this window to the OpenGL driver. I only want to clip the OpenGL driver's windows. I do not care about any other windows. But, without knowing which windows are associated with OpenGL, I cannot cull out the clipping information I need to put in the shared memory area for the OpenGL driver to pick up. If I could identify which windows the OpenGL driver needs to clip, I could setup clipping information from the X-driver to the OpenGL driver (or DRM) via the shared memory area. Does anyone know the preferred or proper way of establishing the clipping regions between the X-driver and the OpenGL driver or DRM? I am assuming the ClipNotify wrapper is the correct or preferred method of recognizing when the clipping information changes. If it is, how do I match up the windows passed in through the clipping notify function with the OpenGL driver drawables? Thanks for your help! Joe Narlo Email: jc...@in... |
From: Keith W. <ke...@pr...> - 2000-05-25 21:12:42
|
"Narlo, ii, Joseph C" wrote: > > Window Clipping > > We are trying to implement window clipping for our graphics adapter. > We have already implemented an X driver and are currently working on > the OpenGL DRI based driver code. We need a method to get information > from X when a window has changed (i.e., moved, resized, etc...) > down to the hardware when OpenGL driver flushes a buffer so that we can > setup the proper drawing areas in our 3D graphics window. We don't want > to draw into another window that may occlude our window. > > I have been looking at the code currently in place, and I see that the > MGA driver uses a BlockHandler for this purpose. It takes information > out of the shared memory area and uses that to set up clip regions. > > I have not seen where any other driver is using clipping information. Have a look at the calls to: XMESA_VALIDATE_DRAWABLE_INFO(imesa->display, sPriv, dPriv); in, eg. i810GetLock() in i810_xmesa.c. The cliprects are stored in device-independent structures, hence the code is abstracted out of the individual drivers. Keith |