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

Fix #6335: Queue boxes to update #6339

Merged
merged 3 commits into from May 2, 2016

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Apr 26, 2016

This fixes the issue where multiple animating axes would not all get updated. The reason this was broken is because blit sets a region to update, but there may be multiple blits between each opportunity to actually paint to the screen (on idle), so some will get thrown out. This changes things so there is a list (queue) of bounding boxes to update instead.

There is still the issue with glitchiness on resizing that I haven't been able to solve as easily.

Fixes #6335

@mdboom mdboom added this to the 2.0 (style change major release) milestone Apr 26, 2016
@tacaswell
Copy link
Member

Probably on the resize event also nuke the blit quue?

@mdboom
Copy link
Member Author

mdboom commented Apr 26, 2016

Probably on the resize event also nuke the blit quue?

Strangely doesn't work.

@WeatherGod
Copy link
Member

Would it make sense to utilize collections.deque here? Considering that blitting is for performance reasons, it might make sense to use it.

@mdboom
Copy link
Member Author

mdboom commented Apr 26, 2016

Would it make sense to utilize collections.deque here?

No, only matters if you care about the ordering of the popping, which we don't here.

@WeatherGod
Copy link
Member

Strangely doesn't work.

Could it be due to the stale flag?

@tacaswell
Copy link
Member

unlikely, that only gets considered to decide if there should be a full re-draw.

@mdboom
Copy link
Member Author

mdboom commented Apr 27, 2016

@dopplershift: The last commit here (5bde1ff) resolves the "glitches upon resize" issue (where the base parts of the figure outside of the blitted axes were not redrawn on resize). I have no idea if that's the right fix, but it should only decrease performance immediately after resizing -- it goes back to blitting only the minimal parts as normal right after that.

@WeatherGod
Copy link
Member

just had a thought. I don't know if it is applicable here or not. It is technically possible to have an animation that exists across figures (essentially, they would all share the same timer). Is this list of bboxes guaranteed to be only from the one figure being rendered?

@mdboom
Copy link
Member Author

mdboom commented Apr 27, 2016

The list of bboxes is sorted with the canvas which is 1-1 with figures. So even if they shared a timer (a single global resource), each figure would have its own list of bboxes.

@tacaswell
Copy link
Member

attn @mfitzp @pwuertz @TD22057 as people who I think have worked extensively with qt + blitting.

@pwuertz
Copy link
Contributor

pwuertz commented May 1, 2016

I'm wondering if the blitboxes could be first combined into a bounding box in order to reduce the process to a single blit, but I guess there may be situations where this isn't necessarily a good idea. So without further profiling knowledge this looks good.

@tacaswell tacaswell merged commit 20c2961 into matplotlib:master May 2, 2016
tacaswell added a commit that referenced this pull request May 2, 2016
@tacaswell
Copy link
Member

backported to v2.x as f6f1f13

Could probably justify backporting this to v1.5.x as well, but hopefully we will not do a 1.5.2 so the point is moot.

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.

subplots animation example is broken on OS X with qt4agg
4 participants