On emulator, pBuffer display is y-inverted.
authorSangjin Kim <sangjin3.kim@samsung.com>
Tue, 16 Apr 2013 06:49:31 +0000 (15:49 +0900)
committerSangjin Kim <sangjin3.kim@samsung.com>
Tue, 16 Apr 2013 06:52:33 +0000 (15:52 +0900)
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 <frederic.dalleau@linux.intel.com>
package/changelog
package/pkginfo.manifest
tizen/src/hw/gloffscreen_wgl.c
tizen/src/hw/gloffscreen_xcomposite.c

index 8d57eca5fb49e062b7bdd4663a472bb16b3d4cd8..65e761e02a77a8fd1a8c5f669c1a85dacb596ba2 100644 (file)
@@ -1,3 +1,6 @@
+* 1.5.28
+- Fix pBuffer issue for xcomposite.
+== Sangjin Kim <sangjin3.kim@samsung.com> 2013-04-16
 * 1.5.27
 - Change the FB configs limitaion from 10 to 32 for each process.
 == Sangjin Kim <sangjin3.kim@samsung.com> 2013-04-12
index cca7a4f9b7a955373e7b26678ddf38e2742da660..85f25f47b036e5a9cc137b326951995a3e870896 100644 (file)
@@ -1,4 +1,4 @@
-Version: 1.5.27
+Version: 1.5.28
 Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
 Source: emulator
 
index 0ab2ea53b227210f4490c2f098a7622402ac475a..5f7b3cfda3c6a6b897d260a12267e16faefa2f40 100644 (file)
@@ -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"
 };
 
index 1a54e0a0c607795f7687860dc22449433562b040..f34e627ede88b0a96a6d95f4914c097a1997e4e2 100644 (file)
@@ -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
 }