With a low GC threshold the node buffer was being collected (despite guards against this)
and causing further drawing operations to be corrupted.
Add a new tracked malloc method and use it for node buffers and font data.
Tweak pp_poly_add_path to accept a point count, avoiding many successive rellocs when
dealing with a known quantity of points (copying from an af_glyph_t.)
Remove pin definitions in anticipation of them moving to pins.csv.
Eg:
from plasma2040 import BUTTON_A
machine.Pin(BUTTON_A)
Should become:
machine.Pin("BUTTON_A")
This is required for MicroPython error text compression which is
going to be enabled by default for RP2 builds.
We have a lot of error messages, so the potential flash gain here
is worth the effort of making this work.
* Store a reference to transform, so `set_transform(Transform())` is not GC'd until it is replaced
* Transformations return the transform, allowing chaining: `transform.rotate().scale().translate()`
* A new `get_transform` method for getting the currently set transform.
Remove the finalizer from PNGDEC and JPEGDEC, since it was both redundant
and actively harmful.
The finalizer was just calling "close" which is unecessary since the file
is closed automatically after opening/rendering and not left open.
If a file did not exist and "open_file" bailed with ENOENT then it would
be left in an unknown state, and the finalizer calling "close" would
cause a hardlock.
list(Polygon) should return a list of points, but crashed with non-empty polygons.
We were advancing to the next path and then retriving an invalid point count for building the tuple.
Save the point count before advancing to the next path.
* Remove Polygon types in favour of primitives .circle, .rectangle etc
* Add a new Transform type for building up transformation matrices
* Add support to set/clear transform on drawing