-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Clear render cache when software rendering #3632
Clear render cache when software rendering #3632
Conversation
Thanks for the contribution - but this is surely too fast? The refresh call here is not called once per paint but once per object - so this could be called hundreds of times per draw frame. |
Yes it is called more than required but the cache.Clean returns early almost all of the time at least. You might not remember but I discussed this with you briefly on Discord. The problem is that if you are using software rendering then the cache is never cleared. This becomes a problem if you use the List widget at least because the cache holds references to widgets (list items) that would otherwise be GC'd. I considered making an exported function for clearing the cache instead but that also doesn't feel right. |
I was thinking about this last night and I can't remember why I thought putting it in testcanvas.Capture() was a worse option so I'm thinking about moving it there now if that would be better @andydotxyz . |
2eb12d1
to
416c1b7
Compare
Thanks for this. |
The issue is 2069 which was addressed in the mobile and glfw drivers here. This is to try to address that same issue but for the software driver. My understanding of the cache clearing is it is only removing items that haven't been used for > 1 minute so clearing it before drawing makes no difference if you are redrawing the same widgets continuously. But if you change the content on the canvas then after 1 minute the renderers for content that is no longer being drawn will be cleared. |
Ah apologies you are quite right - I had mistaken it for a cache reset! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
|
Description:
Each time testcanvas.Refresh is called we tell the render cache that it can be cleaned.
This gives the render cache a chance to be cleared when using the test canvas for software rendering.
This should have no impact on most users.
There isn't an open issue for this but it is essentially the same as 2069
Checklist: