[Mesa-dev] [PATCH 03/11] mesa: Remove all mention of GL_COLOR_INDEX*_EXT

Ian Romanick idr at freedesktop.org
Wed Aug 31 13:21:53 PDT 2011


From: Ian Romanick <ian.d.romanick at intel.com>

These enums were only valid with the paletted texture extensions.
This allows a couple other trivial clean-ups.
---
 src/mesa/main/image.c       |   27 ---------------------------
 src/mesa/main/image.h       |    3 ---
 src/mesa/main/texgetimage.c |    8 ++------
 3 files changed, 2 insertions(+), 36 deletions(-)

diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 37127dc..3e75e7c 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -249,12 +249,6 @@ _mesa_components_in_format( GLenum format )
 {
    switch (format) {
       case GL_COLOR_INDEX:
-      case GL_COLOR_INDEX1_EXT:
-      case GL_COLOR_INDEX2_EXT:
-      case GL_COLOR_INDEX4_EXT:
-      case GL_COLOR_INDEX8_EXT:
-      case GL_COLOR_INDEX12_EXT:
-      case GL_COLOR_INDEX16_EXT:
       case GL_STENCIL_INDEX:
       case GL_DEPTH_COMPONENT:
       case GL_RED:
@@ -863,27 +857,6 @@ _mesa_is_color_format(GLenum format)
 
 
 /**
- * Test if the given image format is a color index format.
- */
-GLboolean
-_mesa_is_index_format(GLenum format)
-{
-   switch (format) {
-      case GL_COLOR_INDEX:
-      case GL_COLOR_INDEX1_EXT:
-      case GL_COLOR_INDEX2_EXT:
-      case GL_COLOR_INDEX4_EXT:
-      case GL_COLOR_INDEX8_EXT:
-      case GL_COLOR_INDEX12_EXT:
-      case GL_COLOR_INDEX16_EXT:
-         return GL_TRUE;
-      default:
-         return GL_FALSE;
-   }
-}
-
-
-/**
  * Test if the given image format is a depth component format.
  */
 GLboolean
diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h
index 005fbcc..46adaec 100644
--- a/src/mesa/main/image.h
+++ b/src/mesa/main/image.h
@@ -61,9 +61,6 @@ extern GLboolean
 _mesa_is_color_format(GLenum format);
 
 extern GLboolean
-_mesa_is_index_format(GLenum format);
-
-extern GLboolean
 _mesa_is_depth_format(GLenum format);
 
 extern GLboolean
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index a64e1a0..99ace91 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -515,16 +515,12 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level,
    }
 
    if (_mesa_components_in_format(format) <= 0 ||
-       format == GL_STENCIL_INDEX) {
+       format == GL_STENCIL_INDEX ||
+       format == GL_COLOR_INDEX) {
       _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexImage(format)" );
       return GL_TRUE;
    }
 
-   if (_mesa_is_index_format(format)) {
-      _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
-      return GL_TRUE;
-   }
-
    if (!ctx->Extensions.ARB_depth_texture && _mesa_is_depth_format(format)) {
       _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)");
       return GL_TRUE;
-- 
1.7.4.4



More information about the mesa-dev mailing list