97 Commits

Author SHA1 Message Date
90c91f60af Support 16kb devices by bumping to NDK r27
As suggested by the docs, this is the best way to support newer devices requiring 16kb page support.

https://developer.android.com/guide/practices/page-sizes#compile-r27

- [x] Looking to see that Goldens pass before merging.

Diffs=
f653f3f73f Support 16kb devices by bumping to NDK r27 (#8558)
572265df3b call syncStyleChanges on update (#8715)
e8d6e5db26 Override layoutcomponent x/y using layoutX/Y (#8714)
d3f6a49778 Nnnn data bind fixes part 3 (#8663)
baf832a6ce Instance data converters when attached to data binding objects (#8664)
0664f994df Snap verycomplexgrad gm stops to pixel boundaries (#8685)
39c62a94ef ScrollBar constraint autosize toggle (#8707)
7c3c8a3a1a Don't use GL_PIXEL_UNPACK_BUFFER (#8708)
5df5be1940 Add "no_rive_jpeg" and "no_rive_png" build options (#8702)
d7794cb556 Improve scroll time precision on web (#8705)
d0c9e98d2e Scroll fixes (#8698)
ca10c9ec63 re add clean to diff (#8697)
f00a5a6c78 do not break when component is found (#8695)
437688c18e Add yoga renames to non-v2 lua build scripts (#8693)
423301a95b Fix integer precision issues with pathID in vertex shaders (#8689)
b1c0e80625 use draw proxy for scroll bar draggables (#8692)
302606642c GL fixes for Imagination PowerVR GPUs (#8684)
e5879a1a5c Fix scrollbar thumb offset (#8691)
7414d20597 Sort by % diff pixels in diff.py when histogram is equal (#8683)
00e9ad43a7 fix sorting hittable components (#8690)
fa8f7c6755 fix crash when dividing by 0 (#8687)
cd310b1b68 Nnnn scrolling override poc part 2 (#8679)
ac7c458bc7 Small Scroll fixes (#8682)
0ff13be381 Make scroll physics core objects (#8672)
9dfd01fb3a made compatable with python 9_9 (#8678)
454bc50aaf diff.py: don't count identicals as differences (#8666)
c642488df3 added some changes to make building easier for unreal (#8667)
1647a7ad92 use actual sizes for calculating position offset (#8671)
599ab0eeb7 Reapply "Merge branch 'master' of https://github.com/rive-app/rive"
406a2ef952 Revert "Merge branch 'master' of https://github.com/rive-app/rive"
3c0cc1f329 skip object on animation reset if it is null (#8670)
1d2c9175d4 remove letter spacing subtraction (#8669)
96ec927371 fix fatal warnings compiler flag to use latest version (#8668)

Co-authored-by: Erik <erik@rive.app>
2024-12-10 03:09:42 +00:00
5495a00012 Avoid initializing an AudioEngine instance if there is no audio present
Community PR from AOFL: https://github.com/rive-app/rive-flutter/pull/431

I'm co-authoring to get it in

Slack discussion: https://2dimensions.slack.com/archives/C073BQNPQ5T/p1731028216451459

We will need to look into the actual fix. I'm not that familiar with our Audio system, and not sure if there are edge cases to consider with this change.

Diffs=
aea593c2df Avoid initializing an AudioEngine instance if there is no audio present (#8541)
3a638e61b1 Work around Galaxy S22 compiler bugs (#8549)
01bc166a8e invert order of advance between parent and child (#8547)
26d8b495b6 Prevent NestedArtboard advance when not playing (#8542)
ded183b39c Rhi typeless uav support (#8507)
6804948c90 new arithmetic data converter that uses a viewmodel as input (#8536)
532ca5dfb3 Unreal build use build rive.sh (#8502)
692dc6f659 default data converters runtime (#8503)
9aa4503c18 LayoutComponent updates properly when scaleType changes (#8535)
46b0899967 fix data enum importer (#8531)
4bbd7d495c Fix marking nested artboard layout dirty (#8534)
fa4f11f061 add feather property (#8533)
97050e4fa7 Pass scaleType down to sizeable children (#8524)
071b19ba62 don't expose yoga includes (#8526)
ad1ca22bd5 Nnnn render update fixes (#8527)
8826406ff1 editor and runtime: fix vector n-slicer hit area (#8512)
98e6822f02 Rename "atlas" -> "coverage" in the clockwise shader (#8518)
01066ff6a0 Fix bidi (#8517)
8296d87711 conditionnally  add dirt and advance (#8516)
8738368345 Updates to AdvanceFlags (#8514)
17cbda4b69 Add AdvanceFlags (#8492)
6cb69b688b Fix for layout shape paint bug (#8498)
33dc66a73e editor and runtime: allow vertices in a vector nslicer to be out of bounds (#8495)
cba259e6cd add data bind support for vertex properties (#8494)
f4c87ee495 Nnnn merge fills and strokes (#8465)
af9e217d23 Use renderImage size to scale images in layouts (#8487)
ce9e44c6b3 editor: NSlicer should not clamp children (#8459)
446682cda9 web: decode image on demand, not render (#8484)

Co-authored-by: Anurag Devanapally <anurag.devanapally@gmail.com>
Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-11-13 19:37:26 +00:00
b3898a9d55 Working on option C for update cycle
https://2dimensions.slack.com/archives/C078KG6KAJY/p1729359775985179

Diffs=
aa20d8aad4 Working on option C for update cycle (#8409)
1d5a580041 Layout Fixes (#8468)
d60ea4cc71 Use imageAsset size for layout (#8462)
f5e5406185 Fix inconsistent layout overflow behavior (#8463)
ce39f8be9f Artboard object validation (#8464)
bdb9eb01db search for ios sysroot only when necessary (#8437)
91d092f4fc runtime: add support for gradients in vector n-slicer (#8447)
5a4418dba6 Add an experimental "clockwiseAtomic" rendering mode (#8442)
78adb5f60b Ensure LayoutComponent doesnt try to access bg path if layout not compiled in (#8453)
4c83df9b7a Updating to latest harfbuzz for coretext issue (#8443)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2024-11-05 17:40:11 +00:00
bcb15a494a fix flutter tests
Diffs=
960d8be2a1 fix flutter tests (#8429)
c64659be84 Make build script work on mac (#8421)
8178dd7936 fix for imagediff avrg being wrong (#8430)
7a9e69314d Fix resources getting deleted prematurely in vkutil::ResourcePool (#8411)
5cde901062 Upgrade legacy artboards to work with layouts (#8419)
aec431eeb7 Layout fractional sizes & flexBasis (#8405)
a02ac789ca imagediff -> opencv (#8397)
4fec171eac Fix crash on controlSize when image not yet available (#8414)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2024-10-29 23:03:21 +00:00
b4bfa2d69b Drop the ColumnLimit to 80 for clang-format
This gives better support for smaller screens and side-by-side windows.

Also standardize the formatting check on GitHub on version 17.

Diffs=
e52e9fff29 Drop the ColumnLimit to 80 for clang-format (#8320)
52913023ba add support for listeners on layout components (#8317)
1b5e50fcec Optimize atomic rendering for input attachments (#8310)
1cc5f2b6f6 Prep for rhi (#8270)
f9715435dd Nnnn fix databind state machine shared data context (#8307)
708a913eae Implement isHidden in DrawableProxy (#8302)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2024-10-11 19:25:57 +00:00
3e495cd79a docs: update links
Updated various old links pointing to `help.rive`

I added additional information and updates as I saw them

Diffs=
d63786fee docs: update links (#7998)
727e0ba8b Add data converters to flutter runtime (#8029)
f25ee97a0 Opensource (tools) tests as part of runtime (#8035)
39b803c58 8020 text fit to box (#8042)
b06e05dc1 Fix dash increment (#8038)
5c312867e Fixing tool drawing (#8028)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-09-04 09:24:54 +00:00
797acc273f Rive flutter release v0.13.13
Diffs=
71ec9987a Rive flutter release v0.13.13 (#7997)
cc903ee02 Support Vulkan on Android (#7915)
c7bb5eb5a Change class names to strip PLS (#7988)
2be9ddc7e Set core audio session category to none (#7772)
25d423274 Initial file moves and renames (#7951)
69cffe900 Check if clipping shape's worldpath exists (#7956)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-08-29 12:17:43 +00:00
7db34cd180 feat: update build gradle to latest versions
Addresses: https://github.com/rive-app/rive-flutter/issues/398

I also created a fresh plugin using the latest Flutter and copied over the differences.

How to use:
In `android/local.properties` add:
```
rive.ndk.version=25.2.9519653 # set desired version
```

If not specified in a project, it will use the default.

Rive-Android still uses the same ndk version. Should we update that as well?

Diffs=
49bf612fd feat: update build gradle to latest versions (#7475)
a134ab656 Layout joysticks runtime (#7923)
728ac6286 runtime: add tiling to n-slicing (#7934)
e1b4a53ec Revive the WebGL backend (#7948)
813db58e7 Nnnn data binding editor native runtime (#7815)
c71a37173 fix for syntax issue (#7910)
e89437ef6 windows editor: fix format check and use raster ordering disabled (#7937)
7d00d35d3 Fix viewer tess builds (#7935)
455ebad60 Update rive cpp for submodules (#7932)
75e0f9aea runtime: support files with n-slicing defined (#7920)
85b28c39a Update readme of PLS (#7931)
21ecf2775 Fix actions yaml with rive-renderer (#7930)
c33d5d81b Update rive renderer readme (#7929)
b03895fcf Update pls README (#7927)
3316d15ca Refactor pls into runtime (#7914)
b2d27b6bd mark dirty when constraint changes (#7909)
5c14a4a30 Fix Android goldens (#7902)
46a3045ae Improve Vulkan loading and organization (#7873)
160d9eefb Add webp decoder. (#7883)
e992059d6 iOS images unpremult SIMD support (#7875)
ad34dd4da add arithmetic operation and group converters (#7801)
f99c93181 editor: setting up the update callbacks for n-slicing (#7869)
85343a4e1 Fix for bug in Runtime LayoutComponent proxy (#7867)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-08-27 15:46:27 +00:00
7d814a782a Update compileSdkVersion for flutter android example
Thanks @umberto-sonnino!

Diffs=
33fb6021a Update  compileSdkVersion for flutter android example (#7647)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-07-22 17:36:23 +00:00
8068e48eb2 Animation for Layouts
- Popout for setting layout animation
- Supports hold, linear, cubic ease and elastic
- Layouts can have custom interpolation or inherit from up the layout tree
- This PR also implements the change to not store flexGrow or alignSelf when setting scaleType, rather we put the logic into syncStyle and directly pass the values for those into the layout engine
- Tested with Rive Renderer in editor and seems to work well!
- @alxgibsn I moved the animation popout to the Layout inspector. We discussed the Auto Layout inspector, but since animation can be applied to a layoutcomponent that has no children (whereas the Auto Layout inspector must have children to be expanded), it seemed more appropriate there.

Diffs=
31f5ee5c4 Animation for Layouts (#7426)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-06-21 15:22:49 +00:00
9951f912df Flutter Android example project fix
Updating the flutter tests to build with 3.22.2 results in an error finding MultiDex. Fix is found here: https://github.com/flutter/flutter/issues/148368

Diffs=
59df9ce73 Flutter Android example project fix (#7455)
a4439ee42 Renames for Yoga and libjpeg (#7446)
97578005c Update LayoutComponentStyle bitfields to be compatible with older C++ versions (#7436)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-06-21 02:34:21 +00:00
bf94e7d6b1 feat: Flutter get component predicate
Diffs=
9abd6ee16 feat: Flutter get component predicate (#7388)
8486c3445 Get rid of MetricsPath. (#7371)

Co-authored-by: Anurag Devanapally <anurag.devanapally@aofl.com>
Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-06-07 11:52:32 +00:00
ec3564f1a5 Flutter Runtime API for Nested Inputs
https://github.com/rive-app/rive/assets/186340/00b71832-1293-45fa-b3da-f9abcaa34eb7

Diffs=
c8a151ebb Flutter Runtime API for Nested Inputs (#7325)
e0a786c90 Runtime API for Nested Inputs (#7316)
01d20e026 Use unique_ptr in import stack. (#7307)
5ad13845d Fail early with bad blend modes. (#7302)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2024-05-30 23:52:11 +00:00
04d3908f57 Flutter release 0.13.5
Tested out the latest rive-common that now uses `package:web` and `dart:js_interop`

The `RiveFile.initializeText` and everything associated with it are deprecated. Instead, use `RiveFile.initialize`, which will always need to be called when initializing text, audio, and layout.

Calling it `initializeText` is confusing to users as they may not be using text, but still need to call this manually when using RiveFile.import.

There is maybe additional cleanup we could do here, but at least want to make sure the public API is not confusing.

Diffs=
fa7c55934 Flutter release 0.13.5 (#7305)
973ff2276 Fix warnings about invalid toolsets (#7300)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-05-23 19:22:06 +00:00
4e2547d08d Expose methods to easily get Rive state machine inputs
Our current API is quite verbose and requires casting to the relevant class types when using the current find API. These methods simplify the process.

Diffs=
1460f5366 Expose methods to easily get Rive state machine inputs (#7085)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-04-22 10:11:46 +00:00
06265422cc feat!: add audio out-of-band
We'll need to decide on the Enum case for getting the `Type`. Long term it might be better to just not have this to avoid breaking changes.

If we decide to remove that, or how it is currently in the PR with the extended conditions, it's a breaking change.

The changes to `LocalAssetLoader` aren't breaking though, I realise now.

I also removed deprecated things.

Diffs=
1a8b3c7cc feat!: add audio out-of-band (#7037)
99d28e1ac Xxxx randomization updates part 2 (#7097)
a0004fa72 Xxxx support random transitions (#7094)
edac19b06 support randomizing transitions (#7082)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-04-20 07:12:54 +00:00
e34fc4cc41 feat: adds play and pause to artboard
An oversight from our side. We've previously recommended setting `isActive` to false on the StateMachine or Animation. But this will not propagate down to nested artboards.

Diffs=
e64daefff feat: adds play and pause to artboard (#7078)
2828b7b01 propagate volume to nested artboards (#7067)
4a9947630 Stop audio in iOS when backgrounded. (#7055)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2024-04-19 09:34:59 +00:00
ff3dcae269 Audio engine
Adds an audio engine abstraction (implemented with miniaudio) in Rive. We can selectively replace it with other abstractions later if we find miniaudio isn't well suited everywhere but I'm confident it will be based on flexibility with getting it working in the recorder.

Adds audio support in:

- packages/rive_common
  - WASM: rive_audio_wasm.dart
  - FFI: rive_audio_ffi.dart
- packages/runtime
- packages/recorder

Subsequent PR will add support in:

- packages/rive_unity
  - This is getting meaty enough...
- packages/rive_flutter
  - This requires publishing rive_common so I want to make sure this is reviewed and accepted before publishing
  - I'd also prefer to merge layout constraints into rive_common before this lands.

Editor features:
- Updated preview window:
<img width="248" alt="CleanShot 2024-01-15 at 14 44 31@2x" src="https://github.com/rive-app/rive/assets/454182/a9588be6-8370-4e22-ab32-af1e9ed71183">

- Preview waveforms in the timeline:
<img width="651" alt="CleanShot 2024-01-15 at 14 44 53@2x" src="https://github.com/rive-app/rive/assets/454182/2710667f-838f-483d-9647-e2bcb9e0237a">

- Subsequent PR will also use threads in web editor build (currently uses a time/frame based decoder to offload ui). I can't do that until I can verify the Shared Memory access is granted once rive_common lands in pub.dev and then we can push to UAT.

Diffs=
73bf11db3 Audio engine (#6454)
b098ad23a IntersectionBoard optimizations (#6486)
fafdef56c IntersectionBoard cleanups (#6474)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2024-01-23 04:14:10 +00:00
07c6d25de0 feat: flutter hit test self on rive render object
This PR adds hit testing to Flutter by overriding `hitTestSelf` on the Rive RenderObject.

Currently, the hit area is the entire bounding box of the canvas. This means that when a Rive animation is rendered above any other Flutter content (for example, a Stack) all hits are absorbed by Rive and do not pass through.

With this change, Rive will only absorb hits if the pointer comes in contact with a hittable Rive element.

With this change, `handleEvent` will only be called if `hitTestSelf` returns true. There is some duplicate work here as `_processEvent` already performs similar hit test logic, which we can look at optimizing. But `hitTest` needed to be separate method call, as `hitTestSelf` is called before `handleEvent` and `handleEvent` sends additional information (whether it's a pointer down/up etc.).

Diffs=
95beaa4f5 feat: add flutter hit test self on rive render object (#6341)
bd71143bc chore: fix broken docs link (#6360)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-12-18 09:00:21 +00:00
312a8b0577 bring flutter asset loading inline with cpp
basically does what it says, i'm also removing an example i used to check on things being garbage collected

Diffs=
c0411df0a bring flutter asset loading inline with cpp (#6135)

Co-authored-by: Gordon Hayes <pggordonhayes@gmail.com>
Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-10-24 14:37:30 +00:00
0bb24516d9 add ability to attach callbacks when resolving file asset listeners
Bascially add tracking of fileAssetReferencers from file assets, so that when file assets update, they can tell things that reference them to update also.

its worth looking at the rive-flutter & runtime implementations

in cpp it looks like we can hook into the delete hooks nicely to clean up after ourselves (so that when artboards get collected we are not holding references to them from file assets)

in dart this is more of a problem, however using weakReferences we do end up seeing artboards go out of scope
but weakReferences requires us to bump to a min dart of 2.17 (we are 2.14 in flutter & 2.12 in our editor atm)

the update here also uses the referencers to mark fonts dirty when fonts are set, which causes them to be updated on the next draw cycle

(video showing font updates working properly now in dart)

https://github.com/rive-app/rive/assets/1216025/d65ea2cf-95d6-4412-b8f5-368cda609d0b

(video showing how referencers get collected and trashed in dart, it looks like we hold onto about 10 of them at a time.. but they do drop off over time. also we start with 2 references, the main artboard and the artboard instance)

https://github.com/rive-app/rive/assets/1216025/b11b7b46-aa9d-4dcc-bc11-f745d8449575

Diffs=
7bc216b03 add ability to attach callbacks when resolving file asset listeners (#6068)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-10-17 16:05:47 +00:00
98040494a8 feat: expose wrapper event class to runtime
The goal of this PR is to improve the usability of events for the Flutter runtime and to hide unnecessary editor implementation detail. This also ensures that an event is not modifiable after it has been reported (from the runtime's perspective)

This is achieved by exposing runtime specific classes `RiveEvent`, `RiveOpenURLEvent` and `RiveGeneralEvent` (similar to the other runtimes), and mapping the current `Event` to these classes as an immutable object. It also maps the list of events to a Map called `properties`.

This PR also:
- Adds more event examples and fixes the audio example (`.stop` resulted in issues, and calling dispose, etc.)
- Adds tests for events

TODO:
- Will need to potentially change things (and expose the `delay`) when this lands: https://github.com/rive-app/rive/pull/5951

Diffs=
eae01824d feat: expose wrapper event class to runtime (#5956)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-09-18 17:54:53 +00:00
c6791d7b6d Timeline events & Core Callback type
Introduces a new Core field type which does not produce stored fields. Instead it provides a callback which can be keyed and unique per type so time based events can trigger against their property keys.

This is to allow things like nested trigger inputs and triggering events from the timeline.

Draft as there's a bunch more work to do for actually invoking them from the StateMachine & LinearAnimations. In the meantime the tests can do some sanity testing.

- [x] Generate core types that do not produce stored fields.
- [x] Massage Keyframe hierarchy to allow for non stored value Keyframes (markers for trigger).
- [x] Key those core types with specialized keyframes.
- [x] Pass context (like StateMachine) to those triggers and see it all tie together.

Diffs=
6058b52ce Timeline events & Core Callback type (#5877)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-09-05 20:14:25 +00:00
7bf4ec8fda Fix loading init text in Flutter runtime.
The important work is done in _initTextAndImport. This functionality needs to be called by the user if they call RiveFile.import. See the changelog for some notes.

I needed to bump rive_common for this to work as we manually added our fixRequireJs fix to the HTML. We should always try to inject functionality that's required at runtime dynamically so it can apply to all apps (not just our editor).

Diffs=
d072cbde0 Fix loading init text in Flutter runtime. (#5758)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-08-07 18:55:50 +00:00
01a12255ea basic text test
adding a basic text test to get to the bottom of text not working

Diffs=
66e234066 basic text test (#5718)
b69ae1312 Lift tess decoders into a static lib (#5709)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-08-01 14:48:05 +00:00
591b275519 Update http v1.1.0
Resolves https://github.com/rive-app/rive-flutter/issues/321

This requires Sentry to be updated as well.

Diffs=
05c8632e8 Update http v1.1.0 (#5540)
db5688c4a Don't use the '-g' buildoption in premake (#5621)
b17671130 Fixing modifier ranges not updating on the right frame. (#5623)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-07-20 09:51:48 +00:00
ca712600bc refactor: asset resolving
Adds some cleanup to this previous PR: https://github.com/rive-app/rive/pull/5411/files

- Brings back some classes and parameters and mark them as deprecated.
- Changed the naming for parameters
- Removed asset resolving from the high level `RiveAnimation` widget, prefer to manage this by loading in your own `RiveFile`. This is to avoid introducing too many changes that we may revert down the line
- Removed code comments that were intended as questions, marked some as TODOs
- Improved documentation and cleaned up example

The cached asset example now has a button to hot swap out assets at runtime by keeping a reference to the asset. This works for images, but not for Fonts.
- We can either remove this example for the time being
- Or investigate why it does not swap out (I would expect it to)

Diffs=
94e3490ae refactor: asset resolving (#5563)
bae069339 Stop automatically pruning empty segments in RawPath (#5557)
2d2d8c413 Line Height & Paragraph Spacing (#5552)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-07-13 14:06:41 +00:00
0e3fdf8de5 Caching example
(basing this pr onto our dart runtime change for now, to limit scope)

made some small tweaks to function names, mostly to get fonts and images to "feel" more similar.

broke out "decode' into parsing the asset first.

makes it possible to cache images/fonts with our dart runtime, example included

Diffs=
40302069e Caching example (#5517)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-07-06 10:50:13 +00:00
5def5d7b1c Font dart runtime
There are a number of questions I'd like to resolve before considering to merge this. also a few thigns to clean up no doubt

# Questions before merging
To customize loading out of band assets, we expect our users to implement
```
abstract class FileAssetLoader {
  Future<bool> load(FileAsset asset);
  bool isCompatible(FileAsset asset) => true;
}
```

1. is this a good interface (i've changed `loadContents`, to `load`)? (if we like this we should change this in cpp too)
2. `FileAssetLoader` is a mouth-full, would `AssetLoader` be better?
3. We are passing `FileAssets` (our core objects) to users with some slight api extensions, is that good? should we just wrap this in an Asset class (I had this before, its not a lot of work to get it back)

things sorted
- [x] cdn "loading" vs url loading
    - just sticking with cdn, users can customize for url
- [x] asset class for consumers of our runtime.
    - i've avoided this one for now, just extending our FileAsset
- [x] Importer/Resolver/Loader. I flipped some names around, mostly because I want our end users to provide an `AssetLoader`, not a resolver.

things to sort out down the line, i'm declaring them out of scope for this pr, fft disagree:
- Fallback font, I see we have a fallback font file hardcoded in the runtime. should investigate if we can include an asset for people like this, or if we need to have users set this if they want to use fallback fonts.
- Image Placement, we should strip width/height from runtimes on ImageAssets
- What do we want to do about asset loading / decoding errors
- TextStyle has both assetId & fontAssetId it gets assetId from the file asset referencer, its nbd,

Diffs=
06e959ad2 Font dart runtime (#5411)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-07-06 08:49:14 +00:00
7f218d15bd revert overriding rive_common in flutter example
this breaks tests in rive-flutter, and presumably a leftover from testing a rive_common bump locally

37eb623b96

Diffs=
ad0d13cd6 revert overriding rive_common in flutter example (#5334)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-05-31 13:41:01 +00:00
37eb623b96 Text modifiers!
Adds support for text modifiers, which are a set a of operations that can run on a per character basis to transform, reshape, and fade resulting glyphs.

Adds:
- Modifier groups which encompass a set of modifications done to a range of the text.
- Range selectors which help define the range the modifier applies to (multiple range selectors can be included to build up the final selection of a modifier group).
- Variation modifiers which allow animating variable fonts per character.
- Origin, Translation, Rotation, and Scale modification.
- Opacity modifiers.

Diffs=
9695de6e3 Text modifiers! (#5288)
a9f8a1c5d Macos take2 (#5258)
2023-05-25 17:53:23 +00:00
6395bceaf7 Joystick ordering
Fixes issue with dependencies discussed here:
https://github.com/rive-app/rive/pull/5275

Joysticks now build their own DAG and export in the correct order for runtime.

Diffs=
f2ecb824b Joystick ordering (#5277)
2023-05-23 05:23:17 +00:00
0d010f0191 Joysticks & Slider!
Diffs=
7acff50d4 Joysticks & Slider! (#5249)
e65175b88 Fix flickering caught in high level runtimes. (#5243)
2023-05-16 04:44:51 +00:00
de05d9b449 Fixing solo nesting.
Fixes some visibility conditions JC caught while attempting to nest multiple solos into other solos a few times. Added tests for these conditions to both the editor and the C++ runtime.

Diffs=
2bc4acfba Fixing solo nesting. (#5066)
2023-03-29 20:12:22 +00:00
428b1a6dad Solos
So far:
- [x] Editor
- [x] Dart Tests
- [x] Flutter Runtime
- [x] C++ Runtime
- [x] C++ Tests

Hierarchy interaction:
<img width="280" alt="CleanShot 2023-03-24 at 21 44 53@2x" src="https://user-images.githubusercontent.com/454182/227696646-09f9cbe5-c482-4bab-aae9-b0b36c16047e.png">

Nesting:
<img width="394" alt="CleanShot 2023-03-24 at 21 45 23@2x" src="https://user-images.githubusercontent.com/454182/227696653-b1132ba1-5471-4c6d-9b59-20387389ae12.png">

Inspector active solo selection:
<img width="253" alt="CleanShot 2023-03-24 at 21 45 33@2x" src="https://user-images.githubusercontent.com/454182/227696660-6676acfa-15ab-4ae2-a866-4b7898bc1f52.png">

Animatable with timeline hierarchy value too:
<img width="510" alt="CleanShot 2023-03-24 at 21 46 07@2x" src="https://user-images.githubusercontent.com/454182/227696686-255064c9-43fd-4213-9e3f-9cd46cca9de3.png">

Diffs=
daaf140ba Solos (#5047)
44ef23f7e Text fix variable and opacity (#5017)
3c396d3b8 Text style variation at runtime. (#5014)
2023-03-28 23:39:09 +00:00
94344e123a remove a bunch of generated files
havent really done much to test things work, kinda hoping tests will fail/ windows will stop being able to be built. everything else is an example

Diffs=
41b699beb remove a bunch of generated files (#5002)
c0c8a45ae Reduce github log pollution (#5011)
ccab8df36 Pre-count array sizes in ContourMeasureIter::tryNext (#5010)
f4046e60b Rename reset to rewind. (#5004)
c6caafc24 Import Wang's formula for contour measuring (#5005)
72c5d2084 Port PLS to wasm (#5003)
2023-03-17 18:45:51 +00:00
27be816a46 Update flutter runtime
- ran ```dev/generate_core_runtime.sh build```
- cleaned up a lot of accumulated changes from the last few months that needed to be stripped/modified for the rutnime
- removed no longer supported lining options from analysis files
- fixed up defs for some editor only features so they don't transpile
- added some more details to changelog
- bumped pubspec version

Diffs=
aa8c750bd Update flutter runtime (#4835)
2023-02-15 23:47:35 +00:00
3941b7e932 Update ObjC formatting to look more similar to the C++
Also update the auto formatter to run on *.m and *.mm files, and effectively ban breaking on return types entirely, as I think this is ugly.

Diffs=
c7d125c7d Update ObjC formatting to look more similar to the C++
2023-02-15 17:24:54 +00:00
00798ca173 Perf/flutter runtime opacity check
- Adds checks to see if a drawable has a 0% opacity before performing draw commands
- Add skinning example

Diffs=
a61f4c6b5 apply changes to rive_core
8152b8a02 docs: update CHANGELOG
b8f61022c perf: check if opacity is 0 before drawing
4c4826e67 chore: add typedef argument names
ff94982f9 docs: add skinning sample
f1ddd88d4 Fix artboard pieces slowly popping in. (#4818)
3039909c2 Update to using deployment workflow similar to ios
53a8f9517 Fix direction when looping. (#4786)
4c5a576ad Fix ping pong hang (#4776)
ae1e02afc Fix tess test linking (#4773)
4ecbf9321 Fix remap based on issue JC caught. (#4771)
89e38b700 allow negative speed (#4770)
4d115b4c6 Adding GLSL100 for tess renderer. (#4767)
31a3972aa ios shaders for tess (#4765)
686e5125b Add dependency to correct grand parent for linear gradients. (#4753)
e737ee427 Revert "Update to using deployment workflow similar to ios"
de0e57d55 Update to using deployment workflow similar to ios
051769242 Runtime Text! (#4741)
331ad0d55 Build cleanups
2538229d6 Use Rive's libpng premake dependency in golden testing
42a0377bc Fix condition with trim paths where all contours are 0 length. (#4722)
ea1c83d02 Use os.copyfile() instead of the '{COPY}' command
5c03e1640 Remove forcing arch to arm64 for libpng (#4715)
404a04d35 Cleaning up libpng premake to be isolated/stand-alone. (#4713)
2023-02-13 18:13:08 +00:00
9d2fe267da Published rive_flutter 0.10.1
Some minor updates that I made when publishing 0.10.1

Diffs=
f39fc2bb8 Published rive_flutter 0.10.1 (#4657)
2023-01-11 21:54:05 +00:00
0767844a56 style: updated example and readme
Diffs=
a259b57b2 style: clean up example app
483978f10 docs: update readme
2023-01-11 21:04:30 +00:00
82e5dc984c perf: fix didUpdateWidget and artboard config
This resolves a performance and usability issue where certain conditions would result in Rive needlessly reconfiguring/initializing the Rive artboard (as well as downloading/loading Rive files). If `onInit`, `animations`, `controllers`, or `stateMachines` were passed in as an argument to `RiveAnimation` the above issue is triggered on each widget rebuild. Under certain conditions this could result in an animation constantly restarting, bad performance, or Flutter ending up in a `setState` callback loop.

This PR also clears the list of local controllers each time init is called.

Resolves: https://github.com/rive-app/rive-flutter/issues/277

This also fixes bugs in our example app
- Play/Pause not working
- One shot animation behaving oddly

Diffs=
9af05d044 docs: update changelog
cb7fd6d14 test: add rive animation onInit tests
107ae16bc refactor: naming and call logic
6857aa691 docs: add additional code docs
f3ba4f015 perf: fix didUpdateWidget configure loop
7d0aaaff3 Adjust RiveAnimation didUpdateWidget condition (https://github.com/rive-app/rive-flutter/issues/278)
d4c6dd4ab Add more helper functions
6a8f9e249 Fix tess for C++11 and add to github action (#4571)
c8b5fdadd More SIMD features
87f079a10 RawPath::Iter improvements
2023-01-10 08:59:52 +00:00
cac78883af Value Graph Export + Runtime Support!!
- Renamed CubicInterpolator to CubicEaseInterpolator so that CubicInterpolator can now be the base class for both CubicEaseInterpolator and CubicValueInterpolator.
- Added CubicValueInterpolator to cpp and Flutter runtimes.
- Test in cpp runtime for the new cubic value interpolation.

Diffs=
1e80ad08f Value Graph Export + Runtime Support!! (#4524)
c532f8658 Shorten harfbuzz/SheenBidi directory paths
312a6c778 Drop the runtime to C++11
de4fe4d71 export MAKE_SKIA_FILE from all top-level scripts that build Skia
75a6b74b8 Beef up testing in tools/*
79f98695a Don't show interactive download progress when premaking on bots
b7fd1d825 Move golden testing into tools/
2022-12-14 22:15:43 +00:00
af6e7d4c07 rive_common package
I started adding Text features to rive_core and realized that the dependency structure is going to be very difficult to manage here. Here's why:

## rive_core
 - has most of the runtime logic for things like IK, mesh, shapes, etc

## rive_flutter
 - depends on rive_core (not directly but we transpile rive_core to rive_flutter)
 - also includes the FFI/WASM text runtime

The problem is that rive_core needs the FFI/WASM text runtime. So we have a cyclic dependency. We've dealt with something similar (not quite as extreme) by abstracting things like nested artboards, but it gets very complex for a verbose API like the text one.

## rive_common
What this PR does is reworks a lot of shared logic like Math (Vec2D, Mat2D, etc), low-level text runtime (FFI/WASM), etc into a "rive_common" package. We've had shared packages before but none that have been shared by rive_flutter and rive_editor. I think it's finally time to bite the bullet here.

This will make it much easier to work through some of the obtuse abstraction patterns we've had to do to disambiguate if you're using a Vec2D from the runtime or the editor, for example.

Yes, this means we'll only have one set of math classes, one set of binary writer/readers, etc. I only did the bare minimum necessary to move text into rive_common in this first pass but we can do more as we go forward.

## TODO:
- [x] move Text WASM & FFI to rive_common
- [x] move Math used by text (Mat2D, Vec2D, TransformComponents, PathInterface, etc) to rive_common
- [x] move utilities used by text (binary reader/writer) to rive_common
- [x] fix core_generator and core_generator_runtime
- [x] fix github actions to use new paths
- [x] publish rive_common to pub.dev and unlist it

Diffs=
12c6ee130 rive_common package (#4434)
5a24e63d0 Initialize isClosed on TessRenderPath (#4431)
2022-11-19 20:19:05 +00:00
e618def5cd Text
Uses it in the artboard title but also updates the flutter runtime massively to support FFI & WASM C++ Rive Text. PRing to let the tests run.

Diffs=
3be5ff0d8 Text (#4372)
90245a5e1 Fix the Android debug build
0a0f3c267 Fix for missing animation in a blend state. (#4415)
440512dca Add simd::if_then_else (#4403)
ec9fb5bfc Revert "Update SIMD booleans to use bitwise logic operators"
701d8dee2 Update SIMD booleans to use bitwise logic operators
e98b93a61 Add SIMD fallbacks for missing builtins
466f68e3a Add some more core math and SIMD functions
2022-11-15 23:07:11 +00:00
6d229dcdd9 add simple test & an example showing selection of different rive files 2022-08-26 18:16:13 +01:00
ef8e8d63f5 cleanup for publish 2022-06-14 09:08:05 -07:00
b04b4a6469 Add missing lightswitch asset 2022-05-23 10:52:36 -04:00
fef6090e78 Cleanup based on previous PR 2022-05-18 11:15:37 -07:00
338d739bf7 Add a Listener to the RiveAnimation widget when a StateMachineController has events. 2022-05-18 11:15:37 -07:00