antognolli pushed a commit to branch evas-1.7.

commit 9c4fcaf84ba7b3a6e08301d5f3682a80c7dd60fd
Author: Rafael Antognolli <[email protected]>
Date:   Thu Jun 13 19:24:56 2013 -0300

    backport: evas/gl: Restore framebuffer after texture creation.
    
    If we don't do this, the framebuffer object used on
    shader_array_flush() will be wrong.
    
    NOTE: shader_array_flush() should take care of setting the
    fbo correctly.
---
 ChangeLog                                       | 4 ++++
 src/modules/engines/gl_common/evas_gl_texture.c | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4639705..e092469 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1311,3 +1311,7 @@
 2013-06-11  Stefan Schmidt
 
        * Evas texgrid: Fix memory leak
+
+2013-06-13  Rafael Antognolli
+
+        * Evas GL: Restore framebuffer after texture creation.
diff --git a/src/modules/engines/gl_common/evas_gl_texture.c 
b/src/modules/engines/gl_common/evas_gl_texture.c
index 4311f33..694232a 100644
--- a/src/modules/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/engines/gl_common/evas_gl_texture.c
@@ -358,6 +358,7 @@ static Evas_GL_Texture_Pool *
 _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, 
int format)
 {
    Evas_GL_Texture_Pool *pt;
+   int fnum;
 
    pt = calloc(1, sizeof(Evas_GL_Texture_Pool));
    if (!pt) return NULL;
@@ -390,7 +391,7 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int 
h, int intformat, in
    texinfo.r.pix += pt->w * pt->h;
 
    _print_tex_count();
-
+   glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fnum);
    glGenTextures(1, &(pt->texture));
    GLERR(__FUNCTION__, __FILE__, __LINE__, "");
    glBindTexture(GL_TEXTURE_2D, pt->texture);
@@ -411,7 +412,7 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int 
h, int intformat, in
    GLERR(__FUNCTION__, __FILE__, __LINE__, "");
    glsym_glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, 
GL_TEXTURE_2D, pt->texture, 0);
    GLERR(__FUNCTION__, __FILE__, __LINE__, "");
-   glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
+   glsym_glBindFramebuffer(GL_FRAMEBUFFER, fnum);
    GLERR(__FUNCTION__, __FILE__, __LINE__, "");
 
    glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);

-- 

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

Reply via email to