From 94118fe2d4b1e5d0b9f39d9d2c44706db462e97e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 9 Sep 2010 13:18:40 -0400 Subject: [PATCH] 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. --- src/glx/glxcurrent.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c index 0d359f72b4a..36317383544 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; -- 2.30.2