[Libreoffice-commits] core.git: include/vcl vcl/source

Tor Lillqvist tml at collabora.com
Wed Nov 11 08:07:53 PST 2015


 include/vcl/opengl/OpenGLContext.hxx |   39 ----------------------------------
 vcl/source/opengl/OpenGLContext.cxx  |   40 +++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 38 deletions(-)

New commits:
commit bb34de0189a7c2ac81c08f3a283a71c2e67093d3
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Nov 11 18:06:29 2015 +0200

    Move checkExtension() to a more private location
    
    Change-Id: I9f8a4ca0991b59bb9b6af4d40e3136ce5c986731

diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx
index 783806d..695a433 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -72,43 +72,6 @@ class OpenGLTests;
 /// Holds the information of our new child window
 struct GLWindow
 {
-    // Copy of gluCheckExtension(), from the Apache-licensed
-    // https://code.google.com/p/glues/source/browse/trunk/glues/source/glues_registry.c
-    static GLboolean checkExtension(const GLubyte* extName, const GLubyte* extString)
-    {
-      GLboolean flag=GL_FALSE;
-      char* word;
-      char* lookHere;
-      char* deleteThis;
-
-      if (extString==nullptr)
-      {
-         return GL_FALSE;
-      }
-
-      deleteThis=lookHere=static_cast<char*>(malloc(strlen(reinterpret_cast<const char*>(extString))+1));
-      if (lookHere==nullptr)
-      {
-         return GL_FALSE;
-      }
-
-      /* strtok() will modify string, so copy it somewhere */
-      strcpy(lookHere, reinterpret_cast<const char*>(extString));
-
-      while ((word=strtok(lookHere, " "))!=nullptr)
-      {
-         if (strcmp(word, reinterpret_cast<const char*>(extName))==0)
-         {
-            flag=GL_TRUE;
-            break;
-         }
-         lookHere=nullptr; /* get next token */
-      }
-      free(static_cast<void*>(deleteThis));
-
-      return flag;
-    }
-
 #if defined( _WIN32 )
     HWND                    hWnd;
     HDC                     hDC;
@@ -129,7 +92,7 @@ struct GLWindow
     GLXContext         ctx;
     GLXPixmap           glPix;
 
-    bool HasGLXExtension( const char* name ) { return checkExtension( reinterpret_cast<const GLubyte*>(name), reinterpret_cast<const GLubyte*>(GLXExtensions) ); }
+    bool HasGLXExtension( const char* name ) const;
     const char*             GLXExtensions;
 #endif
     unsigned int            bpp;
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index bf5b5d7..8088b65 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -665,7 +665,47 @@ bool OpenGLContext::init(Display* dpy, Window win, int screen)
     return ImplInit();
 }
 
+// Copy of gluCheckExtension(), from the Apache-licensed
+// https://code.google.com/p/glues/source/browse/trunk/glues/source/glues_registry.c
+static GLboolean checkExtension(const GLubyte* extName, const GLubyte* extString)
+{
+  GLboolean flag=GL_FALSE;
+  char* word;
+  char* lookHere;
+  char* deleteThis;
+
+  if (extString==nullptr)
+  {
+     return GL_FALSE;
+  }
+
+  deleteThis=lookHere=static_cast<char*>(malloc(strlen(reinterpret_cast<const char*>(extString))+1));
+  if (lookHere==nullptr)
+  {
+     return GL_FALSE;
+  }
+
+  /* strtok() will modify string, so copy it somewhere */
+  strcpy(lookHere, reinterpret_cast<const char*>(extString));
+
+  while ((word=strtok(lookHere, " "))!=nullptr)
+  {
+     if (strcmp(word, reinterpret_cast<const char*>(extName))==0)
+     {
+        flag=GL_TRUE;
+        break;
+     }
+     lookHere=nullptr; /* get next token */
+  }
+  free(static_cast<void*>(deleteThis));
 
+  return flag;
+}
+
+bool GLWindow::HasGLXExtension( const char* name ) const
+{
+    return checkExtension( reinterpret_cast<const GLubyte*>(name), reinterpret_cast<const GLubyte*>(GLXExtensions) );
+}
 
 bool OpenGLContext::ImplInit()
 {


More information about the Libreoffice-commits mailing list