16 Commits

Author SHA1 Message Date
bodymovin
d920ee0efd fix(scripting): search first parent transform component to build scri… (#11443) 99ca3a30cc
fix(scripting): search first parent transform component to build script node

feature: modulate opacity (#11427) 128d9d61e0
* feature: modulate opacity

* fix: clang-format

* fix: rust renderer has a no-op modulateOpacity

* fix: no-op modulateOpacity for canvas android

* feature: modulate opacity on android canvas

* fix: rcp ref

* fix: missing override

* fix: gms

* fix: make flutter_renderer match cg one

* fix: josh pr feedback

* fix: remove CG transparency layer

* fix: save modulated gradient up-front

* fix: store only one gradient ref

* fix: remove specific constructor

* fix: use GradDataArray!

* fix: expose currentModulatedOpacity

* fix: cg_factory modulated opacity value

* fix: modulate negative opacity test

* fix: verify double modulate negative also clamps

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
Co-authored-by: hernan <hernan@rive.app>
2026-01-13 01:13:05 +00:00
csmartdalton
7f3d8d96bf build: Fix premake5 build on macOS Sequoia (#10263) b4298b861b
It looks like the premake5 "v5.0.0-beta3" tag isn't compatible with
Sequoia 15.4.1. Bump our tag to v5.0.0-beta7 and update the deprecated
features we had been using.

Also fix the script to rebuild if the premake5 binary doesn't exist.
Before it only checked if the parent "premake-core" directory existed,
so if a build had failed previously, build_rive.sh would fail forever
without ever attempting to build premake5 again.

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
Co-authored-by: Jonathon Copeland <jcopela4@gmail.com>
2025-07-31 00:27:07 +00:00
blakdragan7
237f2c8d30 feat(Image sampler filters) Adds Image filter options for rendering images (#9309) 930facea3f
* added filter type to draw batch

* c++ implementation of ImageSamplerOptions

* image sampler options now pushes correct for RiveRenderPaint

* wip

* OpenGL uses correct sample options

* now only one filter option that accounts for mip map

* d3d now uses sampler states options

* better way to get the filter option

* added mirror and inverse mirror options

* started using helper functions for retreiving sampler optiojnhs

* workaround for vulkn semaphore issue

* wip

* added filter type to draw batch

* c++ implementation of ImageSamplerOptions

* image sampler options now pushes correct for RiveRenderPaint

* wip

* OpenGL uses correct sample options

* now only one filter option that accounts for mip map

* d3d now uses sampler states options

* better way to get the filter option

* added mirror and inverse mirror options

* started using helper functions for retreiving sampler optiojnhs

* workaround for vulkn semaphore issue

* wip

* undo deleting empty descriptor

* properly packed image options

* removed uneeded checks

* more unit tests

* unreal image_filter_options integration, gm for image filters

* properly implement new draw functions for cgrender

* finish mege conflicts

* merge vulkan sampler options

* cherry-picked vulkan imp into branch

* initial metal

* clang-format

* d3d12 image filter options

* fixed d3d

* clang-format

* fixed mip filter for metal

* made every filter option act as similiar as possible

* addressed pr changes

* fixed tests

* empty commit to fix github

* fix: webgl renderers

* started addressing PR comments

* metal change for pr

* more pr stuff

* final PR address

* shader update per PR request

* rhi updat e

* added gm requested in pr

* made d3d12 work with more then 2000 sampler changes per flush

* pr comments

Co-authored-by: Chris Dalton <chris@rive.app>
Co-authored-by: Jonathon Copeland <jcopela4@gmail.com>
Co-authored-by: Luigi Rosso <luigi.rosso@gmail.com>
2025-05-29 05:36:59 +00:00
luigi-rosso
7f971fba3c Add RenderPath::addRawPath
Addresses this issue: https://2dimensions.slack.com/archives/C07VD44ASE5/p1739456802968219

Rive's RenderPath steals the memory for the RawPath the runtime builds, which is usually fine apart from cases where we expect to use the RawPath after drawing with it. For example, with inner feather we want to be able to compute the bounds of the RawPath after it has been drawn. If during animation a user turns on inner feathering on a path which has not changed recently, which need to be able to compute its bounds, we can't if the RawPath is now gone.

This also can happen with trim paths and dash paths which are re-trimmed/dashed after having being rendered a few frames. Right now we force rebuild the whole path to re-trim it because we lose the RawPath.

This PR allows the ShapePaintPath to hold on to its RawPath by adding RenderPath::addRawPath. This is optimized memory usage but not having the runtime need to re-alloc the RawPath whenever it animates, but it means we're further from making RenderPaths immutable.

For the future: It'd be good to chat about a long term solution that can accommodate all goals of allocating less memory (prior to this change we were re-allocating RawPath memory every frame when animating), not rebuilding paths as often, and still allow for immutability.

Diffs=
9058a3fdad Add RenderPath::addRawPath (#9038)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2025-02-14 21:23:43 +00:00
csmartdalton
4356a5c53d Add FillRule::clockwise to the runtime
Diffs=
11d4e46498 Add FillRule::clockwise to the runtime (#8786)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2024-12-20 23:45:02 +00:00
blakdragan7
c719ce1cc4 Deterministic lite rtti
Made lite rtti now use compile time hashes that use the name of the class with rtti enabled as the hash string.

Every use of rtti now needs to be a macro. but other then that, usage of lite rtti is unchanged.

Diffs=
2be44a0f45 Deterministic lite rtti (#8349)

Co-authored-by: Jonathon Copeland <jcopela4@gmail.com>
2024-10-18 02:39:00 +00:00
csmartdalton
163f1beef3 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)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2024-10-11 19:22:48 +00:00
csmartdalton
edcc1114cb Unlink skia from goldens
Also delete TestingWindow::Renderer (it's always tied to the TestingWindow subclass now), and delete the Skia renderers. This drastically speeds up link times.

Diffs=
9b755ed5b Unlink skia from goldens (#7991)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2024-08-29 20:45:44 +00:00
mjtalbot
6276d83854 add out of band audio support ios - abstracted audio!
Follow up to #7048!

I nuked the custom defines and the miniaudio include. I think this fixes the need for miniaudio and the custom defines @mjtalbot! Give it a shot 🔫

Diffs=
89053041a add out of band audio support ios - abstracted audio! (#7079)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2024-04-22 13:31:59 +00:00
luigi-rosso
3255a2aeb2 Lua formatter
Format all our lua scripts with Stylua

https://www.notion.so/rive-app/Formatters-be8845abbca34e39b5d4c212b2437b3f?pvs=4

Diffs=
858215cc4 Lua formatter (#6525)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2024-01-26 23:51:01 +00:00
csmartdalton
11084a7167 Reorganize premake
Diffs=
b8875ef31 Reorganize premake (#6522)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2024-01-26 21:20:44 +00:00
csmartdalton
163b2250af Convert RenderPath/CommandPath and RenderPaint to refcounted objects
Diffs=
8666bde87 Convert RenderPath/CommandPath and RenderPaint to refcounted objects (#6395)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2023-12-27 22:45:06 +00:00
csmartdalton
94d378d055 Add a "lite_rtti" utility and use it with Render objects
We need to be more robust if a user tries to use mismatched factories and renderers. This PR creates a simple "lite_rtti" utility and applies it to every Render object. The renderers now abort early instead of crashing if they are given a Render object for the wrong renderer.

Diffs=
c357e7aa7 Add a "lite_rtti" utility and use it with Render objects (#6311)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2023-12-08 02:57:31 +00:00
mjtalbot
04de4710ca Outofbandcache
Ok, got this passing testes, which I guess is a step in the right direction.

Before changing unique pointers to rcp, we could only use an image once, as soon as we assigned a new image, the old image would get garbage collected. (this is the actual problem we are trying to solve)

This "solves" the problem and  allows us to add images to a cache in wasm, and then cycle through the cache, swapping out the render image to be displayed for a given fileAsset. We can replace images & fonts on the fly this way.

Problems:
1. overwriting ref & unref in RenderImage, shows that is being reffed and un-reffed constantly (when viewing the attached file with the viewer). Is that expected? doing something similar for Font does not show up the same. I suspect this is related to how we use images when it comes to rendering, just figured i'd check
2. We dont seem to "leak" anything as detectable by our tests, which is good, but our wasm examples show that neither our fonts nor our render images get collected. presumably thats because we would need to manually tell wasm via js that we want to let go of an image?

Also @csmartdalton @umberto-sonnino & @luigi-rosso  it would be great to see what else is concerning.

example file

[just_a_box_with_a_tree.riv.zip](https://github.com/rive-app/rive/files/13042414/just_a_box_with_a_tree.riv.zip)

Diffs=
1506b069c Outofbandcache (#6049)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-10-26 07:56:22 +00:00
csmartdalton
562ace42e5 Add options to build with rtti and exceptions
Some systems we want to integrate with expect these features.

Diffs=
d65b239c5 Add options to build with rtti and exceptions (#6121)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2023-10-23 16:35:55 +00:00
csmartdalton
f7758ca24c Fission the CG and Skia renderers
Diffs=
c63346b93 Fission the CG and Skia renderers (#6071)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
2023-10-12 08:18:52 +00:00