Title: [MNT]: macOS backend likely double-draws renderer output · Issue #31875 · matplotlib/matplotlib · GitHub
Open Graph Title: [MNT]: macOS backend likely double-draws renderer output · Issue #31875 · matplotlib/matplotlib
X Title: [MNT]: macOS backend likely double-draws renderer output · Issue #31875 · matplotlib/matplotlib
Description: Summary Right now, -[View drawRect:] does the following: Acquires the GIL. Calls get_renderer() to get the agg renderer Calls buffer_rgba() to get a memoryview of the buffer. Performs a malloc() and copies the contents to the new buffer....
Open Graph Description: Summary Right now, -[View drawRect:] does the following: Acquires the GIL. Calls get_renderer() to get the agg renderer Calls buffer_rgba() to get a memoryview of the buffer. Performs a malloc() an...
X Description: Summary Right now, -[View drawRect:] does the following: Acquires the GIL. Calls get_renderer() to get the agg renderer Calls buffer_rgba() to get a memoryview of the buffer. Performs a malloc() an...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/31875
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[MNT]: macOS backend likely double-draws renderer output","articleBody":"### Summary\n\nRight now, `-[View drawRect:]` does the following:\n\n1. Acquires the GIL. \n2. Calls `get_renderer()` to get the agg renderer\n3. Calls `buffer_rgba()` to get a memoryview of the buffer.\n4. Performs a `malloc()` and copies the contents to the new buffer.\n5. Wraps in CGDataProviderRef, then CGImageRef\n6. Draws into the View's buffer via `CGContextDrawImage()`\n7. View's buffer is then composited to the window's buffer.\n8. Releases the GIL.\n\nWe can probably merge Step 6 / Step 7 by using a layer-backed view and setting `CALayer.contents` directly. There may be more optimizations here as well, if we can directly \"push\" a buffer to the view rather than relying on the `-drawRect:` call during the render cycle.\n\nIn either case, the rubberband would need to be a separate layer or view (non-opaque).\n\n### Proposed fix\n\n_No response_","author":{"url":"https://github.com/iccir","@type":"Person","name":"iccir"},"datePublished":"2026-06-12T03:26:11Z","url":"https://github.com/matplotlib/matplotlib/issues/31875"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5547bdf3-dc0e-e74b-6841-54ad99ae27fd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 999E:32CBBB:19FAAD6:2265D52:6B067F27 |
| html-safe-nonce | 2f98958b05ebd4652b4eecb5a91ea6bfec5f257c5bd7a50a1bdb9f99586e0c62 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTlFOjMyQ0JCQjoxOUZBQUQ2OjIyNjVENTI6NkIwNjdGMjciLCJ2aXNpdG9yX2lkIjoiNzE2MzM3MjcyNTUzMTQ3NTc1MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 06fa670c1c35206f934e6466b16c9bf219eaf6385c9719a25769ee8e3735829f |
| hovercard-subject-tag | issue:4645994327 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/31875/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5d72412eeb96dbfa7c87d369b3752b6647103f4f0bcbc1e0c63ee14137afc519/matplotlib/matplotlib/issues/31875 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5d72412eeb96dbfa7c87d369b3752b6647103f4f0bcbc1e0c63ee14137afc519/matplotlib/matplotlib/issues/31875 |
| og:image:alt | Summary Right now, -[View drawRect:] does the following: Acquires the GIL. Calls get_renderer() to get the agg renderer Calls buffer_rgba() to get a memoryview of the buffer. Performs a malloc() an... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | iccir |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4462ff7ebfd3d551f202659f2423dae617b6849d23b1df6465dc504ef497d14a |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6d3909414814ff86ce7da4c51a0f4918a13fb41b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width