summaryrefslogtreecommitdiff
path: root/src/glx
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2010-09-09 13:18:40 -0400
committerKristian Høgsberg <krh@bitplanet.net>2010-09-09 13:18:43 -0400
commit94118fe2d4b1e5d0b9f39d9d2c44706db462e97e (patch)
tree439ac2d0920eb2aca8f0805c7fa1d8e7036b98c7 /src/glx
parent916c8ed2c8f916604166b22e6fcb9433b960a924 (diff)
glx: Optimize out no-op make current calls
This make a lot more sense now that we might have to recreate the glx drawables for legacy code paths.
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/glxcurrent.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c
index 0d359f72b4..3631738354 100644
--- a/src/glx/glxcurrent.c
+++ b/src/glx/glxcurrent.c
@@ -242,6 +242,10 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
return False;
}
+ if (oldGC == gc &&
+ gc->currentDrawable == draw && gc->currentReadable == read)
+ return True;
+
if (oldGC != &dummyContext) {
oldGC->vtable->unbind(oldGC, gc);
oldGC->currentDpy = 0;