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

Improved SWF loading speed #509

Closed
wants to merge 4 commits into from
Closed

Conversation

oomek
Copy link
Collaborator

@oomek oomek commented Nov 23, 2018

The speed gain is quite significant as shown in the video.
https://youtu.be/Y7nlfugz5wo

Detailed description in commits.

Moved sf::Context to FePresent, so it's shared between all SWF instances.
Moved glOrtho() to FePresent to avoid Y axis flipping when glOrtho() is called more than once in a shared context.
Fixed vram leak (caused by the previous commit) by encapsulating all m_texture calls within the swf_context.
Moved m_texture to heap so it can be cleared after activating the context.
Added missing flag check so the swf does not start when NoAutoStart flag is set.
Removed redundant glPushAttrib which was throwing GL_STACK_OVERFLOW
Removed unneccesary setSmooth()
Moved get_swf_context() call to the FeSwf constructor.
@oomek oomek requested a review from mickelson November 23, 2018 14:19
@oomek
Copy link
Collaborator Author

oomek commented Dec 20, 2018

Have you had time to take a look at this PR? Currently SWF loading is very laggy. This fix speeds up the SWF loading 10x or more.

@mickelson
Copy link
Owner

Thanks for this.

MY preference is to continue with the model of keeping the swf-rendering specific code in swf.cpp/swf.hpp... take a look at #524 which I think should have the same loading improvement as this PR, let me know if you have any concerns...

mickelson added a commit that referenced this pull request Dec 26, 2018
* alternative implementation of Oomek's work in PR #509
* Instead of creating a context for each swf object we now reuse a single context for all swf
* removed call to glPushAttrib( GL_ALL_ATTRIB_BITS )
@mickelson
Copy link
Owner

Implemented with #524

@mickelson mickelson closed this Dec 26, 2018
@oomek oomek deleted the swf-loading-fix branch December 30, 2018 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants