Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: client/deps/glbench/src/glx_stuff.cc

Issue 1258001: Add glXSwapIntervalMESA (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/deps/glbench/src/glx_stuff.cc
diff --git a/client/deps/glbench/src/glx_stuff.cc b/client/deps/glbench/src/glx_stuff.cc
index 840e7e7f7bfdbad35d99a9f632d08aea02421465..b6186d82e232826422591d39410f700f6374e6a7 100644
--- a/client/deps/glbench/src/glx_stuff.cc
+++ b/client/deps/glbench/src/glx_stuff.cc
@@ -15,6 +15,7 @@ static GLXFBConfig glx_fbconfig = NULL;
#define F(fun, type) type fun = NULL;
LIST_PROC_FUNCTIONS(F)
#undef F
+PFNGLXSWAPINTERVALMESAPROC _glXSwapIntervalMESA = NULL;
bool Init() {
return XlibInit();
@@ -72,6 +73,9 @@ bool InitContext() {
glXGetProcAddress(reinterpret_cast<const GLubyte *>(#fun)));
LIST_PROC_FUNCTIONS(F)
#undef F
+ _glXSwapIntervalMESA = reinterpret_cast<PFNGLXSWAPINTERVALMESAPROC>(
+ glXGetProcAddress(reinterpret_cast<const GLubyte *>(
+ "glXSwapIntervalMESA")));
return true;
}
@@ -86,5 +90,11 @@ void SwapBuffers() {
}
bool SwapInterval(int interval) {
- return glXSwapIntervalSGI(interval) == 0;
+ // Strictly, glXSwapIntervalSGI only allows interval > 0, whereas
+ // glXSwapIntervalMESA allow 0 with the same semantics as eglSwapInterval.
+ if (_glXSwapIntervalMESA) {
+ return _glXSwapIntervalMESA(interval) == 0;
+ } else {
+ return glXSwapIntervalSGI(interval) == 0;
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698