[Mesa-dev] [PATCH 6/6] mesa: Pixman texture conversion rgb to rgb565 and rgb565_rev
Juha-Pekka Heikkila
juhapekka.heikkila at gmail.com
Wed Jun 25 05:38:49 PDT 2014
If available use Pixman fastpath for texture conversion.
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
src/mesa/main/texstore.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index fff92eb..3d95fb6 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -1223,6 +1223,13 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS)
_mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight,
srcFormat, srcType, 0, 0, 0);
GLubyte *dst = dstSlices[0];
+#ifdef HAVE_PIXMAN
+ pixman_texture_conversion(PIXMAN_r8g8b8, (uint32_t *)src,
+ srcRowStride, srcWidth, srcHeight,
+ dstFormat == MESA_FORMAT_R5G6B5_UNORM?
+ PIXMAN_r5g6b5:PIXMAN_b5g6r5,
+ (uint32_t *)dst, dstRowStride);
+#else
GLint row, col;
for (row = 0; row < srcHeight; row++) {
const GLubyte *srcUB = (const GLubyte *) src;
@@ -1243,6 +1250,7 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS)
dst += dstRowStride;
src += srcRowStride;
}
+#endif
}
else {
return store_ubyte_texture(ctx, dims, baseInternalFormat,
--
1.8.1.2
More information about the mesa-dev
mailing list