summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver McFadden <z3ro.geek@gmail.com>2007-06-07 13:19:47 +0000
committerOliver McFadden <z3ro.geek@gmail.com>2007-06-07 13:19:47 +0000
commit10d5dd685c155d8e7a8f447bcc19a7a59393ec2e (patch)
tree40bc21a3b6d1aceb67780cb6c38f187dbc7ffd5b
parent8331d9d7aa7cde7126d38d4e1eb5fe8a168077f3 (diff)
r300: Cleaned up long lines in r300Choose8888TexFormat.
-rw-r--r--src/mesa/drivers/dri/r300/r300_tex.c74
-rw-r--r--src/mesa/drivers/dri/r300/r300_texstate.c4
2 files changed, 34 insertions, 44 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c
index 2a21c61162..1805cecd0a 100644
--- a/src/mesa/drivers/dri/r300/r300_tex.c
+++ b/src/mesa/drivers/dri/r300/r300_tex.c
@@ -294,27 +294,20 @@ static const struct gl_texture_format *r300Choose8888TexFormat(GLenum srcFormat,
const GLubyte littleEndian = *((const GLubyte *)&ui);
if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8) ||
- (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE
- && !littleEndian) || (srcFormat == GL_ABGR_EXT
- && srcType == GL_UNSIGNED_INT_8_8_8_8_REV)
- || (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE
- && littleEndian)) {
+ (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && littleEndian)) {
return &_mesa_texformat_rgba8888;
- } else
- if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV)
- || (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE
- && littleEndian) || (srcFormat == GL_ABGR_EXT
- && srcType == GL_UNSIGNED_INT_8_8_8_8)
- || (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE
- && !littleEndian)) {
+ } else if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
+ (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && !littleEndian)) {
return &_mesa_texformat_rgba8888_rev;
- } else if (srcFormat == GL_BGRA &&
- ((srcType == GL_UNSIGNED_BYTE && !littleEndian) ||
- srcType == GL_UNSIGNED_INT_8_8_8_8)) {
+ } else if (srcFormat == GL_BGRA && ((srcType == GL_UNSIGNED_BYTE && !littleEndian) ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8)) {
return &_mesa_texformat_argb8888_rev;
- } else if (srcFormat == GL_BGRA &&
- ((srcType == GL_UNSIGNED_BYTE && littleEndian) ||
- srcType == GL_UNSIGNED_INT_8_8_8_8_REV)) {
+ } else if (srcFormat == GL_BGRA && ((srcType == GL_UNSIGNED_BYTE && littleEndian) ||
+ srcType == GL_UNSIGNED_INT_8_8_8_8_REV)) {
return &_mesa_texformat_argb8888;
} else
return _dri_texformat_argb8888;
@@ -563,34 +556,31 @@ r300ValidateClientStorage(GLcontext * ctx, GLenum target,
return 0;
}
- {
- GLint srcRowStride = _mesa_image_row_stride(packing, srcWidth,
- format, type);
+ GLint srcRowStride = _mesa_image_row_stride(packing, srcWidth,
+ format, type);
- if (RADEON_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, "%s: srcRowStride %d/%x\n",
- __FUNCTION__, srcRowStride, srcRowStride);
+ if (RADEON_DEBUG & DEBUG_TEXTURE)
+ fprintf(stderr, "%s: srcRowStride %d/%x\n",
+ __FUNCTION__, srcRowStride, srcRowStride);
- /* Could check this later in upload, pitch restrictions could be
- * relaxed, but would need to store the image pitch somewhere,
- * as packing details might change before image is uploaded:
- */
- if (!r300IsGartMemory(rmesa, pixels, srcHeight * srcRowStride)
- || (srcRowStride & 63))
- return 0;
+ /* Could check this later in upload, pitch restrictions could be
+ * relaxed, but would need to store the image pitch somewhere,
+ * as packing details might change before image is uploaded:
+ */
+ if (!r300IsGartMemory(rmesa, pixels, srcHeight * srcRowStride)
+ || (srcRowStride & 63))
+ return 0;
- /* Have validated that _mesa_transfer_teximage would be a straight
- * memcpy at this point. NOTE: future calls to TexSubImage will
- * overwrite the client data. This is explicitly mentioned in the
- * extension spec.
- */
- texImage->Data = (void *)pixels;
- texImage->IsClientData = GL_TRUE;
- texImage->RowStride =
- srcRowStride / texImage->TexFormat->TexelBytes;
+ /* Have validated that _mesa_transfer_teximage would be a straight
+ * memcpy at this point. NOTE: future calls to TexSubImage will
+ * overwrite the client data. This is explicitly mentioned in the
+ * extension spec.
+ */
+ texImage->Data = (void *)pixels;
+ texImage->IsClientData = GL_TRUE;
+ texImage->RowStride = srcRowStride / texImage->TexFormat->TexelBytes;
- return 1;
- }
+ return 1;
}
static void r300TexImage1D(GLcontext * ctx, GLenum target, GLint level,
diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c
index ac5a5ba1cd..1d2909fd21 100644
--- a/src/mesa/drivers/dri/r300/r300_texstate.c
+++ b/src/mesa/drivers/dri/r300/r300_texstate.c
@@ -480,11 +480,11 @@ static GLboolean r300UpdateTexture(GLcontext * ctx, int unit)
*/
rmesa->state.texture.unit[unit].texobj->base.bound &=
- ~(1UL << unit);
+ ~(1 << unit);
}
rmesa->state.texture.unit[unit].texobj = t;
- t->base.bound |= (1UL << unit);
+ t->base.bound |= (1 << unit);
t->dirty_state |= 1 << unit;
driUpdateTextureLRU((driTextureObject *) t); /* XXX: should be locked! */
}