
* chore: hack use pub published rive version to sidestep current lottie conversion tests * chore: purge old dart flutter code, tests, and samples * feat!: rive_native updates for rive flutter usage * feat: add rive_native to rive_flutter * chore: update rive flutter example app * docs: update CHANGELOG with migration info * docs: update README feature: scripting in editor (#10086) 7be3a0fe02 feat(webgpu): Finish input attachments for "subpassLoad" mode (#10115) f838e94a95 fix: release nested artboard animation resources when clearing (#10116) e3a68dff11 release nested artboard animation resources when clearing chore(webgpu): Update Wagyu names (#10114) cc9f175c5e feat(vulkan): MSAA (#10107) a9d49ca4e6 Implement the MSAA codepath on Vulkan. This finalizes our Vulkan support because we now can work on core 1.0 with no extensions. Disable timestamp with scroll physics (#10111) d8197feca5 Noticed some inconsistencies with scrolling with the pointerEvent timestamp implementation on desktop and web editor that need investigation. For now, disable using the timestamp passed down to rive native (revert to how it was working before) until I have time to investigate further. feature: add image based conditions (#10108) 247b3b00e8 add image based conditions reafactor(CommandQueue): added dependency map between files->artboards->statemachines (#10106) 1d45c6418d Added dependency between state machines and the artboards they are created from. Added dependency between artboards and the file they are made from Made all dependencies get cleaned up correctly when owning dependency is deleted. feat(CommandQueue): Several needed features (#10097) cf63e43d70 * added way to get default view model for a given artboard * added request Id to errors and mouse events * finished tests * order matter when getting deleted apperently runtime: get rid of the HitTextRun destructor (#10092) fc5abebaec context: https://2dimensions.slack.com/archives/CLLCU09T6/p1751307412381219 Sometimes it causes crashes on Unity. This destructor existed because I was worried the glyph contours could take up a lot of space and computation when the state machine is not playing. But perhaps that's better than crashing runtimes. fix: get text fallback to use clustered unicode points too (#10078) 4d5037b42d test: Render android/vulkan goldens to the device display (#10074) f6623687a8 chore(ci): Turn on ASAN for some golden tests (#10019) 4a81463748 chore(ci): Turn on ASAN for golden tests chore: Simplify testing configs (#10072) b1793e755e Rather than having an explosion of enums for all the different backend configs, us very basic backend enums (gl, vulkan, metal, etc.), and capture all the permutations in the separate BackendParams struct. Nnnn data bind artboards 4 (#10038) 32f0d6d0a0 * add js runtime support feat(gl): Use KHR_blend_equation_advanced (#10067) 308480cf12 We previously only worked with KHR_blend_equation_advanced_coherent, but Samsung Xclipse GPUs only support the noncoherent version. Add a codepath that makes use of the noncoherent extension so we don't have to copy out a dst texture on these GPUs. This improves perf on the "Rope" scene from 5.5fps -> 15.1, which is a decent stopgap, but considering Vulkan currently runs at 108fps, we should probably mostly just focus on switching to Vulkan. fix(gl): Make the clip-plane ban on ANGLE drivers more comprehensive (#10066) d3e42c99b7 Detect ANGLE drivers by checking the GL_VERSION string *and* GL_RENDERER. On some devices, GL_VERSION does not say "ANGLE" but GL_RENDERER does. Block both GL_ANGLE_clip_cull_distance and GL_EXT_clip_cull_distance on ANGLE drivers. This fixes the "disco" bug with dancing triangles on Xclipse devices. test: More comprehensive testing for offscreen gms (#10055) 05d64b548f Rename texture_target_gl* gms to offscreen_render_target*. Implement offscreen render targets for Vulkan testing. Add permutations for a "riveRenderable" flag, which disables input attachment support on vulkan, and will disable UAV support on D3D. fix: rive_native plugin isolation (#10062) ded9340fad * chore: refactor globals for rive_native * feat: flutter renderer starting to work * chore: refactor web for multi window * chore: add multi window example * chore: cleanup * fix: make raw text for multiwindow * feat: support multiple plugin instances in windows * feat: handle multi_window in windows * feat: multi plugin support on iOS and Android * chore: clang format * chore: add get render context to linux * chore: don’t get factory in test * chore: remove multi-window example fix: use reverse iterator (#10057) 4fd30da275 * chore: use reverse iterator * chore: fix iterator * chore: try on github macos * chore: retry docs: Remove Skia from the runtime readme (#10043) 092566581a featt(CommandQueue): Added internal file asset loader (#10040) d13f8c2bf6 * started file asset implementation * asset loader implemented * started adding tests * updated fonts and audio to validate before returning an object. * audio source and font tests * added deleted callback tests for audio source and fonts * fixed compiler issues for non windows clang * updated cargo checks to latest rive_hb * msvc maudio does not support mp3. use wav instead * Updated based on PR comments chore: update list related classes to use RCP (#10032) 23c446feb4 * finish artboard component list rcp featue: add artboard data bind support (#9996) be0b691d9b * add artboard data bind support feat(CommandQueue): Added error messages for each type of error that could happen (#10020) 9af17212ca * started implementing error messages * send errors to command q as well as print to cerr * started adding tests for error messages * started file error tests * file error tests * render image error tests * state machine error tets * PR suggestion to convert template function to helper class * prevent mixup for 32 bit platforms feature(CommandQueue): View Model Properties finished (#9993) 1d144e0d61 * added renderimagehandle and fileLoaded and enumsListe * coded out lists * added tests for list * property subscriptions complete * Added abililty to fire triggers * added tests code cov vaught * better name * ASAN for unit tests (#9997) chore: enable asan * changes requested by PR comments * addressed PR comment * enum renames * feat: add asan for tests * chore: missed lua file * chore: remove windows asan for now * remove extra ref * update print text Use Flutter's PointerEvent timeStamp to compute elapsed time for scrolling (#10013) 94ee0804b8 In Flutter, due to how the pointer events are captured, using DateTime.now or Stopwatch at the time the StateMachine receives the pointer event does not provide accurate timestamps, thus the calculation of the pointer delta and elapsed time were inaccurate in the editor. For example, while dragging, the relative x/y delta between mouse move events may be steady, but the difference between DateTime.now and the previous now could vary widely, leading to inconsistent scroll behavior. This PR updates to use the PointerEvent's timeStamp instead which is more representative of when the pointer event was dispatched. We capture the timeStamp and pass it through to both the Dart and C++ ScrollConstraints in order to correctly do the computation. feat: add hash to rcp<T> (#10018) 22e314a8df feat: add has to rcp<T> Nnnn separate clear and unbind (#9888) f22462bd78 Nnnn separate clear and unbind second batch of fixes (#10014) 3c09bb1e7f rcp file assets (#10016) ecdf58f54b * feat: rcp_file_asset feature: add support for comparing with self (#9984) f0da7e9f27 * add support for comparing with self fix: rectangles to contour heap use after free (#10005) 67811c029d fix memory issues with data binding (#10002) ca0963da48 * fix memory issues with data binding fix: recursively duplicate instances when creating view models from a… (#9995) 8cf21b7fee * fix: recursively duplicate instances when creating view models from a number to list converter Initialize pointer to nullptr (#9989) e35082ebdc Fix scroll continued acceleration (#9994) 7e9d2b610f Fixes a bug (#9985) where clicking after a scroll could result in continual scrolling when the mouse isn't moved. chore(webgpu): Replace JS bindings with Wagyu (#9986) c05ef4daaa add color custom property (#9181) de384615b2 * add color custom property fix: Fix WebGPU sampler bindings (#9976) 6e3a82253a Samplers broke on WebGPU because we didn't have CI testing. Fix the samplers and set up a CI job to run through the WebGPU tests on Dawn to ensure we don't break this again. chore: refactor databind update cycle (#9863) 891f65794c * advance data binds per artboard update keys (#9949) 88befa489b * update keys * update file for test Fix feathering assertion from padding double cusps (#9940) d5140c06b9 add list to length converter (#9930) 3d3767270c test: Update fuzzer to support real GPU backends (#9931) 6734d748c8 The fuzzer used to only support our null render context. We should also be fuzzing our graphics backends though. Update the fuzzer to use TestingWindow and support real GPUs. Also add a null testing window so the fuzzer can continue using a null render context if chosen. pass unordered map by reference (#9945) c793892950 Nnnn data binding images and lists updates (#9932) 8363df8fb6 * add support for addInstanceAt in list * fix istanceAt with index overflow * fix: advanced triggers for lists * enable resetting embedded images by passing null * fix: correctly delete selected data components feat(CommandQueue) Get / Set Basic Properties (#9929) 6d8f034217 * Added initial property set / get for view models * added nested view models set fix: crash with active title (#9928) 5a1a0b5637 Fix: tess renderer & nuke old viewer (#9927) c2ec689eb6 feat(CommandQueue)Server side Cursor Math (#9916) 8bf9682caa * added math and pointer event struct to easily translate cursor events * better comment feat(CommandQueue) View Models and View Model Instances (#9908) f4960cff48 * added viewmodels and started tests * creating and destroying viewmodels and isntances * listViewModels * view model listeners finished * added bindViewModelInstance * added more tests * addressed PR comments * updated api to not use ViewModelHandles and have a more consice api fix: static analysis fixes (#9918) c71be9b1a2 * fix: static analysis fixes * Update packages/runtime/src/file.cpp * chore: checking if glyph coverage broke test * chore: try a different fix Nnnn data bind images updates (#9911) 3aa5b93199 * add missing types to runtime * add support for setting image to null fix(webgpu): Don't allocate unnecessary textures (#9909) dde1897bb7 We were allocating textures for clip, scratch, and coverage even when PixelLocalStorageType was EXT_shader_pixel_local_storage. This was just a waste of memory since PLS keeps this data explicit tiled memory. Don't allocate these textures in EXT_shader_pixel_local_storage mode! fix: crash when text is in a solo (#9915) 747c3ea77a * using debug * fix: initialize m_text to nullptr * chore: undo previous change fix: check for empty id when exporting data binds (#9912) 7293b15461 fix: check for empty id when exporting data binds fix: check for null for m_text fix crash on unset listener change (#9907) 8edd84d2a3 fix: isTargetOpaque override (#9901) 7c8352ad63 library: allow passing view model instances of a nested library to a library artboard (#9878) 052a4984ef fixes: https://github.com/rive-app/rive/issues/9781 Imagine this situation. 1. File1 -> publishes vm1, and a artboard1 that understands vm1 2. File2 -> publishes artboard2 that has a nested artboard of artboard1 (imported from library) 3. File3 -> wants to use artboard2 (from File2), and supply it with vm1's instance. This should work, which is what this PR does. There are two main sectors of changes 1. I created a library asset manager, and uplifts all caching stuff to the 'file' level instead of on the 'libraryAsset' level. This is because ID's like libraryArtboard.viewModelId need to be able to refer to another libraryAsset. Same goes for viewModel.propertyEnum or propertyViewModel. 2. In runtime_exporter, I'm changing how we add to the fileIndexMapper for library components. Before this PR, I was doing this lazily. E.g. if a nestedArtboard refers to an artboardId that's from the library, I remap that to the actual Artboard's index at the time of write. However, this is getting a bit confusing. I thinnnnk it's safe to just map all LibraryComponents before writing anything. I also fixed path_fiddle for databinding, which is how I've been inspecting databinding in runtimes. I added a test for this. fix: Scroll index not considering gap (#9889) aca08e662c Scroll index values need to account for gap in when the convert to/from scroll offset. data bind fixes 16 ffe3a20c95 * fix image sampler missing argument * add support for comparing integers to floats in cpp feat(Command Queue): Pointer Events (#9881) ab11082212 Adds pointer events to the command queue. Also fixes an errant callback name. refactor(CommandQueue) removed erase in `processMessage` to avoid double erase (#9887) e296e14c35 removed erase in processMessage to avoid double erase fix(editor): add additional index checks for Lists (#9870) 89ffb92b57 Add additional index checks to prevent out of range errors in List access. refactor(vk): Add a vkutil::Texture2D class (#9862) 5779effa92 vkutil::Texture2D wraps a VkImage AND a VkImageView so we don't have to manage both of these objects separately when we just want a simple 2D texture. It also subsumes TextureVulkanImpl, allowing us to simplify things further and remove that class. vkutil::Texture & vkutil::TextureView are renamed to vkutil::Image & vkutil::ImageView, in order to reflect the fact that they are just very thin wrappers around VkImage & VkImageView. runtime list updates (#9855) f660dea549 * runtime list updates removed generation of reqeust ids (#9859) b8bfaaf5e7 * removed generation of reqeust ids * removed request id type added advance state machine and settle callback (#9857) 58ece530ef * added advance state machine and settle callback * better tests * address pr comments Add gate for modifying dirty layouts set (#9856) 465d37f48e Add a gate to prevent m_dirtyLayout from being modified while it's being iterated. Also adds some additional logging. fix(renderer): Gracefully handle compilation failures (#9755) c09b771645 Ensure that rendering still succeeds when compilations fail (e.g., by falling back on an uber shader or at least not crashing). Valid compilations may fail in the real world if the device is pressed for resources or in a bad state. fix(CommandQueue) (#9845) 6582d5bf02 fix command buffer example to use the correct syntax for file asset loaders feat(CommandQueue)File asset loader (#9799) 77172ea62b * added file asset loader * tests for asset loader * made asset loader rcp * addressed pr comments feat(CommandQueue) Added request Ids associated with jobs (#9796) 5aedcdc61f * added request ids that are associated with callbacks for the command queue * modified tests to check for request id feat: TextInput - refactor shapes for runtime text input (#9836) 455374455c * chore: updating runtime defs * chore: refactor TextStyle into TextStylePaint * chore: missed hpp files * chore: missed cpp files * chore: fix clone of text_style_paint * feat: more text input at runtime * chore: cleanup * chore: add typed child iterator * chore: missed files * chore: running runtime input in editor * feat: completing integration with editor * chore: missed file * chore: fix builds with text disabled * chore: use child for test * tests: adding more tests for text input * chore: missed test file * chore: more coverage for child iterator * chore: using clipping on text input * chore: test text input selected text * chore: dry up iterator Revert "bad driver detection for clip planes (#9714)" (#9775) c62bdb256e Revert "fix: Make bad driver detection more specific for clip planes (#9714)" This reverts commit 3ab91e096d9d27a5b8f4cc50737a70eef25d2558. Sadly, the mini-test could pass on Galaxy S24 SM-S921B, only to have the clip planes crash later. This should hoepfully go away with Vulkan. 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 chore: add data binding set of tests (#9821) 6a3aa2cbfd * add data binding set of tests library: export used artboards from library files only (#9816) 127097dac4 # Description Before this PR, we export all artboards from library files in runtime_exporter. This PR makes sure we only include what's directly or indirectly used by the host file. # Details While working on the runtime exporter, I'm realizing that we have a lot of arguments on the exportOneFile function that can be simplified, so I changed the api a little there too. I tried to separate out this in the first two commits. For DataEnums, before this PR, there are 2 sources of 'filter' on what to export. One comes from 'usage', and the other comes from `requiredDataEnums` in the mappingContext. With this PR, I'm consolidating this into just using `requiredDataEnums`, so the usage of the current file is folded into this too. For ViewModels, it's very similar. Before this PR, there's the argument `viewModels`, and the context view models coming from `requiredViewModels` in the mapping context. I've found this to be a little redundant, so I again folded the former into the latter. For Artboards, there's already `exportArtboards` in the mapping context, but this represents what's exported by each file. The nested artboards rendering logic uses this directly. We don't have a way to communicate, for every file, what's required by other files. As such, I created a `requiredArtboards` concept, that's similar to the `requiredDataEnums` and the `requiredViewModels` above. This tracks the Artboards that every library file needs to export. Fixes: https://github.com/rive-app/rive/issues/9434 feat(apple): add mac catalyst support (#9759) e6b052eed9 fix: add missing symbol property when creating view model instance (#9827) 3277968b6d fix: extend unbinding to data bind dependencies (#9817) 0e1fce36c3 Nnnn enable data bind images ff early access (#9808) f91f517f32 * data bind images fixes * enable data bind images in early access add tests (#9807) b21cda7564 feature(CommandQeue) Message Queue (#9704) 5b253d0b0b * added message queue for receiving information back from server * addressed some issues * renamed everything to listeners, manage lifetime of listeners implcictly, modified tests to match and updated example to use listeners. * updated to match naming convention we talked about * addressed PR * added delete messages for file,artboard and statemachine * fix dumb dumb * Update packages/runtime/include/rive/command_queue.hpp * more pr changes * nested listener classes * addressed pr requests fix: cpp modulo to match dart (#9757) 6c03dca01d * fix cpp modulo to match dart fix: skia loses the fill type after a rewind (#9741) 8f5a30ac7c fix: Make bad driver detection more specific for clip planes (#9714) 3ab91e096d Some ANGLE drivers don't support clip planes correctly. But ather than making a blanket ban on ANGLE clip planes, compile a mini-test and see if the failure repros before banning the extension. fix(gl): Fix a memory leak in TextureGLImpl (#9663) 9e3db1f98f It appears that we were never deleting the underlying GL texture for image textures (×_×) fix: Memory issues in TrivialObjectStream (#9731) 5661461ca8 The idea of addressing full objects inside a deque of bytes is fundamentally broken, because std::deque does not have contiguous storage. To fix this, use std::copy et. al. to move the bytes in and out of the deque, instead of trying to dereference them. Change our requirements to POD and rename it PODStream. fix: Find a workaround to compiler bug on Pixel 3 (#9729) 5ed9258760 Pixel 3's GLSL compiler didn't like a recent change we made. Find a workaround. fix: ensure data bind refs and unrefs its source when binding and unb… (#9738) 0d0f9cd7d9 fix: ensure data bind refs and unrefs its source when binding and unbinding fix: scrollIndex on Lists (#9732) d46676d8d1 Setting/getting scrollIndex on a ScrollConstraint that contained an Artboard List was not updating the scroll offset properly. We add a layoutBoundsForNode(index) to allow accessing proper layout bounds for every layout in a LayoutNodeProvider. feat: List Artboard Reuse (#9691) 74188ce8cc Modifies the List DataBinding classes to cache ViewModelInstanceListItems rather than doing a full replacement, which makes it easier to reuse Artboards that have already been mapped to a ViewModelInstanceListItem. This PR also clears the List when the state machine is paused (when DataBinding in design mode is turned off) refactor(CommandQueue) moved drawloop to be driven from commandQueue rather than from the server (#9692) 203b35111d * moved drawloop to be driven from commandQue rather then from the server * made pollMessages and waitMessages return !M_disconnect * removed drawloop added drawkey added stopmessage * addressed PR comments fix(unreal):missing decoders (#9637) b46446c172 * Update premake to include decoders for Unreal builds. fix: get rid of unused build.sh (#9710) 6be784f0dc * fix: get rid of unused build.sh * fix: unit tests on msvc and linux * chore: fix again * chore: use cirrus labs for linux unit tests * fix: linux test * fix gvec polyfill * chore: fix linux * chore: linux again * fix: don’t let ratio go below 0 test: Add a threshold parameter to check_golds.sh (#9670) 4c2a6633c1 update riv to reflect the new core ids (#9711) e2e4f1e226 Nnnn data bind assets bkp 2 (#9705) e6782a6bfb data bind images library: remove references to LibraryStateMachineInput (#9701) 5f34d5e684 Note we removed creating them in ec0c2b2#diff-4ace8b8bb73f8a7f225de6e4452a88a5af27d860d807ad64c1e1b2fe40321c12 Not sure if we still wanna resolver still? I kept them in for now. We have a runtime test that's failing, that's what got me to notice that we still have inputs... https://github.com/rive-app/rive/actions/runs/15053446609/job/42313583695 SORRY!!!!!! fix: ViewModelInstanceListItem memory leak (#9699) e399210e17 Fixes a memory leak where we were double reffing core instances of ViewModelInstanceListItem. Unit tests now pass. fix unit test make (#9698) 2e0c905455 merge skipping the pending tests library: make sure host artboards always get exported first (#9686) 7c7035d035 # Description In a .riv file that doesn't import from libraries, we expect that the first Artboard is the default one. Our runtime API's expect this. E.g. riveFile->artboard(0) is used extensively. Before this PR, because we export files in a DFS fashion, artboards from the library actually gets exported first. This breaks the above assumption. # Details This PR makes sure that the assumption holds. The way I implemented this is by having files export Artboards to a different buffer, then write that buffer after the host's objects are written. Here's how I expect the objects to get written, on a file that makes use of 2 libraries. Host's Backboard Lib1's file assets Lib1's dataenums, viewmodels and their instances Lib2's file assets Lib2's dataenums, viewmodels and their instances Host's file assets Host's dataenums, viewmodels and their instances Host's Artboards, animations Lib1's Artboards, animations Lib2's Artboards, animations If Host doesn't have libraries, then it'll just be a removal of all the Lib lines, so we get, Host's Backboard Host's file assets Host's dataenums, viewmodels and their instances Host's Artboards, animations fixes: https://github.com/rive-app/rive/issues/9537 chore: fix clang-17 compiler (#9666) 8a1f3286b9 * chore: fix clang-17 compiler * chore: adding missing file * fix: rive_native builds * chore: remove no runtime linking on linux * chore: more fixes * chore: removing rive_common * chore: use build_rive.sh for ios * chore: use rive_build.sh for recorder * chore: fix fill missing version * chore: add rive_build.sh to path * chore: add rive_build.sh to pr_ios_tests.yaml * chore: add rive_build to the recorder tests * chore: drop rive_flutter tests * chore: fixing ios tests * fix misspelled * chore: cleanup * chore: use latest zlib * chore: premake5.lua redirects to premake5_v2 * fix: tvos and ios builds * fix: unreal build path for miniaudio refactor(TestHarness) Test harness stacktrace's (#9642) c0844f01b5 * added stack trace and signal handling for windows * added stack trace unwinding for mac / linux * refactored into seperate file * add file * builds for non windows * addressed some pr comments library: view model support (#9630) 16c30e956a This PR allows drag+drop a ViewModel from a library asset into a host file. I tried to keep it readable via commits. The approach is pretty similar to how DataEnums work with libraries. I've wrapped every view model property into a library version, which would also contain a componentId that contains the ID of that property in the original library file's core. I've added LibraryArtboard.viewModelId that's similar to Artboard.viewModelId. This is inferred from interalCore when the library file loads (in LibraryAsset.decode, `_updateVms`). The runtime exporter's context needs to keep track of the instances we want to export from the host file. This is b/c view model instances have to be exported with view models, so the host's instances need to be passed back to the library file and exported with its view models. (mapping_context, `requiredVmInstances`). Because runtime is extremely order sensitive, I've also added support for DataEnumValue.order and ViewModelProperty.propertyIndex in this PR. QoL improvements: I refactored the caching logic to account for Library components that are removed, and it's now more generalized (this is tested). Testing: I also added to the import export test in the editor and C++ Demo: https://2dimensions.slack.com/archives/C07M7DQL4F2/p1746745186933889 Fixes: https://github.com/rive-app/rive/issues/9461 Fixes: https://github.com/rive-app/rive/issues/9345 Fixes: https://github.com/rive-app/rive/issues/9570 Fixes: https://github.com/rive-app/rive/issues/9588 add support for symbol index for formula and operation converters (#9655) fbbd128426 feat: Editor text input (#9644) 4aefd8c646 * feat: working on text input in the editor * feat: adding raw_text_input to input * feature: text input starting to work in the editor * feat: text input * feat: text input sizing rules * fix: handle empty lines * chore: fixing dupe core ids * chore: removing old menu system * chore: working on crash * feat: generate text input artboard * fix: setting source artboard hug correctly * fix: failing test * chore: missed popup button file * chore: fix tests * chore: remove no longer valid test * chore: fix more tests * chore: fix more tests * chore: cleanup * chore: fix clashing ids feat: Support js arch in build_rive.sh (#9617) 9763df3872 refactor(webgpu): Delete write_texture and write_buffer helpers (#9640) 527fb53e7f Number to List Converter (#9622) 3a43815502 Adds a data converter to convert a number to a set of List items. This converter is a quick way to generate list items. It can be assigned a ViewModel, and the converter will generate ViewModelInstanceListItems using the ViewModel's default instance. The ArtboardComponentList inspector now displays ViewModelPropertyLists and ViewModelPropertyNumbers in the combobox which can be selected or pickwhipped. refactor(tvos): fallback to libwebp if cg fails (#9534) d3b61cf628 chore: wrap layout nodes for editor (#9641) 6af68fed8b feature: add list index symbol for view model lists (#9643) 2b1a85fa6f * add list index symbol for view model lists fix(gl): Fix uninitialized pixel local storage (#9638) fac712cc41 The GL_EXT_shader_pixel_local_storage extension makes a vague hint in Issue #4 that one could clear PLS to 0 by issuing a glClear with a zero clear value: "This makes the value effectively undefined unless the framebuffer has been cleared to zero." However, Issue #5 may go back on the suggestion from #4 and require applications to always initialize PLS with a fullscreen draw. https://registry.khronos.org/OpenGL/extensions/EXT/EXT_shader_pixel_local_storage.txt Either way, we are observing on some older ARM Mali devices that the glClear approach does not always initialize PLS, resulting in a rainbow-colored QR-code-like pattern of uninitialized tile memory. Always initializing PLS with a draw instead of glClear fixes the issue. Fixes https://github.com/rive-app/rive-react-native/issues/279 Fix Artboard List crash when layout siblings come before it (#9633) 18c9402bc3 A crash was reported with Artboard Lists which occurred when Artboard List had any sibling layouts and starting and stopping the state machine a number of times. Additionally it only occurred if the Artboard List wasn't the first layout child. feat: First draft of a CommandQueue (#9620) 18dc7c390b * feat: First draft of a RiveCommandBuffer RiveCommandBuffer hopes to eventually become the basic high-level Rive API. It's an asynchronous command queue that hides the data behind handles and executes on a separate thread. This initial example is just something to get started. We will evolve the API as we feel out what is needed in the various backends. * More testing * AutoLockAndNotify * CommandQueue * Fix linux build fix(webgl): Work around a crash on Chrome 136 (#9623) 82c66ee251 Chrome 136 crashes when trying to run Rive because it attempts to enable blending on the tessellation texture, which is invalid for an integer render target. The workaround is to use a floating-point tessellation texture. https://issues.chromium.org/issues/416294709 Remove artboardId & useLinkedArtboard props from List Items (#9605) 99534c2749 In order to make ViewModelInstanceListItems more generic in preparation for supporting other types of "Lists" in the future, we are removing Artboard specific properties from this core object. Instead, we infer the Artboard based on the ViewModel applied to the List Item (we use the first Artboard we find that has a ViewModel bound to it that matches the List Item's ViewModel) fix: do not clone converters at resolve time (#9616) ade06e3c79 fix: do not clone converters on import fix(renderer): Gracefully handle null image textures (#9600) 7dd9f91b4a Core problem: The android runtime updates out-of-band assets on the main thread, while rendering and texture updates happen on the worker thread. This led to a race condition where the RenderImage could still have a pending texture update while drawing a frame, meaning its current texture was null. Short term fix: Just don't draw RiveRenderImages if their texture is null. NOTE: This doesn't fix the general race condition where data is simultaneously being read and written by different threads, but as long as we cross our fingers and hope that pointer writes are atomic (an assumption that must also be true for other types of OOB assets being written), the null check will help us limp by until we rearchitect the threading model, which is now a very high priority item. editor: DataEnum in library (#9603) 3df92e66a4 Please review commit-by-commit :) This PR adds DataEnum as a publishable component. Then in the host file, you can drag the DataEnum into the stage. This DataEnum will appear in the Data sidebar, but will be read-only (no re-ordering or adding new values)   Then, in a view model in the host, you can use this DataEnum as if it's defined locally. Some notes 1. A LibraryDataEnum extends DataEnum. The only difference is that it has an asset ID and a component ID. I think this approach makes it such that existing UI's will just work. 2. The runtime exporter now has a concept of what DataEnums are required from each file. This makes sure we always include the DataEnum's needed by the host file. 3. I changed the ID resolving logic into the runtime exporter's bindable hooks. Going forward, this is a unified place to remap ID's. Tests: 1. I added some tests, and also manually verified that transitions understands library data enums. Here's a video: https://2dimensions.slack.com/archives/C07M7DQL4F2/p1746486246058399 Component list refactor pt1 (#9595) 126c53a0f5 Some reworking of ArtboardComponentList and related vm/db classes: - Refactors ArtboardComponentList to accept ViewModelInstanceListItems rather than ContextValueListItem - Adds DataValueList. - Consolidates update and apply functions into a single ContextValue.apply - Fixes a couple of crashes fix(scripts)Fixes down stream dirs (#9601) 343f00ae33 now works with downstream dirs feature: support bindable position units (#9598) 0cadb00a87 support bindable position units test(unreal) added tests and build scripts for unreal static build anylysis (#9553) 7a9da23d19 * added tests and build scripts for unreal static build anylysis * added helpers scripts for building the plugin and platform binaries * now build plugin as well as static analyze it * now builds gm/golden app in CI * build fix for unreal * wip * script fixes Fix clamped scroll drag accumulation (#9596) a596ba0966 When using the clamped scroll constraint in the runtimes it was noticed that when dragging, the scroll offset would continue to increase when you scroll beyond the start or end. Visually the scroll was constrained properly, however, this resulted in having to drag in the opposite direction by the amount that was "overdragged" before it would start moving again in that direction. This behavior was not seen in Dart (nor with the elastic scroll) fix(rive-runtime)moved scripts to be in downstream (#9593) e9fce7bba1 moved scripts to be in downstream Component list js runtime ca744236fb Component list js runtime feat: Move the alpha portion of MSAA blend modes to the blend unit (#9576) 4f9625183f Move the alpha portion of MSAA blend modes to the blend unit The advanced blend modes can be split algebraically into two distinct operations: color and alpha. The color portion has all the custom logic that needs to run in the shader. The alpha portion is run-of-the-mill source-over blending. For the MSAA backend, move the alpha portion of the operation into the hardware blend coefficients instead of doing it in the shader. This gives smoother antialiasing because the blend unit does the blend at each sample separately, whereas the shader runs once per fragment against a single (resolved) destination color. refactor(build scripts) updated setup_windows_dev.bat to act like the ps1 variant (#9577) 7051d2685f updated setup_windows_dev.bat to act like the ps1 variant fix: downstream rive-cpp tests (#9575) 32041efdc7 * fix: downstream cpp * chore: skip input tests when there’s no rive text fix: do not draw fully transparent shape paints (#9573) 6082e56f65 feat: RawTextInput in rive_native (#9564) 5adbd3311d * fix: wrong return type * adding make raw text input * feat: adding some rawtextinput bindings * feat: more raw text input apis * finish bindings * chore: cleanup * feat: expose cursor visual position * chore: allow drag passed bottom * chore: add comments * chore: fixing cast * fix: wrong return types in rive_binding * chore: missed tests checkin Expose Transforms for DataBinding (#9538) cc09ee1983 Exposing transform values of Rive objects to databinding has been highly requested. This exposes values such as x, y, width, height as read only bindable fields. Add Layout scale type to System Enums (#9560) 4ba64bae05 This PR adds the Layout scale type options (Fixed, Fill, Hug) as system enums for data binding. The scale type options enums are necessary for enabling ViewModels to bind to the scale type options. This is particularly important when it comes to Component Lists where Artboards are instantiated dynamically so scale type can't be set at edit time. feature(Dx12 backend) (#9520) b4a317b254 * path_fiddle d3d12 and start of d3d12 imple * converted to precompiled hlsl for tess, grad and atlas. Fixed sampler issue in d3d11 * started implementing resource managment * working state with grad,tess and atlas draws coded. GPUResource mangement also in * draws in with another set of validation fixes * atomic mode working * textures now upload correctly, atomics now have barriers and index/vertex buffers are properly bound * typo fix * made work with gms, uniforms updated correctly now, coelesed and resolve now works * passing golds? * proper que dependencies * added some comments around passing command lists for d3d12, if no copy is given, use direct for both * rename * added golden pr * refactor pulling out all shader compiling to a shared D3DPipelineManager class * pre comments * fixed workflow syntax error fix: pass correct data context to state machine (#9545) 68262f2f3f * fix: pass correct data context to state machine * remove unused var RawTextInput (#9540) 85e8a5681f * starting to add cursor tests * working on cursor positions * two ways to compute location the cursor * working on adding a fully_shaped_text abstraction * improving cursor movement with bidi * adding selection * use rectangles to contour * cursor movement and tests * adding selection caching * adding getting/setting text * test for setting text * adding home/end * feature: word + subword movement and tests * Adding word selection * feat: undo/redo for text input * removing time from text input * separate selection text * chore: remove print statement * chore: clean up * chore: remove printf * chore: do not compile cursor when rive text is disabled * chore: do not use fully shaped text when not compiling in text * chore: strip text selection path when not using rive text * chore: remove unused variables * chore: add changed goldens due to different transform method * chore: rebaseline iphone se * chore: remove unused vars * chore: more unused variables removed feat(vulkan_unity): adding vulkan support to unity (#9544) 38d5ae8571 * starting to add vulkan support * Vulkan works! * use build_rive.sh * fix premake and remove unused var * get lunar sdk * install glslang * all components * Use new sync method for vulkan! * getting vulkan rendering working when color buffer pointer is 0 * frame delay coroutine * fix: crash swapping native texture pointer * feat: linux unity support * chore: adding missed meta file. * chore: adding build downstream for linux unity * install glslang * chore: remove unused code * chore: addressing PR feedback! * chore: add SPIR-V tools back feat(vulkan): Support all render target formats (#9527) 1014fd7fa4 Refactor the Vulkan backend to support render passes of any format, rather than hard-coding RGBA8 or BGRA8. To test this, add a "vksrgb" config just for fun. Shaders aren't generating linear color (yet), but the SRGB attachment works. Fix layout alignment space between (#9526) 59b55d281f When moving between row & column, if alignment was set to Expanded (start, center or end), it would not render at the correct position. This was masked at edit time because when you set the alignment using the grid UX, it switches to an non-Expanded alignment (left/center/right and top/middle/bottom), which causes the alignment to fix itself before clicking again to set it to Expanded. fix(vulkan): Fix input attachmens on AMD (#9513) e5dc0b989c Feedback loops are valid in Vulkan as long as you don't issue overlapping geometry, but we were issuing overlaps and using atomics to disdcard all but one. This seemed valid, but didn't work on AMD. However, if we emit color values of "0" and instead rely on blending to make sure the color buffer doesn't change, it works on AMD ¯\_(ツ)_/¯. refactor(vulkan): Move shaders to a different cpp file (#9504) 598ad6c62e RenderContextVulkanImpl is getting so big that it's hard to navigate and my editor is starting to get bogged down. Move the SPIRV array definitions and shader-building logic to its own cpp file. feat(vulkan): Implement coalesced resolve (#9497) ea1b51f970 Not all swapchains can be bound as input attachments, and Unity doesn't appear to have a way to request VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT for its textures either. Adding the target texture to the render pass and doing a coalesced resolve should be almost as fast as if the color attachment had VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT to begin with. fix: update data binds when events from children are notified (#9499) a21d95735d # Description when a nested artboard notifies events, we need to update data bound objects because those events might trigger changes on values that need to be synced Component List in CPP (#9408) db11b46e96 # Description This PR implements Component Lists in the CPP runtime. # Details Mirrors the Component List Dart functionality in C++. Allows generation of Artboard Instances at runtime through ViewModelInstanceLists. This PR does not implement virtualization. feat(vulkan): Use VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL (#9495) 4ddcd7f9c2 When there is no advanced blend, we can use VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL for the color attachment instead of VK_IMAGE_LAYOUT_GENERAL, which is theoretically slightly more performant. refactor(vulkan): Make RenderTargetVulkan more generic (#9494) 21820c5a7a Rather than just setting & getting low-level information about a texture, add methods to RenderTargetVulkanImpl that explicitly access the target and offscreen textures. These methods require specific layouts and access flags, and will perform barriers if necessary. Also split out a virtual RenderTargetVulkan class that Unity can override and provide its own access mechanism for its internal VkImage objects. In addition to helping with the Unity effort, this greatly simplifies some of the barrier work going on and makes the code more robust. fix: 32-bit Vulkan builds on Android (#9491) f9adbe2746 fix: Fix release build (#9437) 459688c69c Also add two CI workflows to build release on mac & windows to make sure we don't break it again. refactor: Put blend state in PipelineState (#9482) 2d03eba653 Move more pipeline logic up to the higher level and introduce some static pipeline states for the basic draws inside flush. library: allow loading library that uses another library (#9480) bcdfcda330 This PR lazily decodes libraries referred to by other libraries. Fixes: https://github.com/rive-app/rive/issues/9457 Before this PR, a host file will only load the FileAssets referred in itself. If that FileAsset is a LibraryAsset, we don't go look for other libraries it refers. This PR changes that to lazily loading whichever LibraryAssets are needed in the export process. This is manually verified and I also wrote a test for it. refactor: Work out low level barriers at the RenderContext level (#9474) 0ebca777f4 Determine all the barriers at a higher level so that the individual backends don't have to duplicate this work. This also prepares us for another refactor that will move the blend state into PipelineState, and to start supporting "blend barriers" that we can use with non-coherent advanced blend extensions. fix: data converter range mapper argument order (#9467) e5fc8db9e0 # Description data converter range mapper in dart was using the arguments in the wrong order # Details This PR also includes an optimization to avoid a bidirectional data bind to add dirt to itself when it changes the view model value by suppressing dirt while it modifies the view model value fix: access enums data (#9460) 9a843dc27a # Description some fixes related to view models and enums # Details two main fixes: - export system enum names - make sure that viewmodels and enums can outlive the file as long as a view model instance is alive fix: stroke effects not updating with text modifiers (#9463) 2c52089bde # Description fix: stroke effects not updating with text modifiers # Details when text modifiers add paint dirt to the text, we have to invalidate stroke effects so they get redrawn refactor(renderer): pulled out decodeImage from context helper and made it platform decode (#9448) e7b0480e4e # Description made decode Image implantation in `RenderContextHelperImpl` now defined in `RenderContext` # Details We were copy pasting the code for decoding into several places. Moving it to `RenderContext` allows us to have it in one spot and just be used by default. fix: contour bugs with new RectanglesToContour (#9450) 53131428a6 # Description - I caught a bug with multiple contours due to the inclusion setter always using the first rect, so it would fail on rects that would create multiple contours. - Also fixes an issue with the unique point sorter not using the stored vectors. I messed something up when rebasing that previous pr. Adds a test for the multiple contour issue. fix crash if operation stack is 0 in a malformed formula (#9435) b4066558a1 # Description fix crash if operation stack is 0 in a malformed formula Make RectanglesToContour more memory efficient (particularly for re-runs). (#9438) 5c4e83502f # Description In the text input branch I realized I needed to re-use RectanglesToContour and that it would be called often when moving selection ranged cursors. The existing implementation closely matches our Dart one which is not very memory efficient, mostly due to it just being Dart. # Details - Try to store re-used containers on the RectanglesToContour class so allocation can happen less frequently when re-using the RectanglesToContour. - Try to avoid any forced heap allocation (although some is still bound to happen). - We had a lot of Vectors of Vectors. In almost all cases these got simplified to linear vectors or vectors of structs/classes. Because each vector does its own heap allocation, vector<vector<vector<...>>> can cause a lot of memory re-alloc when adding/removing elements. - The boolean inclusion vector got converted to a bitset which is also stored on the class so it can be re-used. - Nuke Rect as we have the same functionality in AABB. - Massaged the API a bit to have names match the updated API a little more closely. I'll add more comments inline below... adds a text listener silver (#9444) 922b445f21 # Description Adds a silver for text run listeners. Creates two frames, one at the start:  And one when hovered over the run:  fix coverage reports (#9446) c07021b43b # Description Re-enables building coverage data. This got nuked when different argument handling was added to test.sh libraries: serialize library artboards as local artboards (#9419) e75974b896 Fixes https://github.com/orgs/rive-app/projects/15/views/1?pane=issue&itemId=104718681&issue=rive-app%7Crive%7C9356 Fixes https://github.com/rive-app/rive/issues/9324#issue-2966381868 ### Overview Currently we do not export LibraryArtboards to runtime, as C++ won't understand them. As such, currently, if you have ArtboardX that contains NestedArtboard_ofALibraryArtboard, a NestedArtboard that points to ArtboardX won't work. This PR makes it such that a NestedArtboard to ArtboardX would show. Moreover, its statemachine will play too. ### There are a few main changes 1. LibraryAsset: cached library artboards in LibraryAsset are referenced by ID instead of by name. This ID is the original artboard's ID in the library asset file, and is persisted in our schema as LibraryArtboard.artboardId. Same same with caching statemachines and linear animations. I've added LibraryStateMachine.animationId and LibraryLinearAnimation.animationId. 2. NestedArtboard: before this PR, there was logic that checks whether the source artboard was a LibraryArtboard or just an Artboard. Now, it's just Artboard, because the runtime exporter only exports Artboards. 3. Runtime exporter: I've created the idea of MappedContext, which maps a library identifier to its various remaps, like globalIndexMapper, nestedIds, eventIds, etc. ### The mapping NestedArtboard.artboardId -> LibraryArtboard.id LibraryArtboard.artboardId -> LibraryAsset's rev file's Artboard.id NestedStateMachine.animationId -> LibraryStateMachine.id LibraryStateMachine.animationId -> LibraryAsset's rev file's State Machine.id ### Order of export Currently, when we export we only go over the host file, and the order looks like Backboard_ofHost FileAssets_ofHost DataModels_ofHost Artboard1_ofHost Artboard1_components_ofHost (e.g. paints, nested artboards, state machines, etc.) Now, I'm recursively also exporting the library files. So the order looks like Backboard_ofHost [XXX] **--FileAssets_ofLibrary --DataModels_ofLibrary --Artboard1_ofLibrary --Artboard1_components_ofLibrary** FileAssets_ofHost DataModels_ofHost Artboard1_ofHost Artboard1_components_ofHost Basically, we insert the indented section, which represents the library file. And if Library uses other library assets, it should go into the [XXX] section. Tho we currently don't support this, as we don't decode library assets used from a library asset. If we aggregate all the artboards, [0, total count) is the range of valid artboard indices in C++. ### Tests I'll fix the TODO's in the tests refactor(renderer): Consolidate MSAA depth/stencil settings (#9436) 689a455e67 log error with missing components (#9431) 099d761edd # Description print errors at the cpp level so they are surfaced on our higher level runtimes # Details In order to provide users with more information about errors, we're relying on the fprintf method from cpp. This is a temporary solution until we build a more robust error message model. chore: flush rive runtime change (#9428) 59d5d4d658 Add silvers without lfs (#9425) f2968887ec # Description re-add silvers, no lfs to keep ios/spm happy chore: temporarily remove silvers (#9424) eabc82a4c2 # Description get rid of silvers for now, to be added back in outside of lfs refactor(vulkan): Lift lifecycle management (#9410) 6cce6709cb Refactor Vulkan lifecycle management into more organized, non-templated classes. Lift them to the renderer level, where D3D12 and Metal can also start taking advantage of the 'safeFrameNumber' paradigm. refactor(renderer): Send map sizes to unmap functions as well (#9407) 7f5e51f4b4 Vulkan was having to track the mapping size from the map() function in order to know how much to flush in the unmap() function. Update the higher level code to just pass the map size to unmap() as well. This also found a bug where we were mapping the entire size of the buffer, rather than just the amount we were going to write. This will most likely make no difference on most platforms, where this is all coherent anyway, but it's good to fix. # Description <!-- Short, digestible description of what this adds or fixes --> # Details <!-- Rationale, history, Slack discussions, and technical details --> <!-- Questions before merging: - If this is a feature, is it sufficiently unit tested? - If this fixes a bug, is there a unit test to ensure no regression? - Does this concern Marketing, and could we make an announcement about it? - If so, now is the time to notify them - Are the commits in [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) format? - This will help with automated release notes --> Metal fiddle context assert fix (#9393) 43d6ac25e6 # Description Fixed Fiddle context drawableSize # Details Now properly set the correct `drawableSize` so that `CAMetalLayer` gives us the correct size Fix GL buffer race condition (#9387) 93d4fda5a2 Fix rendering corruption from nested clipIDs (#9383) 373238831d add support for joystick time based dependents (#9272) 038bd34aee # Description fix for joystick controlled timelines not updating the time # Details If a state machine has a timeline controlling a nested remapped animation through keyframes, and that timeline is itself controlled by a joystick our update cycle would not apply the time updated by the joystick because the advance cycle has passed. This PR looks for joystick controlled animations, and stores which objects are nested remapped animations to advance them while they are being applied. Switch image textures to premultiplied alpha (#9377) a70f0f84dd The renderer intentionally chose unmultiplied alpha for gradients, in order to not lose color information with transparent stops. But for this very same reason, we need *premultiplied* alpha for image textures. Otherwise, the (transparent) background color can bleed into edges. Switch image textures to premultiplied, while keeping gradients unmultiplied. rive-runtime pull silver rivs (#9384) 9d516a9ece # Description rive-runtime is building, but now its failing on the silvers. I **think** it could be because we need to git pull lfs the srivs so trying that. Fix glfw working path (#9382) bd512ec1d9 # Description Previous PR to fix rive-runtime test had the path relative to mono, not relative to rive-runtime. Fix Rive-runtime tests (#9381) 92a4d0a287 # Description Mac unit tests for the downstream rive-runtime have been failing for some time. Looks like glfw wasn't being built in the downstream workflow. # Details This PR adds the Build glfw step that we do in our mono repo into the rive-runtime test workflow. Ran it locally, was able to repro the test error and this fixes the issue locally. ``` ../../../../renderer/path_fiddle/fiddle_context_gl.cpp:23:10: fatal error: 'GLFW/glfw3.h' file not found hb-ot-map.cc #include "GLFW/glfw3.h" ^~~~~~~~~~~~~~ ``` Nnnn conditionnally export images and artboards (#9376) c4dcac3232 # Description add support for three features: - set images as guide layers - select which additional artboards are exported with the riv file - select which additional images are exported with the riv file Component Lists (Dart) (#9278) 55918df404 # Description This is a first pass at the Dart implementation of Component Lists (dynamically generated lists). In this iteration, the Component List items can be built up using ViewModel list items together with Artboards. # Details ArtboardComponentList is a new type of Drawable that builds up and renders MountedArtboards in a similar way to how NestedArtboards work. To use it with DataBinding, perform the following steps: 1. Create a ViewModel to contain your list 2. Create another ViewModel representing your List item. You can also add properties to this viewmodel that are bound to properties in an artboard to be used as a list item. 3. In the ViewModel created in step 1, add a List property from the popout 4. Select the List property and in the inspector, add List items. These items should be tied to instances of the ViewModel created in step 2 and the Artboard to be used as your list items. 5. Bind the ViewModel from step 1 to the Artboard where you are adding the Component List (ie Main Artboard) 6. On the main artboard, select either the Artboard itself or create a layout and select the layout. In the inspector, click **Add Artboard List**. The Component List will be added as a child of the selected Artboard/Layout. 7. Select the Component List, then bind the ViewModel's list property to the Source field (either via pickwhip or right click) 8. Play the state machine Notes: - (UPDATE: workarounds have been removed and it now works with design mode DB)There are a couple of workarounds to get this to work because the ViewModels don't get "applied" until the State machine starts playback (this will change soon with Design time DataBinding). Those are pointed out in the comments. - (UPDATE: crash has been resolved)There is also a temp workaround for a crash I was seeing. Need to investigate further. - Editor UX still needs work - CPP implementation to follow in a seperate PR check for msbuild so we know if we need to load the vs environment (#9374) 762485768a # Description Fixes build_rive.ps1 so that it no longer eventually breaks PATH # Details added a check that only loads the VS environment when `msbuild` is not found <!-- Questions before merging: - If this is a feature, is it sufficiently unit tested? - If this fixes a bug, is there a unit test to ensure no regression? - Does this concern Marketing, and could we make an announcement about it? - If so, now is the time to notify them - Are the commits in [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) format? - This will help with automated release notes --> Update ANGLE_shader_pixel_local_storage usage (#9367) 85cdb31022 Update our bindings, definitions, and usage to reflect the latest updates to the extension. Notably, we can now compile programs while PLS is active, so no need for the duplicated logic inside and outside of PLS being active. Libraries (#9255) 9d8a7e81fa feature: core definitions for libraries feature: basic editor ui for libraries feature: basic library backend api integration feat: return string reference from vm instance runtime name (#9366) f359c918e0 Changed `ViewModelInstanceRuntime::name()` to return a const reference instead of a string copy, making Unity marshalling a bit easier. Listener Silver and How to make a Silver (#9321) 8bdedb6b19 # Description Small example tutorial for how to make a silver, also adds a silver in the process. # Details Details/tutorial here: https://www.notion.so/rive-app/Make-a-new-Silver-1c95da0b06d9808e9fbbe6bdf6219df4?pvs=4 Revisit numeric stability for colordodge and colorburn (#9313) 1e42beac24 A previously-solved issue had crept back in, where unmultiplying "color == alpha" did not yield precisely 1.0. Fix the issue (again) and set up full blown unit tests for the glsl code to ensure this doesn't regress again. Nnnn viewmodel runtime updates (#9300) 5dba17ac5d # Description - add support for binding an artboard through a state machine - implements callbacks per view model instance instead of using the root instance - fixes some memory issues - adds a first set of tests Nnnn data bind fixes 9 (#9314) 8bb6aa6311 # Description Four small fixes: - reset playbackValues when syncing view models - rename Boolean Negate to Boolean Toggle - pad hex values in to string converter - expose js viewModelCount getter Silvers (#9281) b329a96f26 # Description This adds the ability to serialize draw commands to .sriv file via a SerializingFactory which can be used by the unit tests in place of the NoOpFactory. # Details You can use the SerializingFactory to initialize your .riv and annotate the serialization with things like frame size and new frame/frame begin. This makes it possible to drop the generated .sriv into the Flutter viewer which will perform the serialized rendering commands to show exactly what the runtime is doing, high level rendering-wise. It can also diff two .sriv files if they are dropped in one drag/drop op. When adding new "Silver" tests make sure to rebaseline the silvers by doing: ``` cd rive/packages/runtime/tests/unit_tests ./test.sh rebaseline ``` You can now modify the runtime and re-run the tests to make sure the silvers still match: ``` ./test.sh ``` The important function to call at the end of your test is ::matches on the SerializingFactory. This will either save or check for equality of the existing silver. ``` TEST_CASE("juice silver", "[file]") { SerializingFactory silver; // .. actually use the factory CHECK(silver.matches("juice")); } ``` Remove a spurious print from WebGPU mipmap generation (#9306) f346d7b933 Make elastic scroll properties bindable (#9304) 1673c55a6c # Description Making elastic physics properties Friction, Speed Multiplier and Elastic factor bindable. # Details Also added a few unit tests for ScrollConstraint. Will add more. More WebGPU fixups (#9187) ea9f89e682 Use an empty bind group instead of a null bind group when an index is unused. Make the base instance uniform more flexible. Nnnn data bind mode design (#9279) 305920643b # Description Adds support for data binding in design mode. Implement mipmaps in WebGPU (#9302) de583e7000 Mipmaps had not been implemented yet because WebGPU doesn't provide an easy mechanism to generate them. Generate mipmaps by literally rendering higher levels into lower levels. Fix for layoutstyle dirt continually being added in nested artboards (#9298) 05d87692bb # Description Noticed when using scrollbar constraints in a nested artboard that LayoutStyle can continue to be dirtied. # Details Continual LayoutStyle dirt was the result of a recent change related to Layout Direction. With layout direction, we needed the cascade of direction information to result in calculateLayout and updateLayoutBounds, so we forced that to happen in nested artboards. However, this caused a side effect with continual dirt. The fix now checks to see if the cascade resulted in any changes, in which case we call calculateLayout and updateLayoutBounds. Improve numeric stability of blend modes (#9290) 2ed28d20e6 Turns out it was possible for src and dst to fall outside the range 0..1. The blend math relies strictly on these values both being within said range, so clamp them. Rearrange the COLOR_DODGE and COLOR_BURN formulae to no longer rely on receiving appropriately signed IEEE Inf values from dividing by zero. The spec mandates this behavior, but it's too dangerous to rely on it. Fix Layout issue with image when N-slice applied (#9283) c118df3ccb # Description Images were not respecting their parent layout's size when an N-slice was was applied as a mesh (runtime only). # Details This bug was introduced as part of another fix (https://github.com/rive-app/rive/pull/8840) where the correct value of type was not being applied for n-slice meshes. Accept a raw VkImageView in the Vulkan renderTarget (#9286) f103ee589e Now that the client is fully in charge of synchronization, we don't need to bridge awkwardly between the client's data and Rive's internal resource management (i.e., VulkanContext::makeExternalTextureView()). The client can just give us a VkImageView and make sure they don't delete it until they've waited for that same frame's fence. Only call gms_build_registry() once (#9289) 0122594822 Looks like these were accidentally being run twice each. We only need one run. Overhaul Vulkan synchronization (#9280) 335ed61d42 The Vulkan backend has been requiring the client to pass fences along from queue submissions, and then it waits on these fences on its own timeline. This is hard to work with, bug prone, not optimal for performance, and just isn't very Vulkany. This change removes all CPU-GPU synchronization from Rive's backend. Instead, the client is responsible for waiting on its own fences (which, realistically, it was already doing anyway). Instead of passing in fences, it just passes in two lifecycle counters currentFrameNumber and safeFrameNumber. Resources used during the flush belong to 'currentFrameNumber'. Resources last used on or before 'safeFrameNumber' are safe for Rive to be release or recycle. Begin rework of Vulkan synchronization (#9275) 051f5a7411 Final vision: Client takes full responsibility for their app's Vulkan synchronization; Rive never touches a fence or semaphore. In this PR: Update just the testing backends to synchronize on their own fences instead of passing them along to Rive. Factor out a rive_vkb::Swapchain class that encapsulates the common functionality from all the Vulkan testing backends. This update alone fixes the Vulkan crashes we were seeing on Android, so also turn Vulkan CI testing back on! ...And also fix some bugs to get us running on ARM GPUs. More cleanups for Vulkan bootstrapping (#9270) 0d2bfd8f72 * Pass around fewer pointers to vkGetDeviceProcAddr. * Use more modern Vulkan instance versions in non-vkcore configs. Reduce the # of arguments required for Vulkan context creation (#9265) d1602f07cd Don't ask for things we can query ourselves. Make it easier on the client calling us. Supporting binding of Layout enums (#9247) f5975ce890 # Description Adds support for Layout enums as system enums to allow DataBinding. # Details Adds binding support for the following Layout enums: - Flex Direction - Wrap - Direction (LTR/RTL) - Alignment - Show/hide - Absolute/relative Also updates some of the core widgets to display the DB border more consistently. This includes ComboBox, MultiToggle and custom alignment widget. editor: fix using feather with opacity in a text modifier (#9233) ae422c57fb When using a text modifier with opacity settings, we go through a different route for rendering. In the render function for the shape paint, we apply an override render paint to it that copies over the color of the shape's original render paint, but with opacity overrides (this is the `applyTo` call). We currently do not apply the original render paint's feather attributes. This PR does that. Some details: 1. Previously, linear gradients didn't account for the text modifier's opacity overrides. This PR accounts for it. 2. Inner feathers depend on a text style's _renderPath for its bounds calculations, so we need to make sure this is updated even if it's not used for rendering as-is. 3. I added a golden test before in editor+nested artboard  after:  Nnnn data bind fixes 8 (#9239) 8d15312404 # Description change default view model color to 0xFF000000 use checkbox for view model booleans during playback More Build Options (#9240) ff4d47326e # Description Added Build and Platform Options define rive::math::pi to be the same as m_pi (#9241) a201088666 # Description make `rive::math::pi` the same number as `M_PI` so that `M_PI` is no longer needed. fix lists and viewmodel instances (#9236) 0bd3aad9ec # Description fix view model instances destroyed fix view model instances not being reused # Details When lists were created, we were wrapping them unnecessarily in an rcp which would cause the instance to be destroyed when it went out of scope. This PR also fixes a scenario where, if the original view model instance tree had multiple branches pointing to the same view model instance, the copy would create new copies for each branch instead of reusing the same cloned one. Nnnn data bind tests (#9180) c8441a6f67 first batch of data bind tests it covers converterts, binding properties and state machine conditions also fix some deletion of instances surfaced by tests add support for replacing view model instances and improve memory man… (#9206) 70bb6bd0f7 add support for replacing view model instances and improve memory management # Description Adds support for replacing view model instances in a view model instance sub tree # Details We have heard requests to replace or reuse view model instances across multiple files. This PR addresses both cases by exposing an appropriate API and handles memory as needed. fix: include artboard data bindings when cloning an artboard instance (#9215) 1833d63ebb # Description data bindings targeting artboard properties were not being cloned when generating an artboard instance # Details since artboards are cloned separately, cloning their data bindings was missing Fix layout isDisplayHidden check in CPP (#9223) cf1026cb7f # Description A file containing 50 levels of nested layouts would hang when opening. # Details There was a recursion bug discovered in the CPP LayoutComponent causing the freeze. The fix was tested with layouts 100 levels deep on the main artboard and nested artboards and performed without any problems. Added a couple of additional optimizations after chatting with @bodymovin. Renderer - move draw limit check to run before draw resource allocation occurs (#9200) e97d77938d Renderer - There is an issue where resource allocation for draws (which currently refers to only coverage buffer and feather atlas allocations) from within allocateResourcesAndSubpasses() can succeed, but be followed by a failed check for hitting an internal draw limit. This causes the draw that was attempted to be submitted/pushed to reattempt to push a second time, and then make a second allocation. This PR rearranges the limit check and splits out the subpass determination to avoid this issue, although the code is still fragile as-is. Vulkan - Atlas texture barrier fix (#9212) 48b57c6062 Renderer, Vulkan backend bug fix: The barrier that occurs after the atlas texture render pass was incorrectly performing the barrier on the tessellation vertex texture. This barrier could cause corrupted data in the tess texture. make slicer width and height bindable (#9209) d48e9c8513 # Description add two missing bindable properties # Details allow width and height of n-slicer to be bindable n-slicing: update path when removing n-slicing (#9211) cecd189934 The Path needs to recompute its render path to update the positions of its vertices on the screen. When an NSlicedNode is becoming irrelevant to a Path, e.g. when we ungroup it, or when we drag a shape out of the hierarchy, Path needs to update. However, currently it doesn't because update() happens after a core component's onRemoved. This means, deformer from the Path's perspective will be null. This PR tells Path to update whenever Dirt.nslicer is propagated, regardless of whether it's currently under the effect of one. But it will only recalculate path on worldTransform dirt if a deformer is valid. I verified that when we ungroup or drag a shape out of a NSlicedNode, the most updated path is shown. Layout Direction Left/Right Logical Properties (#9202) 6cd55f8411 # Description Adds support for treating left/right based layout property values as logical values, similar to how HTML start/end logical properties work. These include: - Left/right Padding - Left/right Margin - Absolute left/right Position - Left/right Corner Radius # Details The initial commit to support Layout direction only included relative layout child position (and text), but it was pointed out that it would be useful to also support the above property values. Adding support for these by default, but they can also be overridden for any particular layout if desired by setting its own Direction to either LTR or RTL since we support direction as a cascading layout style. We also updated the Direction combobox so that it always appears on a layout flex inspector regardless of whether it has layout children or not, since it may contain a text child which can also have its direction set using this property. Golden test included. clear bindable property when used (#9198) e3cd39b754 # Description fix: If a bindable property is used in multiple places it causes invalid states and can lead to a crash # Details a bindable property has a single owner responsible of its lifecycle, so we need to clear its value once it's used runtime golden: add support for databinding (#9188) c21188ef26 This PR adds support for databinding in the runtime golden test framework (not the flutter one). I also added a test: <img width="652" alt="image" src="https://github.com/user-attachments/assets/88a658d9-d0eb-4f16-9e54-5fa308d5c335" /> I also added support for the skia viewer app and path fiddle, and verified that the .riv file added in this PR renders well in both those places. fix warnings reported by a client (#9192) 66b36fc42e Reported here: https://2dimensions.slack.com/archives/C08BQSENP08/p1741376439219539 Definitely seems like this is undefined behavior: https://en.cppreference.com/w/cpp/string/basic_string/basic_string Fix bit rotting in WebGPU (#9183) 3eae4e45b0 Update Dawn integration and peg the build script at a specific commit. Implement feathering. Fix image textures. editor+runtime: text follow path orient, strength, and trim path props (#9177) 7fe2e81969 These properties take inspiration from Rive's other features. E.g. the creative time are used to manipulating the start+end+offset in trim path, and the follow path constraint has strength and orient. For trim path, I'm noticing that the stroke always wraps. However, I thought it'd be kinda cool to intentionally not wrap if the range is <100% on a closed path. Then you can get a cool kinda effect with tangents (e.g. the penultimate row on the golden test below). This is the new UI (in a popout):  I added a golden test that looks like this: <img width="926" alt="image" src="https://github.com/user-attachments/assets/376b7969-ea7b-479f-8bad-d098e5914bf0" /> Co-authored-by: Gordon <pggordonhayes@gmail.com> Co-authored-by: hernan <hernan@rive.app>
Rive Flutter
Rive Flutter is a runtime library for Rive, a real-time interactive design tool.
This library allows you to fully control Rive files in your Flutter apps and games.
Table of contents
Overview of Rive
Rive combines an interactive design tool, a new stateful graphics format, a lightweight multi-platform runtime, and a blazing-fast vector renderer. This end-to-end pipeline guarantees that what you build in the Rive Editor is exactly what ships in your apps, games, and websites.
For more information, check out the following resources:
Getting started
To get started with Rive Flutter, check out the following resources:
For more information, see the Runtime sections of the Rive help documentation:
Choosing a Renderer
In Rive Flutter you have the option to choose either the Rive renderer, or the renderer that is used in Flutter (Skia or Impeller).
You choose a desired renderer when creating a Rive File
object. All graphics that are then created from this File
instance will use the selected renderer.
final riveFile = (await File.asset(
'assets/rewards.riv',
// Choose which renderer to use
riveFactory: Factory.rive,
))!;
Options:
Factory.rive
for the Rive rendererFactoy.flutter
for the Flutter renderer
For more information and additional consideration, see Specifying a Renderer.
Note on the Impeller renderer
Starting in Flutter v3.10, Impeller has replaced Skia to become the default renderer for apps on the iOS platform and may continue to be the default on future platforms over time. As such, there is a possibility of rendering and performance discrepencies when using the Rive Flutter runtime with platforms that use the Impeller renderer that may not have surfaced before. If you encounter any visual or performance errors at runtime compared to expected behavior in the Rive editor, we recommend trying the following steps to triage:
- Try running the Flutter app with the
--no-enable-impeller
flag to use the Skia renderer. If the visual discrepancy does not show when using Skia, it may be a rendering bug on Impeller. However, before raising a bug with the Flutter team, try the second point below👇
flutter run --no-enable-impeller
- Try running the Flutter app on the latest master channel. It is possible that visual bugs may be resolved on the latest Flutter commits, but not yet released in the beta or stable channel.
- If you are still seeing visual discrepancies with just the Impeller renderer on the latest master branch, we recommend raising a detailed issue to the Flutter Github repo with a reproducible example, and other relevant details that can help the team debug any possible issues that may be present.
Supported platforms
Platform | Flutter Renderer | Rive Renderer |
---|---|---|
iOS | ✅ | ✅ |
Android | ✅ | ✅ |
macOS | ✅ | ✅ |
Windows | ✅ | ✅ |
Linux | ❌ | ❌ |
Web | ✅ | ✅ |
Be sure to read the platform specific considerations for the Rive Flutter package.
Awesome Rive
For even more examples and resources on using Rive at runtime or in other tools, checkout the awesome-rive repo.
Troubleshooting
The required native libraries should be automatically downloaded during the build step (flutter run
or flutter build
). If you encounter issues, try the following:
- Run
flutter clean
- Run
flutter pub get
- Run
flutter run
Alternatively, you can manually run the rive_native
setup script. In the root of your Flutter app, execute:
dart run rive_native:setup --verbose --clean --platform macos
This will clean the rive_native
setup and download the platform-specific libraries specified with the --platform
flag. Refer to the Platform Support section above for details.
Building rive_native
By default, prebuilt native libraries are downloaded and used. If you prefer to build the libraries yourself, use the --build
flag with the setup script:
flutter clean # Important
dart run rive_native:setup --verbose --clean --build --platform macos
Note
: Building the libraries requires specific tooling on your machine. Additional documentation will be provided soon.
Testing
Shared libraries are included in the download/build process. If you encounter issues using rive_native
in your tests, please reach out to us for assistance.
Contributing
We love contributions and all are welcome! 💙
Issues
- Reach out to us on our Community
- File an issue on the Rive Flutter repository