mesa/main: Make FEATURE_histogram follow feature conventions.
[mesa.git] / src / mesa / main / teximage.h
index d7b927ff64fac688f40479f3a18cdb4b7f76b78b..094177da79d2ef6efd6c1259fdf304510647a2df 100644 (file)
@@ -5,9 +5,9 @@
 
 /*
  * Mesa 3-D graphics library
- * Version:  6.1
+ * Version:  6.5
  *
- * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 #include "mtypes.h"
 
 
+extern void *
+_mesa_alloc_texmemory(GLsizei bytes);
+
+extern void
+_mesa_free_texmemory(void *m);
+
+
 /** \name Internal functions */
 /*@{*/
 
@@ -42,12 +49,20 @@ extern GLint
 _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat );
 
 
+extern GLboolean
+_mesa_is_proxy_texture(GLenum target);
+
+
 extern struct gl_texture_image *
 _mesa_new_texture_image( GLcontext *ctx );
 
 
 extern void
-_mesa_delete_texture_image( struct gl_texture_image *teximage );
+_mesa_delete_texture_image( GLcontext *ctx, struct gl_texture_image *teximage );
+
+extern void
+_mesa_free_texture_image_data( GLcontext *ctx, 
+                              struct gl_texture_image *texImage );
 
 
 extern void
@@ -57,6 +72,10 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
                            GLint border, GLenum internalFormat);
 
 
+extern void
+_mesa_clear_texture_image(GLcontext *ctx, struct gl_texture_image *texImage);
+
+
 extern void
 _mesa_set_tex_image(struct gl_texture_object *tObj,
                     GLenum target, GLint level,
@@ -69,12 +88,12 @@ _mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit,
 
 
 extern struct gl_texture_image *
-_mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
+_mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_object *texObj,
                        GLenum target, GLint level);
 
 
 extern struct gl_texture_image *
-_mesa_get_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
+_mesa_get_tex_image(GLcontext *ctx, struct gl_texture_object *texObj,
                     GLenum target, GLint level);
 
 
@@ -91,6 +110,28 @@ _mesa_test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
                          GLint internalFormat, GLenum format, GLenum type,
                          GLint width, GLint height, GLint depth, GLint border);
 
+
+extern GLuint
+_mesa_tex_target_to_face(GLenum target);
+
+
+/**
+ * Lock a texture for updating.  See also _mesa_lock_context_textures().
+ */
+static INLINE void
+_mesa_lock_texture(GLcontext *ctx, struct gl_texture_object *texObj)
+{
+   _glthread_LOCK_MUTEX(ctx->Shared->TexMutex);
+   ctx->Shared->TextureStateStamp++;
+   (void) texObj;
+}
+
+static INLINE void
+_mesa_unlock_texture(GLcontext *ctx, struct gl_texture_object *texObj)
+{
+   _glthread_UNLOCK_MUTEX(ctx->Shared->TexMutex);
+}
+
 /*@}*/
 
 
@@ -122,11 +163,6 @@ _mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalformat,
                      const GLvoid *pixels );
 
 
-extern void GLAPIENTRY
-_mesa_GetTexImage( GLenum target, GLint level,
-                   GLenum format, GLenum type, GLvoid *pixels );
-
-
 extern void GLAPIENTRY
 _mesa_TexSubImage1D( GLenum target, GLint level, GLint xoffset,
                      GLsizei width,
@@ -219,9 +255,6 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
                                  GLsizei height, GLsizei depth, GLenum format,
                                  GLsizei imageSize, const GLvoid *data);
 
-extern void GLAPIENTRY
-_mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img);
-
 /*@}*/
 
 #endif