Merge Jose's documentation and core Mesa changes from embedded branch
[mesa.git] / src / mesa / main / colortab.c
index 184aa8eff2c310c8b9aae40871b6e9dcda2d9c29..9a1734bf4be491e016baed4ce9c7c1b46a759751 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: colortab.c,v 1.48 2003/01/26 14:37:16 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -31,7 +30,6 @@
 #include "context.h"
 #include "image.h"
 #include "macros.h"
-#include "mmath.h"
 #include "state.h"
 
 
@@ -94,26 +92,6 @@ base_colortab_format( GLenum format )
 }
 
 
-void
-_mesa_init_colortable( struct gl_color_table *p )
-{
-   p->FloatTable = GL_FALSE;
-   p->Table = NULL;
-   p->Size = 0;
-   p->IntFormat = GL_RGBA;
-}
-
-
-
-void
-_mesa_free_colortable_data( struct gl_color_table *p )
-{
-   if (p->Table) {
-      FREE(p->Table);
-      p->Table = NULL;
-   }
-}
-
 
 /*
  * Examine table's format and set the component sizes accordingly.
@@ -1347,3 +1325,49 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params )
          return;
    }
 }
+
+/**********************************************************************/
+/*****                      Initialization                        *****/
+/**********************************************************************/
+
+
+void
+_mesa_init_one_colortable( struct gl_color_table *p )
+{
+   p->FloatTable = GL_FALSE;
+   p->Table = NULL;
+   p->Size = 0;
+   p->IntFormat = GL_RGBA;
+}
+
+
+
+void
+_mesa_free_one_colortable( struct gl_color_table *p )
+{
+   if (p->Table) {
+      FREE(p->Table);
+      p->Table = NULL;
+   }
+}
+
+void _mesa_init_colortable( GLcontext * ctx )
+{
+   /* Color tables */
+   _mesa_init_one_colortable(&ctx->ColorTable);
+   _mesa_init_one_colortable(&ctx->ProxyColorTable);
+   _mesa_init_one_colortable(&ctx->PostConvolutionColorTable);
+   _mesa_init_one_colortable(&ctx->ProxyPostConvolutionColorTable);
+   _mesa_init_one_colortable(&ctx->PostColorMatrixColorTable);
+   _mesa_init_one_colortable(&ctx->ProxyPostColorMatrixColorTable);
+}
+
+void _mesa_free_colortable_data( GLcontext *ctx )
+{
+   _mesa_free_one_colortable( &ctx->ColorTable );
+   _mesa_free_one_colortable( &ctx->ProxyColorTable );
+   _mesa_free_one_colortable( &ctx->PostConvolutionColorTable );
+   _mesa_free_one_colortable( &ctx->ProxyPostConvolutionColorTable );
+   _mesa_free_one_colortable( &ctx->PostColorMatrixColorTable );
+   _mesa_free_one_colortable( &ctx->ProxyPostColorMatrixColorTable );
+}