Skip to content

Tighten a bit the RendererAgg API. #17788

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

Merged
merged 2 commits into from
Jul 18, 2020
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jun 28, 2020

The get_content_extents and tostring_rgba_minimized methods of
RendererAgg are used to implement 1) agg_filter and 2) rasterization in
MixedModeRenderer (i.e. for vector backends). They can easily instead
be implemented at the Python level (i.e., via _get_nonzero_slices),
which makes it easier to plug in an alternative renderer (e.g.,
mplcairo) for rasterization in MixedModeRenderer. I'm not convinced
_get_nonzero_slices needs to be exposed as public API (it's quite simple
anyways), but it could be if we absolutely want to present an
alternative for the deprecated methods.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer added this to the v3.4.0 milestone Jun 28, 2020
@anntzer anntzer force-pushed the rgbamin branch 3 times, most recently from 29c5d11 to ac64e25 Compare July 2, 2020 20:32
@anntzer
Copy link
Contributor Author

anntzer commented Jul 3, 2020

Actually I realized I could also rewrite get_content_extents in terms of _get_nonzero_slices, and immediately kill the C-level get_content_extents (in a second commit).

anntzer added 2 commits July 18, 2020 11:27
The get_content_extents and tostring_rgba_minimized methods of
RendererAgg are used to implement 1) agg_filter and 2) rasterization in
MixedModeRenderer (i.e. for vector backends).  They can easily instead
be implemented at the Python level (i.e., via _get_nonzero_slices),
which makes it easier to plug in an alternative renderer (e.g.,
mplcairo) for rasterization in MixedModeRenderer.  I'm not convinced
_get_nonzero_slices needs to be exposed as public API (it's quite simple
anyways), but it could be if we absolutely want to present an
alternative for the deprecated methods.
@timhoffm timhoffm merged commit bc9eb96 into matplotlib:master Jul 18, 2020
@anntzer anntzer deleted the rgbamin branch July 18, 2020 11:54
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.

3 participants