From: Sangjin Kim Date: Tue, 16 Apr 2013 06:49:31 +0000 (+0900) Subject: On emulator, pBuffer display is y-inverted. X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1006^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2261ec7a54f9cf91eb593a82b3a10787c6328e0e;p=sdk%2Femulator%2Fqemu.git On emulator, pBuffer display is y-inverted. With this patch, the buffer data is y-inverted before texture generation. This induces a performance penalty, however display is no longer inverted. Limit this patch to 32 bpp. Change-Id: Id6a6052cd911aed5a2e721cdf81c911fa8fe766d Signed-off-by: Dalleau, Frederic --- diff --git a/package/changelog b/package/changelog index 8d57eca5fb..65e761e02a 100644 --- a/package/changelog +++ b/package/changelog @@ -1,3 +1,6 @@ +* 1.5.28 +- Fix pBuffer issue for xcomposite. +== Sangjin Kim 2013-04-16 * 1.5.27 - Change the FB configs limitaion from 10 to 32 for each process. == Sangjin Kim 2013-04-12 diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index cca7a4f9b7..85f25f47b0 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,4 +1,4 @@ -Version: 1.5.27 +Version: 1.5.28 Maintainer: Yeong-Kyoon Lee Source: emulator diff --git a/tizen/src/hw/gloffscreen_wgl.c b/tizen/src/hw/gloffscreen_wgl.c index 0ab2ea53b2..5f7b3cfda3 100644 --- a/tizen/src/hw/gloffscreen_wgl.c +++ b/tizen/src/hw/gloffscreen_wgl.c @@ -660,8 +660,8 @@ static const char *STANDARD_GL_FUNCTIONS ={ "glXIsDirect\0" "glXCreatePixmap\0" "glXDestroyPixmap\0" -"glXCreatePbuffer\n" -"glXDestroyPbuffer\n" +"glXCreatePbuffer\0" +"glXDestroyPbuffer\0" "\0" }; diff --git a/tizen/src/hw/gloffscreen_xcomposite.c b/tizen/src/hw/gloffscreen_xcomposite.c index 1a54e0a0c6..f34e627ede 100644 --- a/tizen/src/hw/gloffscreen_xcomposite.c +++ b/tizen/src/hw/gloffscreen_xcomposite.c @@ -499,6 +499,23 @@ void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface) fprintf(stderr, "surface_as_texture:teximage:width=%d,height=%d, glFormat=0x%x, glType=0x%x.\n", surface->width, surface->height, glFormat, glType); /* glTexImage2D use different RGB order than the contexts in the pixmap surface */ /* glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, surface->width, surface->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, surface->image->data);*/ + + if ((glFormat == GL_RGBA || glFormat == GL_BGRA) && glType == GL_UNSIGNED_BYTE) { + GLubyte *b = (GLubyte *)surface->image->data; + int stride = surface->width * 4; + GLubyte *c = &((GLubyte *)surface->image->data)[stride*(surface->height-1)]; + GLubyte *tmp = (GLubyte*)g_malloc(stride); + int irow; + + for(irow = 0; irow < surface->height / 2; irow++) { + memcpy(tmp, b, stride); + memcpy(b, c, stride); + memcpy(c, tmp, stride); + b += stride; + c -= stride; + } + g_free(tmp); + } glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, surface->width, surface->height, 0, glFormat, glType, surface->image->data); #endif }