165 Commits

Author SHA1 Message Date
Hajime Hoshi 7c584ce219 vector: reset Path in the pool's put side rather than on get
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 14:58:27 +09:00
Hajime Hoshi 22b1889f7f vector: use RecyclableSubImage for efficent memory usage 2026-03-31 03:28:12 +09:00
Hajime Hoshi ba01e78022 vector: use sync.Pool to cache Path objects 2026-03-31 00:47:59 +09:00
Hajime Hoshi efab369512 all: go fix 2026-03-15 17:46:48 +09:00
Hajime Hoshi f650b2acd6 vector: bug fix: atlas size was not enough for antialias renderings
Closes #3377
2026-01-27 18:08:02 +09:00
Hajime Hoshi 1de8288361 vector: bug fix: FillPath crashed with FillRuleEvenOdd
Closes #3366
2026-01-01 01:13:47 +09:00
Hajime Hoshi 1f3fbdaea4 vector: refactoring 2025-12-28 18:36:44 +09:00
Hajime Hoshi c88990a815 vector: refactoring
This change also adds examples/vectorlegacy
2025-12-27 17:16:49 +09:00
Hajime Hoshi d12fd25017 vector: refactoring: organize files 2025-12-27 16:10:26 +09:00
Hajime Hoshi 7d0692124a vector: use destination bounds to allocate an image on atlas
Closes #3358
2025-12-11 00:53:41 +09:00
Hajime Hoshi 2a497a1515 vector: bug fix: currentRowHeight was not updated correctly
Updates #3357
2025-12-10 02:07:02 +09:00
Hajime Hoshi a0bbae6514 vector: bug fix: paths were unexpectedly clipped
Closes #3357
2025-12-10 01:55:37 +09:00
Hajime Hoshi 353b07a2d6 vector: reland: bug fix: a callback for an image and its sub-image should be treated correctly
Closes #3355
2025-12-05 03:08:47 +09:00
Hajime Hoshi 7309a47a30 Revert "vector: bug fix: a callback for an image and its sub-image should be treated correctly"
This reverts commit 41354b957b.

Reason: this change fails tests on Windows

Updates #3335
2025-12-05 01:03:17 +09:00
Hajime Hoshi 41354b957b vector: bug fix: a callback for an image and its sub-image should be treated correctly
Closes #3355
2025-12-05 00:48:18 +09:00
Hajime Hoshi a8a21ba687 ebiten, vector: bug fix: race conditions
This change fixes these race conditions in

 * (*ebiten.Image).invokeUsageCallbacks concurrent invocations
 * (*ebiten.Image).usageCallbacks usages
 * vector.theCallbackTokens usages
 * vector's global shader initializations

Closes #3333
2025-10-21 03:24:21 +09:00
Hajime Hoshi 5f08f4ae1d vector: bug fix: FillRect or other utility functions on a sub-image didn't work correctly
Closes #3330
2025-10-15 20:17:07 +09:00
Hajime Hoshi 55dfc79bfd vector: remove (*Path).ApplyGeoM
This was added in v2.9 and deprecated at the same time. Let's remove
this.

Updates #3266
2025-10-05 23:46:19 +09:00
Hajime Hoshi 187c074ca1 vector: skip a flaky test for browsers 2025-09-06 04:06:11 +09:00
Hajime Hoshi d234fdead6 vector: refactoring: remove unused functions 2025-09-06 03:16:45 +09:00
Hajime Hoshi 159eea683d vector: calculate the allowance value based on the size of a curve
This should improve the result of transforming a path with a
geometry matrix.

Updates #3311
2025-09-06 03:07:21 +09:00
Hajime Hoshi 793b869e73 vector: remove a hack at Close
This hack was introduced at 97ebef8298,
but it seems no longer needed.
2025-09-06 02:52:00 +09:00
Hajime Hoshi be98d0111c vector: add test for GeoM with arcs
The issue was already fixed by fcd3719a9a

Closes #3311
2025-09-06 00:58:22 +09:00
Hajime Hoshi fcd3719a9a vector: use radius to detect too close two points for ArcTo
Using a constant value is not good in the case when the path is
converted with a geometry matrix later.

Updates #3311
2025-09-06 00:45:22 +09:00
Hajime Hoshi 8c7417d07e vector: path 2025-09-06 00:27:02 +09:00
Hajime Hoshi e827d3d047 vector: bug fix: det can be too small at crossingPointForTwoLines
Closes #3290
2025-08-10 14:00:04 +09:00
Hajime Hoshi e4d514f2af vector: rename AddPathStroke -> AddStroke 2025-08-07 01:02:26 +09:00
Hajime Hoshi f0b95f97bc vector: add DrawOptions and change StrokePath and FillPath signatures
This commit adds DrawOptions so that rendering APIs can specify
blending.

This commit also changes the definition of FillRule so that
FillRuleNonZero becomes 0.

Closes #3287
2025-08-07 00:46:55 +09:00
Hajime Hoshi 97484baa2e vector: bug fix: len(ops) must be adjusted
Updates #3275
2025-07-19 23:51:44 +09:00
Hajime Hoshi db31e09387 vector: bug fix: wrong slice.Grow usage in (*Path).AddPath
Updates #3275
2025-07-19 23:49:33 +09:00
Hajime Hoshi ec3b073c18 vector: cache (*Path).isValid result
Updates #3275
2025-07-19 23:16:29 +09:00
Hajime Hoshi 19fb372da8 vector: adjust sub image sizes to encourage reusing cached sub images
Updates #3275
2025-07-19 22:36:18 +09:00
Hajime Hoshi 1284f09201 vector: avoid float32 min/max at (*Path).Bounds
Apparently min/max built-in functions for float32 seems slow, especially
on browsers. Let's use integers instead.

Updates #3275
2025-07-19 22:05:54 +09:00
Hajime Hoshi dd63a346e3 Revert "vector: performance optimization: make (*Path).isValid faster"
This reverts commit cc9aba5e9f.

Reason: this doesn't work when subPath is updated externally (e.g. AddPath)
2025-07-19 19:12:35 +09:00
Hajime Hoshi cc9aba5e9f vector: performance optimization: make (*Path).isValid faster
Updates #3275
2025-07-19 18:09:41 +09:00
Hajime Hoshi e9bda7a1df vector: refactring: replace pathRenderingBounds with pathRenderingPosition 2025-07-19 17:43:10 +09:00
Hajime Hoshi 741e0e76ca vector: reimplement sub image allocations
Instead of using internal/packing, use a more efficient way. As the
input bounds are already known, we can use an online algorithm.

Updates #3275
2025-07-19 17:30:25 +09:00
Hajime Hoshi beb50297c3 vector: change pathBounds to pathRenderingBounds
An element of pathRenderingBounds is bounds where a path is rendered,
rather than the path's original bounds.
2025-07-19 17:25:07 +09:00
Hajime Hoshi 83fd3bf46c vector: bug fix: an additional image for antialias must be on the same image 2025-07-19 16:49:39 +09:00
Hajime Hoshi 0d9e15292a vector: bug fix: allocation failed with too many paths
This change introduces the same packing algorithm with the internal
atlas to improve the image usages. Also, this change introduces
multiple atlas images so arbitrary number of paths are available.

Closes #3272
2025-07-18 02:57:40 +09:00
Hajime Hoshi a582f7dc49 vector: add (*Path).Bounds
Closes #3271
2025-07-18 02:39:08 +09:00
Hajime Hoshi 96d4c2ba61 vector: add test for StrokeRect with AA
Updates #3270
2025-07-15 23:47:25 +09:00
Hajime Hoshi 4f6ca3e704 vector: bug fix: use round to convert a float to an integer in Kage
In general, floating point numbers cannot represent a precise real
numbers. For example, even if a value 1.0/255.0 is multiplied by
255, the value might be slightly smaller than 1. In this case,
casting this value to an integer can be 0 instead of 1.

This change fixes this issue by introducing a round function.

Updates #3270
2025-07-15 23:35:35 +09:00
Hajime Hoshi 4cdb415469 vector: remove unused uniform variables 2025-07-15 23:32:36 +09:00
Hajime Hoshi e70941ce5f vector: remove wrong comment 2025-07-15 22:46:48 +09:00
Hajime Hoshi 7a2c2c038b vector: remove unnecessary floor 2025-07-15 22:23:35 +09:00
Hajime Hoshi b2f888a63d vector: remove AppendVerticesAndIndicesFor*32
These functions are now deprecated. Remove them before v2.9 is
released.

This is basically a revert for 3455c626fb.

Updates #3225
2025-07-14 00:57:31 +09:00
Hajime Hoshi 8eb4353ecc vector: optimize bounding boxes for quadratic Bézier curves
Closes #3269
2025-07-11 04:46:34 +09:00
Hajime Hoshi 7eaa1fdcdb vector: add more comments 2025-07-07 14:27:13 +09:00
Hajime Hoshi 6408f40a7f vector: avoid cross product 2025-07-07 14:03:57 +09:00