From: Fengqian.Gao Date: Wed, 12 Jun 2013 09:07:11 +0000 (+0200) Subject: y-axis flipped issue when use evas gl backend got fixed. X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~749^2~41 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=040137a3b355c82b3158c9df949faee512f81098;p=sdk%2Femulator%2Fqemu.git y-axis flipped issue when use evas gl backend got fixed. --- diff --git a/tizen/src/hw/gloffscreen.h b/tizen/src/hw/gloffscreen.h index 11547c71be..f317619baa 100644 --- a/tizen/src/hw/gloffscreen.h +++ b/tizen/src/hw/gloffscreen.h @@ -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); diff --git a/tizen/src/hw/gloffscreen_agl.c b/tizen/src/hw/gloffscreen_agl.c index 2070bade76..33e38c55ee 100644 --- a/tizen/src/hw/gloffscreen_agl.c +++ b/tizen/src/hw/gloffscreen_agl.c @@ -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; diff --git a/tizen/src/hw/gloffscreen_wgl.c b/tizen/src/hw/gloffscreen_wgl.c index 10ceb48dd5..aa8d0ad0a1 100644 --- a/tizen/src/hw/gloffscreen_wgl.c +++ b/tizen/src/hw/gloffscreen_wgl.c @@ -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; diff --git a/tizen/src/hw/gloffscreen_xcomposite.c b/tizen/src/hw/gloffscreen_xcomposite.c index 7c043318a7..9887cc0572 100644 --- a/tizen/src/hw/gloffscreen_xcomposite.c +++ b/tizen/src/hw/gloffscreen_xcomposite.c @@ -44,6 +44,12 @@ #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 } diff --git a/tizen/src/hw/opengl_exec.c b/tizen/src/hw/opengl_exec.c index b764de6b92..bb8d1f5ece 100644 --- a/tizen/src/hw/opengl_exec.c +++ b/tizen/src/hw/opengl_exec.c @@ -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); } }