summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-10-07 13:49:28 -0400
committerKristian Høgsberg <krh@redhat.com>2008-10-15 00:00:44 -0400
commitced6690284fd334f225bbc94685c114ad3ab96d8 (patch)
treeb5852dffc62484e4a452dcbf2569c110be97e254 /glx
parent87a016ae00feac3fbaa7e7a518076a3852d49554 (diff)
dri2: Update to latest protocol draft.
Mainly rename SwapBuffers to CopyRegion, which adds the xfixes region argument and the bitmask argument to let us extend it in the future.
Diffstat (limited to 'glx')
-rw-r--r--glx/glxdri2.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 65138cd0f..207ad063f 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -110,13 +110,30 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable)
xfree(private);
}
+static void
+__glXDRIdrawableCopySubBuffer(__GLXdrawable *drawable,
+ int x, int y, int w, int h)
+{
+ BoxRec box;
+ RegionRec region;
+
+ box.x1 = x;
+ box.y1 = y;
+ box.x2 = x + w;
+ box.y2 = y + h;
+ REGION_INIT(drawable->pDraw->pScreen, &region, &box, 0);
+
+ DRI2CopyRegion(drawable->pDraw, &region,
+ DRI2BufferFrontLeft, DRI2BufferBackLeft);
+}
+
static GLboolean
__glXDRIdrawableSwapBuffers(__GLXdrawable *drawable)
{
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
- DRI2SwapBuffers(drawable->pDraw,
- 0, 0, private->width, private->height);
+ __glXDRIdrawableCopySubBuffer(drawable, 0, 0,
+ private->width, private->height);
return TRUE;
}
@@ -128,14 +145,6 @@ __glXDRIdrawableSwapInterval(__GLXdrawable *drawable, int interval)
return 0;
}
-
-static void
-__glXDRIdrawableCopySubBuffer(__GLXdrawable *drawable,
- int x, int y, int w, int h)
-{
- DRI2SwapBuffers(drawable->pDraw, x, y, w, h);
-}
-
static void
__glXDRIcontextDestroy(__GLXcontext *baseContext)
{
@@ -452,7 +461,7 @@ initializeExtensions(__GLXDRIscreen *screen)
static __GLXscreen *
__glXDRIscreenProbe(ScreenPtr pScreen)
{
- const char *driverName;
+ const char *driverName, *deviceName;
__GLXDRIscreen *screen;
char filename[128];
size_t buffer_size;
@@ -466,7 +475,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
return NULL;
if (!xf86LoaderCheckSymbol("DRI2Connect") ||
- !DRI2Connect(pScreen, &screen->fd, &driverName)) {
+ !DRI2Connect(pScreen, DRI2DriverDRI,
+ &screen->fd, &driverName, &deviceName)) {
LogMessage(X_INFO,
"AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum);
return NULL;