aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texstore.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-02-24 08:18:51 +0100
committermarha <marha@users.sourceforge.net>2012-02-24 08:18:51 +0100
commit6f066fc9e28c33779b89e7e48e6437965dde9b77 (patch)
treeb2b9767762bd559d1edd808820cb65a4e3330397 /mesalib/src/mesa/main/texstore.c
parent1b73fdf9c9aa2330380300d204fb47f512cfb6e2 (diff)
parent5fb4fb602bde5140dcea45464e3b70a49078ad2e (diff)
downloadvcxsrv-6f066fc9e28c33779b89e7e48e6437965dde9b77.tar.gz
vcxsrv-6f066fc9e28c33779b89e7e48e6437965dde9b77.tar.bz2
vcxsrv-6f066fc9e28c33779b89e7e48e6437965dde9b77.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/main/texstore.c')
-rw-r--r--mesalib/src/mesa/main/texstore.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c
index 8c51a948e..e8190c392 100644
--- a/mesalib/src/mesa/main/texstore.c
+++ b/mesalib/src/mesa/main/texstore.c
@@ -1350,6 +1350,32 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
}
else if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes &&
+ dstFormat == MESA_FORMAT_ARGB8888 &&
+ srcFormat == GL_LUMINANCE_ALPHA &&
+ baseInternalFormat == GL_RGBA &&
+ srcType == GL_UNSIGNED_BYTE) {
+ /* special case of storing LA -> ARGB8888 */
+ int img, row, col;
+ const GLint srcRowStride =
+ _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType);
+ for (img = 0; img < srcDepth; img++) {
+ const GLubyte *srcRow = (const GLubyte *)
+ _mesa_image_address(dims, srcPacking, srcAddr, srcWidth,
+ srcHeight, srcFormat, srcType, img, 0, 0);
+ GLubyte *dstRow = dstSlices[img];
+ for (row = 0; row < srcHeight; row++) {
+ GLuint *d4 = (GLuint *) dstRow;
+ for (col = 0; col < srcWidth; col++) {
+ GLubyte l = srcRow[col * 2 + 0], a = srcRow[col * 2 + 1];
+ d4[col] = PACK_COLOR_8888(a, l, l, l);
+ }
+ dstRow += dstRowStride;
+ srcRow += srcRowStride;
+ }
+ }
+ }
+ else if (!ctx->_ImageTransferState &&
+ !srcPacking->SwapBytes &&
dstFormat == MESA_FORMAT_ARGB8888 &&
srcFormat == GL_RGBA &&
baseInternalFormat == GL_RGBA &&