diff options
author | Sangjin Kim <sangjin3.kim@samsung.com> | 2012-08-31 10:43:52 +0900 |
---|---|---|
committer | Sangjin Kim <sangjin3.kim@samsung.com> | 2012-08-31 10:43:52 +0900 |
commit | 7c53dc36e0f39adafe23370e217d09d3c0b9712d (patch) | |
tree | 6b54f1ff39d6746fa125ea6da7fbf85a78f13dde | |
parent | e337674e50d8e876e66fb7a52fd0d32b7dccb3db (diff) | |
download | simulator-opengl-7c53dc36e0f39adafe23370e217d09d3c0b9712d.tar.gz simulator-opengl-7c53dc36e0f39adafe23370e217d09d3c0b9712d.tar.bz2 simulator-opengl-7c53dc36e0f39adafe23370e217d09d3c0b9712d.zip |
[Title] pixmap, EGLImageKHR, glEGLImageTargetTexture2DOES extension modified.
[Type] bug fix
[Module] opengl-es
[Priority]
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | es_2_0/EGLImage.c | 37 | ||||
-rwxr-xr-x | packaging/simulator-opengl.spec | 2 |
3 files changed, 42 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog index 63b3058..19282ea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +simulator-opengl (0.1.31) unstable; urgency=low + + * pixmap, EGLImageKHR, glEGLImageTargetTexture2DOES extension modified. + * Git: 112.106.1.251:sdk/simulator-opengl + * Tag: simulator-opengl_0.1.31 + + -- Sangjin Kim <sangjin3.kim@samsung.com> Fri, 31 Aug 2012 10:40:53 +0900 + simulator-opengl (0.1.28) unstable; urgency=low * pixmap, EGLImageKHR, glEGLImageTargetTexture2DOES extension add. diff --git a/es_2_0/EGLImage.c b/es_2_0/EGLImage.c index a552519..e5bf78d 100644 --- a/es_2_0/EGLImage.c +++ b/es_2_0/EGLImage.c @@ -47,16 +47,45 @@ void GL_APIENTRY ES2ENTRY(EGLImageTargetTexture2DOES) (GLenum target, fprintf (stderr, "======== height = 0x%x\n", (unsigned int)height); fprintf (stderr, "======== depth = 0x%x\n", (unsigned int)depth); -#if 0 + /* EGLImageTargetTexture2DOES support 2D rendering results in the + * xpixmap as texture, so firstly TexImage2D then trap into host, where + * the 2D & 3D rendering need to be combined as texture + */ + img = XGetImage ((Display*)dpy, pixmap, 0, 0, width, height, AllPlanes, ZPixmap); if (img == NULL) { fprintf (stderr, "EGLImage: Failed to get pixmap image!\n"); } - FNPTR(TexImage2D)(target, 0, GL_RGB, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, img->data); + /* 2D rendering from Xlib doesn't produce alpha channel. Make a + * option(default off) to add alpha as 0xff for each pixel with + * possible performance drop */ +//#define FILL_IN_ALPHA +#ifdef FILL_IN_ALPHA + /* Add alpha channel if needed, as Xlib rendering doesn't produce it */ + if ( img->bits_per_pixel == 32 ) + { + int x, y; + for ( y = 0; y < img->height; y++ ) + for ( x = 0; x < img->width; x++ ) + { + char* pixel = img->data + + y * img->bytes_per_line + + x * (img->bits_per_pixel / 8); + pixel[3] = 0xff; + } + } +#endif + +/* pixels in 2D rendering results is BGR format, which is not in the + * header of gles. XXX:Need generic method to detect the RBG format and + * alpha, like DefaultVisual */ +#ifndef GL_BGRA +#define GL_BGRA 0x80E1 +#endif + FNPTR(TexImage2D)(target, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE, img->data); XDestroyImage (img); -#else + FNPTR(EGLImageTargetTexture2DOES)(target, pixmap); -#endif } diff --git a/packaging/simulator-opengl.spec b/packaging/simulator-opengl.spec index 2e040b4..498d97a 100755 --- a/packaging/simulator-opengl.spec +++ b/packaging/simulator-opengl.spec @@ -1,7 +1,7 @@ #sbs-git:slp/sdk/simulator-opengl Name: simulator-opengl Summary: opengl-es acceleration module for emulator -Version: 0.1.30 +Version: 0.1.31 Release: 1 Group: TO_BE/FILLED_IN License: TO_BE/FILLED_IN |