Wykres commitów

56 Commity (patch-exception-handling)

Autor SHA1 Wiadomość Data
Phil Howard fd21d61bea PicoVector: Fix find_glyph char to uint16_t.
Allow find_glyph to find 16-bit unicode codepoints (icons, yay!).
2025-05-22 16:00:59 +01:00
Phil Howard fba0f1c962 PicoVector: Add tracked memory alloc, track the node buffer.
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.)
2025-05-09 17:11:27 +01:00
ihaanaho 7a894dc512 PicoVector: Add support for utf-8 characters. 2025-04-25 17:43:13 +01:00
Mike Bell d84a1e3470 PicoVector: Faster polygon rendering. 2025-04-25 17:33:53 +01:00
Phil Howard 5e114e97c4 PicoVector: AF: Support for 16bit point count.
Somewhere in the conversion from C++ to C we lost support for 16-bit point counts.

Raise the internal point count to 16-bit, and check for a flag in the font.

If the flag is set, treat the point count as 16-bits, otherwise fallback to 8 for back compatibility.
2025-04-25 17:33:53 +01:00
Phil Howard 0d96ec051b PicoVector: Fix fonts not rendering with no transform set. 2025-04-25 17:33:53 +01:00
Mike Bell 807d4ba7ef PicoVector: Fix ppp arc memory corruption. 2025-04-25 17:33:52 +01:00
Mike Bell 82c3b73655 PicoVector: Fully initialise text metrics. 2025-04-25 17:33:52 +01:00
Phil Howard 27bd5eecde PicoVector: Initialise pp_transform().
For some reason this was unset causing drawing to fail.

Reset it to a known good state in the constructor.
2025-04-25 17:33:52 +01:00
Phil Howard 4c55038f94 PicoVector: Fix bug in Polygon.rectangle.
Fix spurious point in top-left corner causing a broken triangular
rectangle when any permutation of corners other than the bottom-left
is rounded.
2025-04-25 17:33:52 +01:00
Phil Howard f900761280 PicoVector: Tweak for C++ compatibility. 2025-04-25 17:33:52 +01:00
Mike Bell bebadbba72 PicoVector: Avoid clipping bottom right AA edges. 2025-04-25 17:33:52 +01:00
Jonathan Williamson a0f35a6834 PicoVector: Add star and line primitives. 2025-04-25 17:33:52 +01:00
Phil Howard d2728d4b06 PicoVector: Avoid MicroPython GC.
Since we're not using tracked allocation, any memory we don't explicitly
hold a reference to will be assumed unused by MicroPython's GC.

Pass up the pp_nodes and pp_node_counts points (hackily) to fix this.
2025-04-25 17:33:52 +01:00
Phil Howard 78eb6da31b PicoVector: Remove * 4 from pp_nodes lookup. 2025-04-25 17:33:52 +01:00
Mike Bell d1ec50bc3f PicoVector: Apply overall transform to text rendering. 2025-04-25 17:33:52 +01:00
Mike Bell 650fcf6697 PicoVector: Add optional text max width and max height. 2025-04-25 17:33:52 +01:00
Phil Howard 8d8b950308 PicoVector: Revert the tile buffer to be fixed.
Ensure that MicroPython doesn't ever place the tile buffer into PSRAM
and trash performance.
2025-04-25 17:33:52 +01:00
Phil Howard 8f7c1b3c70 PicoVector: Runtime buffer allocation. 2025-04-25 17:33:52 +01:00
Phil Howard 859a9d8b61 PicoVector: Prefix some pretty-poly variables. 2025-04-25 17:33:52 +01:00
Phil Howard b40818c900 PicoVector: Refactor text multiline support.
Drop dependence on null terminated strings, and for a final linebreak.

Bound all text processing using the text length.
2025-04-25 17:33:52 +01:00
Phil Howard 8f7e8d4334 PicoVector: Improve text rendering and control. 2025-04-25 17:33:52 +01:00
Phil Howard 75a01b2fb8 PicoVector: Big refactor, ppp primitives.
* 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
2025-04-25 17:33:52 +01:00
Phil Howard 1115900443 PicoVector: Rewrite around new linked-lists poly. 2025-04-25 17:33:52 +01:00
Phil Howard faf675c9f8 PicoVector: Use tile renderer for all pens. 2025-04-25 17:33:52 +01:00
Phil Howard ed494ecf20 PicoVector: Fix x16 anti-aliasing. 2025-04-25 17:33:52 +01:00
Phil Howard db4670bb8e PicoVector: C++ basic bringup. 2025-04-25 17:33:52 +01:00
Phil Howard e2ce6eb416 PicoVector: render text that doesn't end with a linebreak. 2025-04-25 17:33:52 +01:00
Phil Howard e48c798bdb PicoVector: Fix out of bounds drawing.
pretty-poly.h is not giving us fully clipped rectangles, so revert to the
slower bounds checked pixel for now.
2025-04-25 17:33:52 +01:00
Phil Howard 56d430b862 PicoVector: fix pointer arithmatic in af_load_font_file.
Pointers were being incremented as if they were bytes, rather than larger
containers.
2025-04-25 17:33:52 +01:00
Phil Howard 116df431fb PicoVector: Break things until they work. 2025-04-25 17:33:52 +01:00
Phil Howard 9c0e696230 PicoVector: alright-fonts bringup. 2025-04-25 17:33:52 +01:00
Phil Howard 9250e129db PicoVector: Swap rotate translation order. 2025-04-25 17:33:52 +01:00
Phil Howard 116268b6f5 PicoVector: Vendor pretty-poly and tweak rotation. 2025-04-25 17:33:52 +01:00
Phil Howard a7a98ae3aa PicoVector: Suppress errors.
Ignore sign compare and narrowing conversion errors in pretty-poly.h.
2025-04-25 17:33:52 +01:00
Phil Howard 9f1d68dbec PicoVector: Rewrite around new C pretty-poly.h. 2025-04-25 17:33:52 +01:00
Phil Howard 5f730ff400 PicoVector: Pass PicoGraphics clip into Pretty Poly. 2023-09-12 12:03:09 +01:00
Philip Howard c3919bd648
Merge pull request #840 from MichaelBell/patch-pretty-poly-perf
Improve pretty_poly performance
2023-09-11 12:03:25 +01:00
Philip Howard ed3ce45f00
Merge pull request #842 from MichaelBell/patch-fix-text-newline
Fix newlines in rotated text
2023-09-11 11:37:38 +01:00
Philip Howard 1a7deaab71
Merge pull request #841 from MichaelBell/patch-fix-vector-transform
Initialize all matrix values
2023-09-11 11:36:52 +01:00
Mike Bell 80e1e16782 Fixes from compiling with gcc 12 2023-09-10 21:02:16 +01:00
Mike Bell cdd648f3f6 Small improvements to rotated font rendering 2023-09-10 17:20:44 +01:00
Mike Bell 81f42f25b6 Fix newlines in rotated text 2023-09-10 17:20:10 +01:00
Mike Bell 841c141ebf Interpolators for line segment, and faster transforms 2023-09-10 13:22:21 +01:00
Mike Bell c812eec432 Initialize all matrix values 2023-09-10 13:18:13 +01:00
Mike Bell 41eb2b503e Additional improvements to pretty_poly 2023-09-10 00:08:35 +01:00
Mike Bell 581481c2ef Improve pretty_poly performance
(cherry picked from commit 1077a12ff4fd958a7ea6d9e4fa5a86551eba5126)
2023-09-09 01:30:10 +01:00
Mike Bell e908d5e53e Allow pen function for fast tile alpha blending 2023-09-08 23:48:16 +01:00
Phil Howard c443f8d206 PicoVector: Tweak polygon tile rendering loop. 2023-08-22 09:32:28 +01:00
Phil Howard cfe8b3c096 PicoVector: Text rotation support. 2023-08-22 09:32:28 +01:00