Merge branch 'mesa_7_7_branch'
[mesa.git] / src / mesa / main / texgetimage.c
index 0cc6a563a0573f6abcac5c48f2ef29f4e59a7b02..66d01c15d04ffe657928dd00f6684941e45ed59d 100644 (file)
 
 
 
-#if FEATURE_EXT_texture_sRGB
-
-/**
- * Convert a float value from linear space to a
- * non-linear sRGB value in [0, 255].
- * Not terribly efficient.
- */
-static INLINE GLfloat
-linear_to_nonlinear(GLfloat cl)
-{
-   /* can't have values outside [0, 1] */
-   GLfloat cs;
-   if (cl < 0.0031308f) {
-      cs = 12.92f * cl;
-   }
-   else {
-      cs = (GLfloat)(1.055 * _mesa_pow(cl, 0.41666) - 0.055);
-   }
-   return cs;
-}
-
-#endif /* FEATURE_EXT_texture_sRGB */
-
-
 /**
  * Can the given type represent negative values?
  */
@@ -231,6 +207,29 @@ get_tex_ycbcr(GLcontext *ctx, GLuint dimensions,
 }
 
 
+#if FEATURE_EXT_texture_sRGB
+
+
+/**
+ * Convert a float value from linear space to a
+ * non-linear sRGB value in [0, 255].
+ * Not terribly efficient.
+ */
+static INLINE GLfloat
+linear_to_nonlinear(GLfloat cl)
+{
+   /* can't have values outside [0, 1] */
+   GLfloat cs;
+   if (cl < 0.0031308f) {
+      cs = 12.92f * cl;
+   }
+   else {
+      cs = (GLfloat)(1.055 * _mesa_pow(cl, 0.41666) - 0.055);
+   }
+   return cs;
+}
+
+
 /**
  * glGetTexImagefor sRGB pixels;
  */
@@ -282,6 +281,21 @@ get_tex_srgb(GLcontext *ctx, GLuint dimensions,
 }
 
 
+#else /* FEATURE_EXT_texture_sRGB */
+
+
+static INLINE void
+get_tex_srgb(GLcontext *ctx, GLuint dimensions,
+             GLenum format, GLenum type, GLvoid *pixels,
+             const struct gl_texture_image *texImage)
+{
+   ASSERT_NO_FEATURE();
+}
+
+
+#endif /* FEATURE_EXT_texture_sRGB */
+
+
 /**
  * glGetTexImagefor RGBA, Luminance, etc. pixels.
  * This is the slow way since we use texture sampling.
@@ -553,7 +567,8 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level,
       _mesa_get_format_block_size(texImage->TexFormat, &bw, &bh);
       for (i = 0; i < (texImage->Height + bh - 1) / bh; i++) {
          memcpy((GLubyte *)img + i * row_stride,
-                (GLubyte *)texImage->Data + i * row_stride_stored, row_stride);
+                (GLubyte *)texImage->Data + i * row_stride_stored,
+                row_stride);
       }
    }