summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2009-09-07 16:59:27 +0800
committerChia-I Wu <olvaffe@gmail.com>2009-09-12 20:55:55 +0800
commit57377d5d69ecdf03e4fa2ef44dfbb7fb37f3f799 (patch)
treed119bd247072ec2a1639d69e7f5ab378bfe23602 /src
parentb565e7b88c5604197a1393dda7b4ad57a835d4e5 (diff)
mesa/main: Make FEATURE_pixel_transfer follow feature conventions.
As shown in mfeatures.h, this allows users of pixel.h to work without knowing if the feature is available.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/api_exec.c16
-rw-r--r--src/mesa/main/pixel.c22
-rw-r--r--src/mesa/main/pixel.h25
-rw-r--r--src/mesa/main/state.c4
4 files changed, 47 insertions, 20 deletions
diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index 02550ae108..39941a1b03 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -93,9 +93,7 @@
#include "macros.h"
#include "matrix.h"
#include "multisample.h"
-#if FEATURE_pixel_transfer
#include "pixel.h"
-#endif
#include "pixelstore.h"
#include "points.h"
#include "polygon.h"
@@ -284,17 +282,9 @@ _mesa_init_exec_table(struct _glapi_table *exec)
SET_MapGrid2f(exec, _mesa_MapGrid2f);
#endif
SET_MultMatrixd(exec, _mesa_MultMatrixd);
-#if FEATURE_pixel_transfer
- SET_GetPixelMapfv(exec, _mesa_GetPixelMapfv);
- SET_GetPixelMapuiv(exec, _mesa_GetPixelMapuiv);
- SET_GetPixelMapusv(exec, _mesa_GetPixelMapusv);
- SET_PixelMapfv(exec, _mesa_PixelMapfv);
- SET_PixelMapuiv(exec, _mesa_PixelMapuiv);
- SET_PixelMapusv(exec, _mesa_PixelMapusv);
- SET_PixelTransferf(exec, _mesa_PixelTransferf);
- SET_PixelTransferi(exec, _mesa_PixelTransferi);
- SET_PixelZoom(exec, _mesa_PixelZoom);
-#endif
+
+ _mesa_init_pixel_dispatch(exec);
+
SET_PixelStoref(exec, _mesa_PixelStoref);
SET_PointSize(exec, _mesa_PointSize);
SET_PolygonMode(exec, _mesa_PolygonMode);
diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c
index fcef6dfd42..23a5c9b9f7 100644
--- a/src/mesa/main/pixel.c
+++ b/src/mesa/main/pixel.c
@@ -36,6 +36,10 @@
#include "macros.h"
#include "pixel.h"
#include "mtypes.h"
+#include "glapi/dispatch.h"
+
+
+#if FEATURE_pixel_transfer
/**********************************************************************/
@@ -756,6 +760,24 @@ void _mesa_update_pixel( GLcontext *ctx, GLuint new_state )
}
+void
+_mesa_init_pixel_dispatch(struct _glapi_table *disp)
+{
+ SET_GetPixelMapfv(disp, _mesa_GetPixelMapfv);
+ SET_GetPixelMapuiv(disp, _mesa_GetPixelMapuiv);
+ SET_GetPixelMapusv(disp, _mesa_GetPixelMapusv);
+ SET_PixelMapfv(disp, _mesa_PixelMapfv);
+ SET_PixelMapuiv(disp, _mesa_PixelMapuiv);
+ SET_PixelMapusv(disp, _mesa_PixelMapusv);
+ SET_PixelTransferf(disp, _mesa_PixelTransferf);
+ SET_PixelTransferi(disp, _mesa_PixelTransferi);
+ SET_PixelZoom(disp, _mesa_PixelZoom);
+}
+
+
+#endif /* FEATURE_pixel_transfer */
+
+
/**********************************************************************/
/***** Initialization *****/
/**********************************************************************/
diff --git a/src/mesa/main/pixel.h b/src/mesa/main/pixel.h
index cb6c5262a3..7a901aec10 100644
--- a/src/mesa/main/pixel.h
+++ b/src/mesa/main/pixel.h
@@ -33,9 +33,11 @@
#define PIXEL_H
-#include "mtypes.h"
+#include "main/mtypes.h"
+#if FEATURE_pixel_transfer
+
/** \name API functions */
/*@{*/
@@ -68,13 +70,30 @@ _mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor );
/*@}*/
-
extern void
_mesa_update_pixel( GLcontext *ctx, GLuint newstate );
extern void
+_mesa_init_pixel_dispatch( struct _glapi_table * disp );
+
+#else /* FEATURE_pixel_transfer */
+
+static INLINE void
+_mesa_update_pixel(GLcontext *ctx, GLuint newstate)
+{
+}
+
+static INLINE void
+_mesa_init_pixel_dispatch(struct _glapi_table *disp)
+{
+}
+
+#endif /* FEATURE_pixel_transfer */
+
+
+extern void
_mesa_init_pixel( GLcontext * ctx );
/*@}*/
-#endif
+#endif /* PIXEL_H */
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 140a998df2..f10e6b04b7 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -40,9 +40,7 @@
#include "framebuffer.h"
#include "light.h"
#include "matrix.h"
-#if FEATURE_pixel_transfer
#include "pixel.h"
-#endif
#include "shader/program.h"
#include "shader/prog_parameter.h"
#include "state.h"
@@ -585,10 +583,8 @@ _mesa_update_state_locked( GLcontext *ctx )
if (new_state & (_NEW_STENCIL | _NEW_BUFFERS))
_mesa_update_stencil( ctx );
-#if FEATURE_pixel_transfer
if (new_state & _MESA_NEW_TRANSFER_STATE)
_mesa_update_pixel( ctx, new_state );
-#endif
if (new_state & _DD_NEW_SEPARATE_SPECULAR)
update_separate_specular( ctx );