MNT: Towards standardizing widget blitting #30974
Open
+36
−26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a step towards #30503.
To have standard logical framework for blitting of widgets, we pull some logic up into AxesWidget:
_useblitvariable. This is now part of AxesWidget, and better explained there 😄AxesWidget._should_use_blit()returns whether blitting should currently be done - i.e. the user/widget requested it and the canvas supports it. This is used to guard all blitting-related code.Note: This is a well-defined and limited step towards standardization. Not all widgets are already using it. Some still have special logic. I anticipate that migrating them will be easier when this infrastructure and logical concept is present. Changes here are limited to obvious cases. The rest will be handled in a follow-up PR.