From f84cc8b84b2944b60eb2a8225e3c44a1cdfb228d Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Tue, 16 Aug 2011 00:09:38 +0800 Subject: [PATCH] glamor-ddx: Hardware cursor's format should be GL_RGBA. Signed-off-by: Zhigang Gong --- hw/xfree86/glamor/glamor_crtc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/glamor/glamor_crtc.c b/hw/xfree86/glamor/glamor_crtc.c index 5c2b5c124..959201397 100644 --- a/hw/xfree86/glamor/glamor_crtc.c +++ b/hw/xfree86/glamor/glamor_crtc.c @@ -494,9 +494,14 @@ drmmode_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image) } glBindTexture(GL_TEXTURE_2D, drmmode_crtc->cursor_tex); #ifdef GLAMOR_GLES2 - glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA, 64, 64, 0, - GL_BGRA, GL_UNSIGNED_BYTE, image); + /* XXX Actually, the image is BGRA not RGBA, so the r and b + * should be swapped. But as normally, they are the same value + * ignore this currently, don't want to let CPU to do the swizzle. + * considering to put this function to the glamor rendering directory. + * Thus we can reuse the shader to do this.*/ + glPixelStorei(GL_UNPACK_ALIGNMENT, 4); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 64, 64, 0, + GL_RGBA, GL_UNSIGNED_BYTE, image); #else glPixelStorei(GL_UNPACK_ROW_LENGTH, 64); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 64, 64, 0,