Added few more stubs so that control reaches to DestroyDevice().
[mesa.git] / src / glx / singlepix.c
index c4010d79bd09ee6fcb7db4c04c38ba2921cfe3f1..e1468c63c2bc9f31e67041b28e390e6968c0befc 100644 (file)
 
 #include "packsingle.h"
 #include "indirect.h"
-#include "glapitable.h"
-#include "glapidispatch.h"
 #include "glapi.h"
-#include "glthread.h"
-#include "glapioffsets.h"
 #include <GL/glxproto.h>
 
 void
@@ -71,7 +67,7 @@ __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type,
       heightsize = __glImageSize(height, 1, 1, format, type, 0);
 
       /* Allocate a holding buffer to transform the data from */
-      rowBuf = (GLubyte *) Xmalloc(widthsize);
+      rowBuf = malloc(widthsize);
       if (!rowBuf) {
          /* Throw data away */
          _XEatData(dpy, compsize);
@@ -83,9 +79,9 @@ __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type,
       else {
          __GLX_SINGLE_GET_CHAR_ARRAY(((char *) rowBuf), widthsize);
          __glEmptyImage(gc, 1, width, 1, 1, format, type, rowBuf, row);
-         Xfree((char *) rowBuf);
+         free((char *) rowBuf);
       }
-      colBuf = (GLubyte *) Xmalloc(heightsize);
+      colBuf = malloc(heightsize);
       if (!colBuf) {
          /* Throw data away */
          _XEatData(dpy, compsize - __GLX_PAD(widthsize));
@@ -97,7 +93,7 @@ __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type,
       else {
          __GLX_SINGLE_GET_CHAR_ARRAY(((char *) colBuf), heightsize);
          __glEmptyImage(gc, 1, height, 1, 1, format, type, colBuf, column);
-         Xfree((char *) colBuf);
+         free((char *) colBuf);
       }
    }
    else {
@@ -110,19 +106,20 @@ __indirect_glGetSeparableFilter(GLenum target, GLenum format, GLenum type,
 }
 
 
-#define CONCAT(a,b) a ## b
-#define NAME(o) CONCAT(gl_dispatch_stub_, o)
-
-void NAME(_gloffset_GetSeparableFilter) (GLenum target, GLenum format,
-                                         GLenum type, GLvoid * row,
-                                         GLvoid * column, GLvoid * span)
+/* it is defined to gl_dispatch_stub_NNN in indirect.h */
+void gl_dispatch_stub_GetSeparableFilterEXT (GLenum target, GLenum format,
+                                             GLenum type, GLvoid * row,
+                                             GLvoid * column, GLvoid * span)
 {
-   __GLXcontext *const gc = __glXGetCurrentContext();
+   struct glx_context *const gc = __glXGetCurrentContext();
 
 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
-   if (gc->driContext) {
-      CALL_GetSeparableFilter(GET_DISPATCH(),
-                              (target, format, type, row, column, span));
+   if (gc->isDirect) {
+      const _glapi_proc *const table = (_glapi_proc *) GET_DISPATCH();
+      PFNGLGETSEPARABLEFILTEREXTPROC p =
+         (PFNGLGETSEPARABLEFILTEREXTPROC) table[359];
+
+      p(target, format, type, row, column, span);
       return;
    }
    else
@@ -157,8 +154,7 @@ void NAME(_gloffset_GetSeparableFilter) (GLenum target, GLenum format,
             const GLint heightsize =
                __glImageSize(height, 1, 1, format, type, 0);
             GLubyte *const buf =
-               (GLubyte *) Xmalloc((widthsize > heightsize) ? widthsize :
-                                   heightsize);
+               malloc((widthsize > heightsize) ? widthsize : heightsize);
 
             if (buf == NULL) {
                /* Throw data away */
@@ -188,7 +184,7 @@ void NAME(_gloffset_GetSeparableFilter) (GLenum target, GLenum format,
 
                __glEmptyImage(gc, 1, height, 1, 1, format, type, buf, column);
 
-               Xfree((char *) buf);
+               free((char *) buf);
             }
          }
       }