summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstore.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-01-26 20:01:12 -0700
committerBrian Paul <[email protected]>2012-01-27 18:21:45 -0700
commitf6af4c511fd3d2750c5279d0d93492bb4e92aac9 (patch)
treeb1590ad103ad0194ee6d136f37f267ab235fd7f8 /src/mesa/main/texstore.c
parentb27792335e284bcddcbcfa807e5152feff330f58 (diff)
mesa: more use of _mesa_format_matches_format_and_type() in texstore code
For rgb565, argb8888, rgb888, argb4444 functions.
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r--src/mesa/main/texstore.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 3db04c42abc..61c33ccdc34 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -1139,11 +1139,9 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS)
ASSERT(_mesa_get_format_bytes(dstFormat) == 2);
if (!ctx->_ImageTransferState &&
- !srcPacking->SwapBytes &&
- dstFormat == MESA_FORMAT_RGB565 &&
baseInternalFormat == GL_RGB &&
- srcFormat == GL_RGB &&
- srcType == GL_UNSIGNED_SHORT_5_6_5) {
+ _mesa_format_matches_format_and_type(dstFormat, srcFormat, srcType,
+ srcPacking->SwapBytes)) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
dstFormat,
@@ -1513,18 +1511,15 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
static GLboolean
_mesa_texstore_rgb888(TEXSTORE_PARAMS)
{
- const GLboolean littleEndian = _mesa_little_endian();
const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
ASSERT(dstFormat == MESA_FORMAT_RGB888);
ASSERT(_mesa_get_format_bytes(dstFormat) == 3);
if (!ctx->_ImageTransferState &&
- !srcPacking->SwapBytes &&
baseInternalFormat == GL_RGB &&
- srcFormat == GL_BGR &&
- srcType == GL_UNSIGNED_BYTE &&
- littleEndian) {
+ _mesa_format_matches_format_and_type(dstFormat, srcFormat, srcType,
+ srcPacking->SwapBytes)) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
dstFormat,
@@ -1630,18 +1625,15 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS)
static GLboolean
_mesa_texstore_bgr888(TEXSTORE_PARAMS)
{
- const GLboolean littleEndian = _mesa_little_endian();
const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
ASSERT(dstFormat == MESA_FORMAT_BGR888);
ASSERT(_mesa_get_format_bytes(dstFormat) == 3);
if (!ctx->_ImageTransferState &&
- !srcPacking->SwapBytes &&
baseInternalFormat == GL_RGB &&
- srcFormat == GL_RGB &&
- srcType == GL_UNSIGNED_BYTE &&
- littleEndian) {
+ _mesa_format_matches_format_and_type(dstFormat, srcFormat, srcType,
+ srcPacking->SwapBytes)) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
dstFormat,
@@ -1735,11 +1727,9 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS)
ASSERT(_mesa_get_format_bytes(dstFormat) == 2);
if (!ctx->_ImageTransferState &&
- !srcPacking->SwapBytes &&
- dstFormat == MESA_FORMAT_ARGB4444 &&
baseInternalFormat == GL_RGBA &&
- srcFormat == GL_BGRA &&
- srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV) {
+ _mesa_format_matches_format_and_type(dstFormat, srcFormat, srcType,
+ srcPacking->SwapBytes)) {
/* simple memcpy path */
memcpy_texture(ctx, dims,
dstFormat,