Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization cache first frame in opengl.c using double framebuffer #279

Closed
frmz opened this issue Apr 19, 2016 · 2 comments
Closed

Optimization cache first frame in opengl.c using double framebuffer #279

frmz opened this issue Apr 19, 2016 · 2 comments

Comments

@frmz
Copy link
Contributor

frmz commented Apr 19, 2016

I think having 2 framebuffers, one static with the first (0) frame and one dynamic with current one currently drawing on GL texture would reduce the CPU usage drastically. With current implementation having full screen animated GIFs is not possible, CPU usage is too high and most of the work is done on frame 0.

@frmz
Copy link
Contributor Author

frmz commented Apr 20, 2016

A probably even better solution for OpenGL would be keeping the last key frame (0 or whatever) in the framebuffer and then when doing a partial rendering in render frame use GlTexSubImage2D which can replace only a region of the image, this would allow to work directly on the GL FB.

So, replace blitNormal function with something that uses the GlTexSubImage2D to replace pixels / regions would be extremely faster, OR, if this is too complex, returning the dirty region would also improve things a LOT and its easier, so "seek" will basically set info->dirtyRegion rect to something and then drawFrameGL will use GlTexImage2D if rect is null or GlTexSubImage2D if rect contains a region. This should be quite easy to do and would make things probably 3-4 times faster, maybe more.

@koral--
Copy link
Owner

koral-- commented May 4, 2016

It seems that everything from this issue is covered by final version of #287, so I'm closing this one.

@koral-- koral-- closed this as completed May 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants