| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| int height, width; | ||
| unsigned char *data_ptr; | ||
| int x1, x2, y1, y2; | ||
| if (!PyArg_ParseTuple(args, "O(iin)(iiii)", |
There was a problem hiding this comment.
Add a function name here?
Sorry, something went wrong.
| } | ||
| PyObject *py_photo_name; | ||
| char const *photo_name; | ||
| Tk_PhotoHandle photo; |
There was a problem hiding this comment.
and these too?
(edit: oops, should go below the next)
Sorry, something went wrong.
| &x1, &x2, &y1, &y2)) { | ||
| goto exit; | ||
| } | ||
| PyObject *py_tk, *py_interpaddr; |
There was a problem hiding this comment.
Probably should all have defaults?
Sorry, something went wrong.
|
all comments handled |
Sorry, something went wrong.
| block.height = y2 - y1; | ||
| block.pitch = 4 * width; | ||
| block.pixelSize = 4; | ||
| block.offset[0] = 0; |
There was a problem hiding this comment.
Can you use this to avoid the buf.take copy?
Sorry, something went wrong.
There was a problem hiding this comment.
done
Sorry, something went wrong.
|
@mattip Can you verify that this still works with pypy? |
Sorry, something went wrong.
There was a problem hiding this comment.
Modulo confirmation that this still works on pypy
Sorry, something went wrong.
|
Moved some more work to Python's side, avoiding any need for refcounting at all in the C extension. |
Sorry, something went wrong.
|
works fine on PyPy just like before the PR (with the nightly builds, not the latest release) Thanks for pinging me |
Sorry, something went wrong.
| return Py_None; | ||
| } | ||
|
|
||
| static PyObject *mpl_tk_blit(PyObject *self, PyObject *args) { |
There was a problem hiding this comment.
Opening function braces go on a new line.
Sorry, something went wrong.
There was a problem hiding this comment.
yup, fixed
Sorry, something went wrong.
... to use the standard Python C-API rather than the tk API. We do not need to support colormodes other than 2 (i.e. RGBA) (previously there was 0 = grayscale, 1 = RGB) so it was simpler to just deprecate the previous function and move everything to a new private one (matplotlib.backends._backend_tk.blit).
| Back | FazBrowse Home | New Git URL |
... to use the standard Python C-API rather than the tk API.
We do not need to support colormodes other than 2 (i.e. RGBA)
(previously there was 0 = grayscale, 1 = RGB) so it was simpler to just
deprecate the previous function and move everything to a new private one
(matplotlib.backends._backend_tk.blit).
Followup to #10486 (comment).
PR Summary
PR Checklist