mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-11-02 04:37:12 +08:00
feat(flutter): resart ticker on pointer event (#10479) f7f795e530
* feat(flutter): resart ticker on pointer event * docs(flutter): update CHANGELOG * Update packages/rive_flutter/lib/src/painters/widget_controller.dart skip collapsed objects from running data bound values (#10476) 7868b2bb71 chore: do not run data bound properties from collapsed objects Improve Layout display handling incorporating it with isCollapsed (#10473) 0389f47d3d We revisited how we handle layout display changes and how they related to the collapsed dirt on a LayoutComponent: We now override isCollapsed in LayoutComponent to take into account both the collapsed dirt that may have been propagated down from a parent AND the LayoutComponent's own display value. If the layout has collapsed dirt, it MUST have been propagated down so it takes precendence, otherwise use its own display value We removed the need to walk up the parent tree to figure out if any layout in the hierarchy is hidden We removed a workaround to prevent a 1 frame visual glitch. This workaround was resolved by this fix and is no longer needed. chore: add collapse and solo test (#10471) c903296458 * chore: add collapse and solo test Work around the Galaxy S22 rendering issue (#10468) 3dcdb47683 Work around the S22 rendering issue Chris figured out that this was broken with the introduction of using KHR_blend_equation_advanced (vs. the coherent one) - the S22s specifically report compatibility with it but the rendering is wrong. To fix it, unfortunately, the best way we could think of was to (just before the first beginFrame call) do a quick test where we render some known colors with a known blend mode to a tiny texture then read the output and validate it's within a threshold. Right now the threshold is large because the actual error in practice was massive, so this works - only the S22 models trigger the "oops I can't use this" threshold and back out support. fix: create a copy of the events list to avoid clearing immediately a… (#10461) 70108fd1a6 fix: create a copy of the events list to avoid clearing immediately added events refactor(UnrealPlugin): Unreal Rewrite Tech Preview (#10382) d4a7f91ee5 * removed opengl renderer because it never worked anyway * removed android check that is no longer used * remove iriverenderer * prepping for commandQueue * wip * wip * started implementing draw loop * wip * now stripped down to no include rendering anywhere its not needed * rive now attempts to render, but server is not loading ile * wip * wip * started adding support for non uav render targets * statemachines now update correctly and basic rive leaf widgets draw * listeners now added for file and artboard * merge master changes * made ui draw more performent * added todo * added statemachine listener and settled callbacks * added resource handling for rive handles * Started implemetning file data in viewer * now display data about artboards, statemachines and viewmodels. Fixed crash with resizing preview * fixed bugs, better formating * Properties now display correctly for URIveFile Asset Editor * Dynamic View Model Node First implementation * make view model nodes wip * make artboard and make view model nodes finished * wip viewmodels * Generate view model blueprints * almost finished data binding * Unreal MVVM finished. Command Q still needs work * integrated external images and data binding artboards in unreal * fixed opening file details * leaf widget now correctly uses fit and alignment. Fixed a couple of bugs * added clip path for widget view * cleanup, data binding finished (probably). smoother reimport. proper enum creation for blueprints. * Error checks now work for custom bp nodes * File now saves data instead of requesting it every time * properly saves and loads file. Now builds for standalone * added defaults for instances * auto binding view models, properly holding a ref to bound view models. general cleanup * dont subscrive to view model properties * added SetStateMachine to URiveViewModel * fixed delegate signature * fixed some bugs related to output pin * fixed a few bugs with loading / saving nodes * properties now properly get created with signatured and notifies * GM module now works with re-rewrite * now get values on start. * auto bind now uses rive descriptor * lists working * added way to check if you need to get defaults * now update list size when data updated * fix build issue * added way to get view model properties via c++ * audio works * made audio engine a little easier to use * started implementing rive render target * added shader types * raster order shaders now link * Now raster ordering plugged in. * wip * wip * wip * now supports render targets that don;t have render target flag. * thumbnail renderer now works * started implementing render target. only needs gamma correction * removed uneeded message and test file. * now updated render target dropdown for artboards and state machines * Removed RiveTextureObject * removed RiveEvent class * raster order mode mainly works now * better copy for back buffer * made default clear value for back buffer transparent so it uses fast clear * fixed color mode for render target * dont setup on cdo's * added srgb gamma correction * started getting packaging working * now packages for windows * goldens / gms now run with rewrite * Re added dropdown names for rive actor * check for null handle * now builds on mac * removed uneeded file * PR comments feature: add auto generated state machine on artboard initialization (#10420) 6c147cb33f * feature: add auto generated state machine on artboard initialization feat: Re-enable GL_KHR_parallel_shader_compile on ANGLE (#10465) 7bf33dc199 Rather than disabling the extension entirely, we can just avoid calling glMaxShaderCompilerThreadsKHR on these devices. feature: adding scripted list property (#10457) 5c83e3cd4a * feature: adding scripted list property * fix: missed file fix: Disable KHR_parallel_shader_compile on ANGLE (#10458) bac33a5808 Various Galaxy devices using ANGLE will crash immediately if we turn it on, so just don't use it there. feat: Update goldens and player to deploy in the browser (#10453) 827077b899 Set up http and websocket servers in deploy_tests.py that allow us to communicate with the remote wasm app similarly to how we communicate with android & ios devices. Add a "-w" target to check_golds.sh that kicks tests off in the default browser. Update our renderer premake vulkan version to 1.4.321 (plus another build fix) (#10452) c26e82adc9 * Update our renderer premake vulkan version to 1.4.321 (and also add a few missing RIVE_UNREACHABLEs) Was getting build errors trying to build Vulkan relating to the vk memory allocator header noting a mismatch between the vulkan sdk being reported and the #defines in the headers, and Chris mentioned that we could just upgrade it to be 1.4 now. Additionally, I got a couple errors in two functions that didn't return in the "default" case, which needed RIVE_UNREACHABLE() at the end like the other similar functions had. * Rebase the pixel6 GL and Vulkan goldens Scripted artboard inputs (#10449) 4a7bec6316 * feature: working on artboard inputs * feature: artboard inputs * feature: artboard input * feature: artboards controlled by scripts * chore: bump to latest luau * feature: show only valid artboards * chore: adding a test for scripted artboards * fix: dart test * chore: fix tests * chore: adding missed coin.riv * chore: fix copy ellision warnings add support for property multiplier on vertices (#10436) 500cb42240 add support for property multiplier Improve handling of Yoga exceptions in editor (#10438) b39218b476 Prevent Yoga related crashes in editor and expose whether a Yoga node is in an error state so we can provide a warning to the user. Nnnnn skip properties from recording to journal (#10437) 036b51345e * fix: add non recording propeties to json defintion feat: add support to format numbers with commas (#10445) cf47b03e54 * feat: add support to format numbers with commas Don't perform shape AABB hit tests when walking up parent tree (#10444) d8beb0c4ea This PR skips parent shape AABB tests when hittesting components. There was an issue following recent updates to walk up parent tree when performing hit tests which would prevent objects nested inside shapes from being hit due to trying to AABB test the parent shapes in cases where the shape had no path or the path did not overlap with the listening component. chore: unwrap rive::File for rive_native (#10442) 1fa625f5c9 * chore: unwrap rive::File for rive_native * chore: fix wasm binding feature: making rive::File rcp (#10439) 213f07ec13 * feature: making rive::File rcp * fixes * fix: recorder Add background draw shader loading to GL, D3D11, and D3D12 (#10388) c681049169 This adds AsyncPipelineStateManager to the render code, which handles the background processing of draw shader creation (not, at the moment, other shader types...there's no reason those couldn't be added as well, but this seemed the biggest target). If a given shader has not been compiled yet, we will fall back on an ubershader version with all features enabled the ubershader version will be compiled synchronously if it does not exist yet For the D3Ds, this is done with a background thread that compiles the shaders. GL, however, does not seem to play nice with background threading shader creation. But what it does have is the KHR_parallel_shader_compile extension, which basically lets the driver create threads in the background and thread the shader compilation. The shader manager, in this case, needs to poll the completion state every time the shader is requested and potentially push the compilation along to the next stage (i.e. once linkProgram has completed, then we can do the rest of our setup) If KHR_parallel_shader_compile is not supported (for instance, with WebGL on Firefox) then shader compilation will just happen synchronously (I could not find a clear way to thread the GL shader creation, but I would happily add it as a fallback if there is a way) This change also updates our GLAD loader to version 2.0.8 (from 0.1.36!), which had some API changes. Add shaders to SLN for renderer (#10435) 5188bbb7b1 * Add shaders to SLN for renderer * Clang format Add headers to premake lua files (#10434) b7038e078d * Add headers to premake lua files feat(webgpu): Add support for the webgpu2 API (#10423) f27cb54942 Also update wagyu extensions. Artboard List items follow path (#10417) 68a608cfad Adds support for list items to be rendered on a path when a Follow Path constraint is applied to the Artboard list. Currently, the items will be evenly spaced on the path between 0 and Distance (which is set on the Follow path constraint). For example, with Distance set to 100%, items will be spaced between the start and end of the path. With Distance set to 50%, items will be spaced between the start and half the distance (length) of the path. feat: Bump clang-format to v19 (#10429) 270034cbcd feature: add support for list based paths (#10409) fb374dcad4 * feature: add support for list based paths fix: skip pad conversion if text is empty (#10418) b00368b1c4 feat(unreal android): Get build settings and goldens to build for unreal (#10413) 625123dbae * updated build script to look for android sdk unreal expects * proper platform settings for unreal android * made check golds work with unreal android Runtime profiler base (#10391) 4171e09f80 * Add profiling macros and optick profiler * Update premake5_optick.lua * Added more profiling markers * Remove microprofiler option for now as not implemented * Added more markers ro rendering code * Update Optick build premake only for windows builds * More build file changes for optick with windows * Change how optick is built on windows * Update premake5_v2.lua * Update build files to use with_optick option * Added ScopeName macro to appease ASAN * Push to rekick jobs * Delete ProfilerMacros.h * Create profiler_macros.h * Update path_fiddle.cpp * Update fiddle_context.hpp * Update for rename of header * More header changes * Update fiddle_context.hpp * Update profiler_macros.h * Update for clang format * Update fiddle_context.hpp * Update profiler_macros.h * Update profiler_macros.h * Changed premake values on Chris' comments * Removed multiple define fro RIVE_OPTICK and now in rive_build_config.lua * Added Optick URL and Version to rive_build_config feature: hydrogen search improvements (#10412) f6d5d55b26 * feature: command+g/shift+command+g to find next/prev * feature: add command+d to select word occurences * fix: warning * chore: cleanup feature: add support for trigger properties from scripted viewmodels (#10399) ec342c1e4d * feature: add support for trigger properties from scripted viewmodels * fix: memory usage test * feature: adding trigger as an input * chore: fix warnings * feature: allow calling trigger fire() from scripts feat(gl): Start using the EXT_shader_pixel_local_storage2 API (#10410) b16a5e5d70 This avoids a fullscreen draw to initialize PLS (when the v2 extension available), and also works around an issue of corruption on PowerVR Rogue GE8300. Respect hug with all nested artboard and artboard list types (#10403) 7f3ed82d57 A customer requested feature, previously when using node or leaf type nested artboards, we would always render using the fixed artboard size (even if the artboard was set to hug). This modifies the behavior so that if the Artboard is set to hug, we respect that. This also applies to the newly implemented artboard lists when not in layout mode. fix(webgpu): Make sure PLS resolve triangles don't get culled (#10397) ef5760d69c feature: ability to unload/unregister a module (#10395) 9e2f6211d7 * feature: ability to unload/unregister a module * feature: complete implementation into rive_native Add support for non-layout constrained Artboard Lists (#10384) 520e01a0f2 This PR adds support for Artboard List items that can be positioned directly using DataBinding by binding to the x & y property values of the Artboard itself. Currently, the behavior is that if the artboard list is a child of a layout, it will apply layout rules, but if its a child of a group or solo, it will allow control of its position through binding. feat: add to number converter (#10390) 4d835a3637 add to number converter Feature: print statements + console (#10375) 81ddf4d6ee fix: use word joiner instead of line separator for breaks (#10381) cd13ab364d * fix: use word joiner instead of line separator for breaks * fix: whitespace detection bug make value bindable for rounded numbers (#10379) 891f1f5d81 make value bindable fix: trigger adds dirt to listeners only when it is not reset (#10377) 760472b069 fix: Always use WGPUWagyuShaderLanguage_GLSLRAW on Wagyu/GLES (#10372) 0cc0b7e63c Rive shaders tend to be long and prone to vendor bugs in the compiler. Always send down the raw Rive GLSL sources when running on Wagyu/GLES, which have various workarounds for known issues and are tested regularly. feature: add support for vertical alignment on text with ellipsis (#10365) 33ec7249cd add support for vertical alignment on text with ellipsis Co-authored-by: Gordon <pggordonhayes@gmail.com> Co-authored-by: hernan <hernan@rive.app>
This commit is contained in:
@ -1 +1 @@
|
||||
afc58acd821fa31283d3ce8424be3d1c6b52ec41
|
||||
f7f795e53015b92c38abe175259caa7b5032cb76
|
||||
|
||||
@ -1,3 +1,9 @@
|
||||
## Upcoming
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fixed [496](https://github.com/rive-app/rive-flutter/issues/496) - playback now properly resumes during pointer interactions, preventing graphics from appearing frozen when users interact with them.
|
||||
|
||||
## 0.14.0-dev.6
|
||||
|
||||
Bumps to `rive_native: 0.0.9`
|
||||
|
||||
@ -33,6 +33,17 @@ base class RiveWidgetController extends BasicArtboardPainter
|
||||
stateMachine = _createStateMachine(artboard, stateMachineSelector);
|
||||
}
|
||||
|
||||
/// Whether the state machine advanced during the last tick.
|
||||
var _didAdvance = false;
|
||||
|
||||
/// Whether the state machine has been scheduled for repaint.
|
||||
///
|
||||
/// Set to false in [advance] (paint).
|
||||
var _repaintScheduled = false;
|
||||
|
||||
/// The previous hit result observed.
|
||||
var _previousHitResult = HitResult.none;
|
||||
|
||||
// TODO (Gordon): Remove this once we have polling or a general callback
|
||||
// The editor uses this, and we're copying that behavior for now.
|
||||
CallbackHandler? _inputCallbackHandler;
|
||||
@ -130,7 +141,9 @@ base class RiveWidgetController extends BasicArtboardPainter
|
||||
|
||||
@override
|
||||
bool hitTest(Offset position) {
|
||||
final value = stateMachine.hitTest(
|
||||
if (!active) return false;
|
||||
|
||||
final hit = stateMachine.hitTest(
|
||||
localToArtboard(
|
||||
position: position,
|
||||
artboardBounds: artboard.bounds,
|
||||
@ -140,11 +153,15 @@ base class RiveWidgetController extends BasicArtboardPainter
|
||||
scaleFactor: layoutScaleFactor,
|
||||
),
|
||||
);
|
||||
return value;
|
||||
// We need to process another state machine pointer event, to account for
|
||||
// potential exit events.
|
||||
return hit || _previousHitResult != HitResult.none;
|
||||
}
|
||||
|
||||
@override
|
||||
pointerEvent(PointerEvent event, HitTestEntry<HitTestTarget> entry) {
|
||||
if (!active) return;
|
||||
|
||||
final stateMachine = this.stateMachine;
|
||||
final position = localToArtboard(
|
||||
position: event.localPosition,
|
||||
@ -154,23 +171,46 @@ base class RiveWidgetController extends BasicArtboardPainter
|
||||
size: lastSize / lastPaintPixelRatio,
|
||||
scaleFactor: layoutScaleFactor,
|
||||
);
|
||||
|
||||
final HitResult hitResult;
|
||||
if (event is PointerDownEvent) {
|
||||
stateMachine.pointerDown(position);
|
||||
hitResult = stateMachine.pointerDown(position);
|
||||
} else if (event is PointerUpEvent) {
|
||||
stateMachine.pointerUp(position);
|
||||
hitResult = stateMachine.pointerUp(position);
|
||||
} else if (event is PointerMoveEvent) {
|
||||
stateMachine.pointerMove(position);
|
||||
hitResult = stateMachine.pointerMove(position);
|
||||
} else if (event is PointerHoverEvent) {
|
||||
stateMachine.pointerMove(position);
|
||||
hitResult = stateMachine.pointerMove(position);
|
||||
} else if (event is PointerExitEvent) {
|
||||
stateMachine.pointerExit(position);
|
||||
hitResult = stateMachine.pointerExit(position);
|
||||
} else {
|
||||
hitResult = HitResult.none;
|
||||
}
|
||||
|
||||
// We handle the _previousHitResult as well to account for potential exit
|
||||
// events that may not have been processed.
|
||||
if (hitResult != HitResult.none || _previousHitResult != HitResult.none) {
|
||||
scheduleRepaint();
|
||||
}
|
||||
_previousHitResult = hitResult;
|
||||
}
|
||||
|
||||
@override
|
||||
void scheduleRepaint() {
|
||||
if (_didAdvance) {
|
||||
return; // Already in an active ticker state
|
||||
}
|
||||
if (!_repaintScheduled) {
|
||||
super.scheduleRepaint();
|
||||
_repaintScheduled = true;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
bool advance(double elapsedSeconds) =>
|
||||
stateMachine.advanceAndApply(elapsedSeconds) && active;
|
||||
bool advance(double elapsedSeconds) {
|
||||
_repaintScheduled = false;
|
||||
_didAdvance = stateMachine.advanceAndApply(elapsedSeconds);
|
||||
return _didAdvance && active;
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
|
||||
Reference in New Issue
Block a user