summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2009-09-07 18:06:00 +0800
committerBrian Paul <[email protected]>2009-09-30 08:31:55 -0600
commitcab7ea03688ec73dd71c0b969f2db30cabeb713c (patch)
tree6078c4063f781dca6cbe65b83e53d66588a1c5b3 /src
parent2b36db496d34c60a3f987fa88d52bf5684713240 (diff)
mesa/main: Make FEATURE_histogram follow feature conventions.
As shown in mfeatures.h, this allows users of histogram.h to work without knowing if the feature is available.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/api_exec.c15
-rw-r--r--src/mesa/main/context.c4
-rw-r--r--src/mesa/main/histogram.c45
-rw-r--r--src/mesa/main/histogram.h48
4 files changed, 47 insertions, 65 deletions
diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index b363d4340ea..6b529db5ec2 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -76,9 +76,7 @@
#include "ffvertex_prog.h"
#include "framebuffer.h"
#include "hint.h"
-#if FEATURE_histogram
#include "histogram.h"
-#endif
#include "imports.h"
#include "light.h"
#include "lines.h"
@@ -375,18 +373,7 @@ _mesa_init_exec_table(struct _glapi_table *exec)
_mesa_init_colortable_dispatch(exec);
_mesa_init_convolve_dispatch(exec);
-#if FEATURE_histogram
- SET_GetHistogram(exec, _mesa_GetHistogram);
- SET_GetHistogramParameterfv(exec, _mesa_GetHistogramParameterfv);
- SET_GetHistogramParameteriv(exec, _mesa_GetHistogramParameteriv);
- SET_GetMinmax(exec, _mesa_GetMinmax);
- SET_GetMinmaxParameterfv(exec, _mesa_GetMinmaxParameterfv);
- SET_GetMinmaxParameteriv(exec, _mesa_GetMinmaxParameteriv);
- SET_Histogram(exec, _mesa_Histogram);
- SET_Minmax(exec, _mesa_Minmax);
- SET_ResetHistogram(exec, _mesa_ResetHistogram);
- SET_ResetMinmax(exec, _mesa_ResetMinmax);
-#endif
+ _mesa_init_histogram_dispatch(exec);
/* OpenGL 2.0 */
SET_StencilFuncSeparate(exec, _mesa_StencilFuncSeparate);
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 53a21ba4f57..a546e37b5f6 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -106,9 +106,7 @@
#include "fog.h"
#include "framebuffer.h"
#include "get.h"
-#if FEATURE_histogram
#include "histogram.h"
-#endif
#include "hint.h"
#include "hash.h"
#include "light.h"
@@ -693,9 +691,7 @@ init_attrib_groups(GLcontext *ctx)
ctx->RenderMode = GL_RENDER;
#endif
_mesa_init_fog( ctx );
-#if FEATURE_histogram
_mesa_init_histogram( ctx );
-#endif
_mesa_init_hint( ctx );
_mesa_init_line( ctx );
_mesa_init_lighting( ctx );
diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c
index ceb0d5a6a86..87816d31329 100644
--- a/src/mesa/main/histogram.c
+++ b/src/mesa/main/histogram.c
@@ -29,8 +29,11 @@
#include "context.h"
#include "image.h"
#include "histogram.h"
+#include "glapi/dispatch.h"
+#if FEATURE_histogram
+
/*
* XXX the packed pixel formats haven't been tested.
@@ -614,7 +617,11 @@ base_histogram_format( GLenum format )
*/
-void GLAPIENTRY
+/* this is defined below */
+static void GLAPIENTRY _mesa_ResetMinmax(GLenum target);
+
+
+static void GLAPIENTRY
_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
{
GET_CURRENT_CONTEXT(ctx);
@@ -677,7 +684,7 @@ _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvo
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values)
{
GET_CURRENT_CONTEXT(ctx);
@@ -737,7 +744,7 @@ _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, G
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
@@ -784,7 +791,7 @@ _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params)
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
@@ -831,7 +838,7 @@ _mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params)
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
@@ -857,7 +864,7 @@ _mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params)
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
@@ -883,7 +890,7 @@ _mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params)
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean sink)
{
GLuint i;
@@ -966,7 +973,7 @@ _mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean s
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink)
{
GET_CURRENT_CONTEXT(ctx);
@@ -994,7 +1001,7 @@ _mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink)
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_ResetHistogram(GLenum target)
{
GLuint i;
@@ -1020,7 +1027,7 @@ _mesa_ResetHistogram(GLenum target)
}
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_ResetMinmax(GLenum target)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1043,6 +1050,24 @@ _mesa_ResetMinmax(GLenum target)
}
+void
+_mesa_init_histogram_dispatch(struct _glapi_table *disp)
+{
+ SET_GetHistogram(disp, _mesa_GetHistogram);
+ SET_GetHistogramParameterfv(disp, _mesa_GetHistogramParameterfv);
+ SET_GetHistogramParameteriv(disp, _mesa_GetHistogramParameteriv);
+ SET_GetMinmax(disp, _mesa_GetMinmax);
+ SET_GetMinmaxParameterfv(disp, _mesa_GetMinmaxParameterfv);
+ SET_GetMinmaxParameteriv(disp, _mesa_GetMinmaxParameteriv);
+ SET_Histogram(disp, _mesa_Histogram);
+ SET_Minmax(disp, _mesa_Minmax);
+ SET_ResetHistogram(disp, _mesa_ResetHistogram);
+ SET_ResetMinmax(disp, _mesa_ResetMinmax);
+}
+
+
+#endif /* FEATURE_histogram */
+
/**********************************************************************/
/***** Initialization *****/
diff --git a/src/mesa/main/histogram.h b/src/mesa/main/histogram.h
index 367e9b11ba1..dbae1bbd06b 100644
--- a/src/mesa/main/histogram.h
+++ b/src/mesa/main/histogram.h
@@ -36,48 +36,22 @@
#ifndef HISTOGRAM_H
#define HISTOGRAM_H
-#include "glheader.h"
-#include "mtypes.h"
+#include "main/mtypes.h"
-#if _HAVE_FULL_GL
+#if FEATURE_histogram
-extern void GLAPIENTRY
-_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values);
+extern void
+_mesa_init_histogram_dispatch(struct _glapi_table *disp);
-extern void GLAPIENTRY
-_mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+#else /* FEATURE_histogram */
-extern void GLAPIENTRY
-_mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params);
+static INLINE void
+_mesa_init_histogram_dispatch(struct _glapi_table *disp)
+{
+}
-extern void GLAPIENTRY
-_mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params);
-
-extern void GLAPIENTRY
-_mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params);
-
-extern void GLAPIENTRY
-_mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params);
-
-extern void GLAPIENTRY
-_mesa_Histogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-
-extern void GLAPIENTRY
-_mesa_Minmax(GLenum target, GLenum internalformat, GLboolean sink);
-
-extern void GLAPIENTRY
-_mesa_ResetHistogram(GLenum target);
-
-extern void GLAPIENTRY
-_mesa_ResetMinmax(GLenum target);
+#endif /* FEATURE_histogram */
extern void _mesa_init_histogram( GLcontext * ctx );
-#else
-
-/** No-op */
-#define _mesa_init_histogram( c ) ((void) 0)
-
-#endif
-
-#endif
+#endif /* HISTOGRAM_H */