Results 44 comments of MeetWq

I wrote a [script](https://github.com/MeetWq/skia-python/blob/format_code/split_declarations_and_definitions.py) to split the pybind11 class declarations and method definitions (though the implementation is rather stupid). The whole modification process is in the [format_code ](https://github.com/MeetWq/skia-python/tree/format_code) branch. Maybe...

`BBoxHierarchy.search` is a virtual method, I have no idea how to test it.

I found there is a `RTreeFactory` class that can generate `RTree` class, which is derived from `BBoxHierarchy`. It can be used for test.

> We have code that binds `BBoxHierarchy.search` so either that's a mistake (not invokable, and should be removed) or should be tested... I think it should be invokable if not...

https://github.com/kyamagu/skia-python/blob/832cb4e733548dedc6fa93f59066e149329ba4d3/src/skia/Picture.cpp#L30-L35 By the way, I'm confused about the signature of `BBoxHierarchy.insert` and `BBoxHierarchy.search`. When I testing the two methods, I found that: - I can only pass one `skia.Rect` object...

> I think the skia-python code is at least for the search method looks wrong - pybind11 in general cannot fill an input pointer with fetched stuff, so the search...

I've modified the API and tests, and ported some tests from google skia: https://gist.github.com/MeetWq/0a0390f0a3aadb5beaaad310401398fd

I followed the example in https://pybind11.readthedocs.io/en/stable/advanced/classes.html#different-method-signatures The class `PyBBoxHierarchy` is a 'trampoline' for overriding virtual functions in Python. I'm not so sure I got it right, but the test in...

The adjustment in `PyBBoxHierarchy` is for extending `BBoxHierarchy` in python, it's different from the signature override in https://github.com/MeetWq/skia-python/blob/ffcb64e5ba33f2aaf64d4de1ab9801398ce188bb/src/skia/Picture.cpp#L328

As in https://pybind11.readthedocs.io/en/stable/advanced/misc.html#global-interpreter-lock-gil > When writing C++ code that is called from other C++ code, if that code accesses Python state, it must explicitly acquire and release the GIL. There...