Follow on to https://github.com/rive-app/rive/pull/5877! Does similar work for the C++ runtime and reconsiders some naming, will likely need to fix some higher level runtimes @zplata.
I renamed the fired to reportedEvent and added in the time delay too.
Diffs=
f96c86fcc Timeline Events for runtime (#5951)
Fixes an issue introduced here https://github.com/rive-app/rive/pull/5849 where we added some extra smarts to keepGoing which didn't take the work area into account.
Adds tests to both editor and runtime!
Diffs=
853ae7de1 Fix keepGoing when a work area is used. (#5939)
Since the SIMD implementation currently only compiles on clang, this patch fixes the gcc compilation path by relying on the SIMD polyfill when compiling with gcc.
Also fixes some small issues when building Vello with gcc.
Diffs=
4335a2cd2 Fixed runtime to compile with gcc. (#5870)
Fix for issue caught by Pocketwatch where setting all the runs to empty strings results in no changes to the displayed text. We now handle this gracefully and update dimensions and paths to render accordingly.
Diffs=
c6b867df9 Allow setting text to completely empty. (#5924)
Adds map() and unmap() functions to RenderBuffer, and changes Mesh::draw() to map and update the vertex buffer instead of making a new one.
Also refactors RenderBuffer to just be a blob of data as opposed to an array of elements of fixed size and type. Removes the type-specific factory methods for creating RenderBuffers in favor of a single one that just takes a buffer type and buffer size.
Diffs=
06a187288 Make RenderBuffer mappable (#5907)
Adds a RIVE_MAKE_ENUM_BITFIELD() macro and accompanying EnumBitset<> class that allow us to treat strongly typed C++ enums as bitsets, including with an implicit bool conversion for expressions like "if (flags & Flags::myFlag)".
Diffs=
654d4488e Add a macro to create bitsets from enums (#5922)
The important checks are the ones done with the invertX&Y apply. The isJoystickFlagged checks are sanity checks, you could replace those with whatever you use for flag testing next @csmartdalton.
Note that the flag value is loaded via core (auto-generated) as a raw uint32_t:
eef7de3b1a/packages/runtime/include/rive/generated/joystick_base.hpp (L170)
Diffs=
7bbf083ce Add some joystick flag tests. (#5921)
We can let it be defined implicitly.
Also update some Rust formatting to match what the Rustfmt workflow
wants.
Diffs=
d35df0427 Delete the copy constructor from Mat2D (#5916)
Decided to go with the `is` check because it seems like all types of Constraints or ClippingShapes should follow this behavior now and in the future.
Diffs=
16cf8082f Treat Constraints, ClippingShapes and DrawRules as special Solo child types (#5897)
Fixes https://2dimensions.slack.com/archives/CLLCU09T6/p1692895941301969
Should also address #5888
Basically we were propagating the collapse to the ClippingShape for the solo which meant that the update on the clip was never called. This meant the path would never be generated and so our contents would always get clipped out (no intersection with an empty path).
ClippingShapes and Constraints should be treated more like siblings (or properties) of the Solo instead of children that can be collapsed by the active solo child choice.
Diffs=
e1b9d360b Improve collapse propagation for solo. (#5890)
attached a file that is relevant to this issue.
this is a possible solution to the problem. basically early out of our advance, if we have already established that we are not going to keep going. this is to prevent accumulating more spilled time.
another approach might be to put the keep going check into the animationStateInstance, but then the animation state instance will have to track total time, maybe that makes more sense though than total time being tracked in the linear animation instance.
todo if this fix is acceptable:
- [x] add a golden test for this.
- [x] run generators for flutter runtime.
- [x] apply to cpp runtime.
[spilled_time.riv.zip](https://github.com/rive-app/rive/files/12381784/spilled_time.riv.zip)
https://github.com/rive-app/rive/assets/1216025/7afc5d4d-e9cf-4546-941c-947adf2d454b
Diffs=
2719b1463 early out of advance if we are not going to keep goign (#5849)
Building contour measures on the follow path constraint to remove contention on stored contour measures in the MetricsPath.
We were storing the contour data used for measuring on the MetricsPath. Calling computeLength with a different transform would mutate that stored contour data. So having the trim path and the FollowPathConstraint call computeLength with different transforms was causing problems as neither of them was guaranteed the contour data was for the correct transform they expected.
I fixed this by having the FollowPathConstraint store its own contours for the path.
Diffs=
033489f8b Fix follow path contention with MetricsPath (#5868)
My first PR! 🎉
You can get Rust with [Rustup](https://rustup.rs). Then run `cargo run --release` in the `vello/` directory.
Things left to do before merging:
- [x] remove `clap`
- [x] add rustfmt & clippy checks to CI
- [x] add text support
- [x] add README
- [ ] add CONTRIBUTING
Diffs=
abe5aab14 Added a Vello back-end with a custom winit viewer. (#5786)
Rather than implementing a specific handler for this method, we add PaintType::image to PLS and implement drawImage() as drawPath() with a rectangle path and an image paint.
Diffs=
adeebb26a Implement drawImage() in PLS (#5780)
Explores an API for triggering events and querying them at runtime.
For Flutter we expose an onEvent callback that you can add a callback to on the StateMachineController:
```dart
final controller = StateMachineController.fromArtboard(artboard, 'bumpy', onEvent: {);
controller.onEvent = (event) {
// Do something with event. Like:
if(event is OpenURLEvent) {
launchUrl(event.url);
}
};
artboard.addController(controller!);
```
Note that I haven't piped onEvent to the Flutter runtime yet but you'll see it in the StateMachineController in core.
In C++:
```c++
auto count = stateMachineInstance->firedEventCount();
for(auto i = 0; i < count; i++) {
auto event = stateMachineInstance->firedEventAt(i);
if(event->is<OpenURLEvent>()) {
// Do something with the url.
auto url = event->as<OpenURLEvent>()->url();
}
}
```
You can see some of this in action in the state_machine_event_test.cpp.
You can also see the events in the console in the editor:
<img width="717" alt="CleanShot 2023-08-10 at 18 03 22@2x" src="https://github.com/rive-app/rive/assets/454182/af21902a-424d-435b-b5b0-2a43701fe186">
In a follow up PR:
- Ability to trigger events from State (in/out) and Transition (start/end).
- Add custom properties to Events C++ API (currently they are loaded but not tracked against their respective events).
Diffs=
8caa7d377 Event triggering (#5793)
Contribution from downstream: https://github.com/rive-app/rive-ios/pull/267
Not really sure what to test here - but ran the example app on a sim and on a local iPhone and seems alright
(We'll merge this after testing if we can create a patch to `v4.0.6`)
Diffs=
354b04ea7 Require only app-extension-safe APIs (#5747)
Co-authored-by: Matt LaRose <larose@duolingo.com>
Co-authored-by: Zachary Plata <plata.zach@gmail.com>
tl;dr small discrepancy in how we determine the release version and persisting the requested version everywhere correctly.
Noticed when we did a major bump of the `rive-ios` runtime from `v4.0.5` to `v5.0.0` for text that the reference back to where the artifact was located was incorrect. When trying to pull the artifact for SwiftUI / Cocoapods, it was trying to find a `v4.0.6` version.
i.e. See this automated commit that gets added, from our release workflow: 8c52c9ebe1 (diff-a010f59c5ba0ad9156da1e93bfd6fc2e6a968a3a3d633c96b593d4988faedea8L3)
Old logic was to find the next patch version of the `package.json` version committed in Git; new logic is to find the next version based on what we select when running the publish workflow. Other parts of the publish workflow rely on the output of this `determine_version` step so this should be the only place we need to worry about it.
Diffs=
77c21c16f maint: fix determine version build step in github workflow to bump based on major, minor, and patch instead of just patch (#5714)
Co-authored-by: Zachary Plata <plata.zach@gmail.com>
Add a packages/runtime/decoders project that can be reused by more projects than just the tess renderer.
Diffs=
b69ae1312 Lift tess decoders into a static lib (#5709)
Fixes a crash in the cloud renderer (it turns out, caused by the CPP runtime) when a Follow Path constraint has no target. Thanks for walking me through the backend tasks process and dependencies @mjtalbot!
Obviously it defeats the purpose of using follow path if you don't set a target, but still, we shouldn't crash.
Diffs=
baefd620c Fix crash when no Follow path target specified (#5706)