[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [E-devel] Evas GL engine patch

On Fri, 29 Dec 2006 10:55:28 +0900,
Carsten Haitzler (The Rasterman) <raster@rasterman.com> wrote :

> On Sun, 10 Dec 2006 12:37:20 +0100 Simon TRENY <simon.treny@free.fr>
> babbled:
> > Hi,
> > 
> > The GL engine of Evas has an annoying bug when you want to create
> > several windows using this engine: when you create or resize a
> > window, all the other windows already created are not redrawn
> > correcly, only the last created/resized window has no problem. I've
> > attached a shot that shows what happens when you create a new
> > window while there is an existing window that already uses the GL
> > engine. Please have a look at it if you want to understand the
> > problem.
> > 
> > So, in this example, the "Etk Test Application" is created first,
> > and when the "Entry" button is clicked, the "Etk Entry Test" window
> > is created. You can see that the "Etk Test Application" is no longer
> > rendered correctly. Actually, only the part of the window that is
> > inside the red rectangle (added with the Gimp) is correctly
> > refreshed, the other part of the window does not refresh anymore.
> > You can also notice that the red rectangle has exactly the same
> > size as the "Etk Entry Test" window.
> > 
> > In fact, the problem is that when you create/resize a window,
> > _evas_gl_common_viewport_set() is called, and this function changes
> > the GL viewport and the view matrices. The thing is, these changes
> > affect all the windows, not only the created/resized window. A way
> > to fix that would be to call _evas_gl_common_viewport_set() each
> > time a window is rendered, before the rendering process begins (at
> > the start of the function evas_render_updates_internal() for
> > example). Only thing, I can't see a function that is called at the
> > start of the rendering process in the engine API (something like
> > pre_render()).
> > 
> > I've written a small patch that calls
> > _evas_gl_common_viewport_set() in the eng_output_redraws_rect_add()
> > method of the gl_x11 engine (because this method is called at the
> > start of the rendering process) just as a proof that it could fix
> > the bug, but this is definitely not the place to put this code. The
> > patch is attached.
> > 
> > Please tell me what you think.
> that patch will do (not perfect - i think it's just masking the
> problem, but it shouldn't cause problems, and if ti fixes it for now
> - good). patch into my local tree - when i commit my latest changes
> it will go in. :)

The patch that I submitted was just some sort of proof that it could
work. As I said, it calls evas_gl_common_context_resize() in the
output_redraws_rect_add() method of the gl_x11 engine, which is
definitely not a good idea since this function is called several times
at the start of the rendering process. A better way to avoid this would
be to add a pre_render() method to the engine API, and to call this
method once at the start of the rendering process. We could then call
evas_gl_common_context_resize() in this method. This way, the viewport
will be reset only once during the rendering process.

Do you want me to write a patch that does that?? It'll be a lot cleaner

Simon TRENY <MoOm>