y-axis flipped issue when use evas gl backend got fixed.
authorFengqian.Gao <Fengqian.gao@intel.com>
Wed, 12 Jun 2013 09:07:11 +0000 (11:07 +0200)
committerjinhyung.jo <jinhyung.jo@samsung.com>
Wed, 11 Sep 2013 09:03:19 +0000 (18:03 +0900)
tizen/src/hw/gloffscreen.h
tizen/src/hw/gloffscreen_agl.c
tizen/src/hw/gloffscreen_wgl.c
tizen/src/hw/gloffscreen_xcomposite.c
tizen/src/hw/opengl_exec.c

index 11547c7..f317619 100644 (file)
@@ -86,7 +86,7 @@ extern void glo_surface_update_context(GloSurface *surface, GloContext *context,
 /* Link the pixmap/pbuffer associated with surface as texture.
  * ctxt is the target context for the texture operation
  */
-extern void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface);
+extern void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface, int surface_type);
 
 /* Create a surface with given width and height, */
 extern GloSurface *glo_surface_create(int width, int height, GloContext *context);
index 2070bad..33e38c5 100644 (file)
@@ -335,7 +335,7 @@ void glo_surface_get_size(GloSurface *surface, int *width, int *height)
 } 
  
 /* Bind the surface as texture */
-void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface)
+void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface, int surface_type)
 {
 #if 0
        //Not QUit sure about this function;
index 10ceb48..aa8d0ad 100644 (file)
@@ -958,7 +958,7 @@ void glo_surface_get_size(GloSurface *surface, int *width, int *height) {
 }
 
 /* Bind the surface as texture */
-void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface)
+void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface, int surface_type)
 {
 #if 0
     int glFormat, glType;
index 7c04331..9887cc0 100644 (file)
 #include "gl_mangled.h"
 #endif
 
+enum{
+    SURFACE_WINDOW,
+    SURFACE_PIXMAP,
+    SURFACE_PBUFFER,
+};
+
 void *g_malloc(size_t size);
 void *g_realloc(void *ptr, size_t size);
 void g_free(void *ptr);
@@ -483,7 +489,7 @@ void glo_surface_get_size(GloSurface *surface, int *width, int *height) {
 }
 
 /* Bind the surface as texture */
-void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface)
+void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface, int surface_type)
 {
 #if 0
     void (*ptr_func_glXBindTexImageEXT) (Display *dpy, GLXDrawable draw, int buffer, int *attrib_list);
@@ -508,6 +514,8 @@ void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface)
     /* 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(surface_type == SURFACE_PBUFFER)
+   {
     if ((glFormat == GL_RGBA || glFormat == GL_BGRA) && glType == GL_UNSIGNED_BYTE) {
         GLubyte *b = (GLubyte *)surface->image->data;
         int stride = surface->width * 4;
@@ -524,6 +532,8 @@ void glo_surface_as_texture(GloContext *ctxt, GloSurface *surface)
         }
         g_free(tmp);
     }
+   }
+
     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, surface->width, surface->height, 0, glFormat, glType, surface->image->data);
 #endif
 }
index b764de6..bb8d1f5 100644 (file)
@@ -2050,7 +2050,7 @@ int do_function_call(ProcessState *process, int func_number, unsigned long *args
                 /* If this pixmap is linked as texture previously */
                                if (link_drawable(process, client_drawable))
                                        glo_surface_as_texture(process->current_state->context,
-                                                       qsurface->surface);
+                                                       qsurface->surface, qsurface->type);
 
 
                 ret.i = client_drawable;
@@ -2094,7 +2094,7 @@ int do_function_call(ProcessState *process, int func_number, unsigned long *args
                 }
             }
             else
-                               glo_surface_as_texture(process->current_state->context, qsurface->surface);
+                               glo_surface_as_texture(process->current_state->context, qsurface->surface, qsurface->type);
 
                        break;
                }
@@ -2110,7 +2110,7 @@ int do_function_call(ProcessState *process, int func_number, unsigned long *args
                                add_pixmap_texture_mapping(process->current_state,
                                                process->current_state->bindTexture2D,
                                                client_drawable);
-                               glo_surface_as_texture(process->current_state->context, qsurface->surface);
+                               glo_surface_as_texture(process->current_state->context, qsurface->surface, qsurface->type);
                                ret.i = 1;
                        }
                        else
@@ -2221,7 +2221,7 @@ int do_function_call(ProcessState *process, int func_number, unsigned long *args
 
                     if ( qsurface )
                     {
-                        glo_surface_as_texture(process->current_state->context, qsurface->surface);
+                        glo_surface_as_texture(process->current_state->context, qsurface->surface, qsurface->type);
                         fprintf(stderr, "edwin:bindtexture: drawable=0x%x,qsurface=%p.\n", drawable, qsurface);
                     }
                 }