mesa: remove ARB_transpose_matrix extension enable flag
[mesa.git] / src / mesa / main / pixeltransfer.c
index 5e881436afd99d6350346ce52165eb0a5f3aadbe..fa355eb4a93a7574e7b2027aca1206b117dc5a2c 100644 (file)
@@ -93,10 +93,10 @@ _mesa_map_rgba( const struct gl_context *ctx, GLuint n, GLfloat rgba[][4] )
       GLfloat g = CLAMP(rgba[i][GCOMP], 0.0F, 1.0F);
       GLfloat b = CLAMP(rgba[i][BCOMP], 0.0F, 1.0F);
       GLfloat a = CLAMP(rgba[i][ACOMP], 0.0F, 1.0F);
-      rgba[i][RCOMP] = rMap[IROUND(r * rscale)];
-      rgba[i][GCOMP] = gMap[IROUND(g * gscale)];
-      rgba[i][BCOMP] = bMap[IROUND(b * bscale)];
-      rgba[i][ACOMP] = aMap[IROUND(a * ascale)];
+      rgba[i][RCOMP] = rMap[F_TO_I(r * rscale)];
+      rgba[i][GCOMP] = gMap[F_TO_I(g * gscale)];
+      rgba[i][BCOMP] = bMap[F_TO_I(b * bscale)];
+      rgba[i][ACOMP] = aMap[F_TO_I(a * ascale)];
    }
 }
 
@@ -125,32 +125,6 @@ _mesa_map_ci_to_rgba( const struct gl_context *ctx, GLuint n,
 }
 
 
-/**
- * Map ubyte color indexes to ubyte/RGBA values.
- */
-void
-_mesa_map_ci8_to_rgba8(const struct gl_context *ctx,
-                       GLuint n, const GLubyte index[],
-                       GLubyte rgba[][4])
-{
-   GLuint rmask = ctx->PixelMaps.ItoR.Size - 1;
-   GLuint gmask = ctx->PixelMaps.ItoG.Size - 1;
-   GLuint bmask = ctx->PixelMaps.ItoB.Size - 1;
-   GLuint amask = ctx->PixelMaps.ItoA.Size - 1;
-   const GLubyte *rMap = ctx->PixelMaps.ItoR.Map8;
-   const GLubyte *gMap = ctx->PixelMaps.ItoG.Map8;
-   const GLubyte *bMap = ctx->PixelMaps.ItoB.Map8;
-   const GLubyte *aMap = ctx->PixelMaps.ItoA.Map8;
-   GLuint i;
-   for (i=0;i<n;i++) {
-      rgba[i][RCOMP] = rMap[index[i] & rmask];
-      rgba[i][GCOMP] = gMap[index[i] & gmask];
-      rgba[i][BCOMP] = bMap[index[i] & bmask];
-      rgba[i][ACOMP] = aMap[index[i] & amask];
-   }
-}
-
-
 void
 _mesa_scale_and_bias_depth(const struct gl_context *ctx, GLuint n,
                            GLfloat depthValues[])
@@ -261,7 +235,7 @@ _mesa_apply_ci_transfer_ops(const struct gl_context *ctx,
       GLuint i;
       for (i = 0; i < n; i++) {
          const GLuint j = indexes[i] & mask;
-         indexes[i] = IROUND(ctx->PixelMaps.ItoI.Map[j]);
+         indexes[i] = F_TO_I(ctx->PixelMaps.ItoI.Map[j]);
       }
    }
 }
@@ -273,7 +247,7 @@ _mesa_apply_ci_transfer_ops(const struct gl_context *ctx,
  */
 void
 _mesa_apply_stencil_transfer_ops(const struct gl_context *ctx, GLuint n,
-                                 GLstencil stencil[])
+                                 GLubyte stencil[])
 {
    if (ctx->Pixel.IndexShift != 0 || ctx->Pixel.IndexOffset != 0) {
       const GLint offset = ctx->Pixel.IndexOffset;
@@ -300,7 +274,7 @@ _mesa_apply_stencil_transfer_ops(const struct gl_context *ctx, GLuint n,
       GLuint mask = ctx->PixelMaps.StoS.Size - 1;
       GLuint i;
       for (i = 0; i < n; i++) {
-         stencil[i] = (GLstencil)ctx->PixelMaps.StoS.Map[ stencil[i] & mask ];
+         stencil[i] = (GLubyte) ctx->PixelMaps.StoS.Map[ stencil[i] & mask ];
       }
    }
 }