refactor(flutter)!: scaling with dpr on Rive Renderer (#10645) 1f5e950a28

* refactor!(flutter): scaling with dpr on Rive Renderer

* refactor(flutter)!: render object texture creation and paint

* chore(editor): fix dragon login mouse follow

* docs(flutter): update CHANGELOG

* feat(flutter): apply transform scaling on RivePanel

* chore(flutter): remove repaint boundary to fix goldens

data bind artboards rcp file (#10214) c542b9b7ac
* make file ref counted

* migrate File to refcnt

* add bindable artboard class to keep file reference

* feat(unity): support rcp file and BindableArtboard class (#10228)

* refactor(apple): use updated file bindable artboard apis (#10229)

* update command queue to support bindable artboards

* use bindable artboards on command queue

* self manage view model instances in js runtime

* change remaining viewModelInstanceRuntimes to rcp

* refactor(apple): update view model instances to use rcp (#10298)

* refactor(unity): support rcp ViewModelInstanceRuntime (#10309)

* rebase fix

* deprecate getArtboard in favor of getBindableArtboard

* fix merge

* remove unused lambda capture

* fix rive binding

* feat(Android): RCP File, VMI, and add bindable artboards (#10456)

* refactor: C++ refactors

- Import from long (incorrect) -> jlong
- Header clang-tidy fix
- Use reinterpret_cast instead of C-style cast
- Break out some variables instead of long one liners
- Use auto
- Remove unused env and thisObj

# Conflicts:
#	packages/runtime_android/kotlin/src/main/cpp/src/helpers/general.cpp

* docs: Improve documentation on the File class

* feat: Support bindable artboard type and RCP VMIs

# Conflicts:
#	packages/runtime_android/kotlin/src/androidTest/java/app/rive/runtime/kotlin/core/RiveDataBindingTest.kt

* feat: Support RCP files

* refactor: Change from +1/-1 ref to just release

* fix: Moved to the more appropriate null pointer for GetStringUTFChars

* replace unref with release

test: Add an android_gms_vulkan run to browserstack (#10669) f7613dbf35
Vulkan is ready to stabilize. Let's get it on our nightly runs.

Also disable "atomic" mode on Android unless requested explicitly.
Barriers tend to be expensive on Android and MSAA is usually cheap;
let's stabilize MSAA first.

fix(vk): Properly preserve render targets when using MSAA (#10630) 5df1a42463
* fix(vk): Properly preserve render targets when using MSAA

Unfortunately, Vulkan does not provide a mechanism to initialize our
(transient) MSAA texture with the contents of the (non-MSAA)
renderTarget texture at the beginning of a render pass. To work around
this limitation while supporting LoadAction::preserveRenderTarget, we
literally draw the previous render target contents into the framebuffer
at the beginning of the pass.

* Fix one more barrier

fix(vk, d3d12): Properly apply draw batch barriers on pipeline failures (#10667) 5efb71a88a
If a pipeline failed to acquire for a draw batch that required barriers of any kind, we were skipping the barriers as well as attempting to draw.
Now the code will apply the barriers and only skip drawing.

chore: add pointer exit support (#10595) d999d6a22c
* add pointer exit support

scripting: color and string view model property (#10663) 3acbdfcba7
Description
Adds support for passing a string and color vm property to the scripting engine.
Adds support for defining color and string as inputs.

feat: Integrate glfw into the premake build (#10656) 653c8c6040
Build GLFW with premake instead of requiring the user to call out into a
custom script thatbuses their cmake.

feat(scripting): split code panels (#10655) 9d8b49152e
* feature(scripting): command palette

* feature: adding split pane saving

* chore: update to latest luau

* fix: pixel correct scrollbars

* feature: reload scroll position of script pane

* feature: module titles on panes

* chore: merging command palettes

* fix: cleanup

* chore: refactor searchbar tests

* fix: failing test

* chore: cleanup

* chore: cleanup

* chore: cleanup unused commented code

* feature: hover for command palette items

* chore: cleanup mocks

Fix MSVC toolchain path_fiddle builds (#10661) 0f0d7c5f81
Our MSVC builds are building with C++latest (instead of C++17), and what that means is that filesystem::path::u8string returns a std::u8string instead of std::string (see https://en.cppreference.com/w/cpp/filesystem/path/string.html), causing a compilation failure for the shader hotload rebuild command. This change adds back in the reinterpret_cast to a char pointer (but still stores the temp string correctly).

Add loop option to GM (#10649) 0121fd0174
* add loopCount

* add static

* Update gmmain.cpp

* Change while to for

Co-authored-by: Gordon <pggordonhayes@gmail.com>
This commit is contained in:
HayesGordon
2025-09-30 15:24:48 +00:00
parent b6becf197e
commit 48e6a77fc1
11 changed files with 154 additions and 28 deletions

View File

@ -0,0 +1,102 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:rive/rive.dart';
class ExampleTransform extends StatelessWidget {
const ExampleTransform({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(child: _MyRiveWidget(riveFactory: Factory.rive)),
Expanded(child: _MyRiveWidget(riveFactory: Factory.flutter)),
],
),
),
);
}
}
class _MyRiveWidget extends StatefulWidget {
final Factory riveFactory;
const _MyRiveWidget({required this.riveFactory});
@override
State<_MyRiveWidget> createState() => _MyRiveWidgetState();
}
class _MyRiveWidgetState extends State<_MyRiveWidget>
with SingleTickerProviderStateMixin {
bool isInitialized = false;
late final File file;
late final RiveWidgetController controller;
late final ViewModelInstance vmi;
double scale = 1.5;
@override
void initState() {
super.initState();
initRive();
}
void initRive() async {
file = (await File.asset(
'assets/rive_rendering_test.riv',
riveFactory: widget.riveFactory,
))!;
controller = RiveWidgetController(
file,
artboardSelector: ArtboardSelector.byName('Rive Rendering'),
);
vmi = controller.dataBind(DataBind.auto());
final renderName = vmi.string('rendererName')!;
renderName.value =
widget.riveFactory == Factory.flutter ? 'Flutter' : 'Rive';
setState(() => isInitialized = true);
}
@override
void dispose() {
controller.dispose();
file.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return isInitialized
? getTransformRiveWidget()
: const CircularProgressIndicator();
}
Widget getTransformRiveWidget() {
return Listener(
onPointerSignal: (pointerSignal) {
if (pointerSignal is PointerScrollEvent) {
final delta = -pointerSignal.scrollDelta.dy;
setState(() {
scale = (scale + delta * 0.008).clamp(0.1, 5.0);
});
}
},
child: Transform(
transform: Matrix4.identity()..scale(scale, scale, scale),
alignment: Alignment.center,
// filterQuality: FilterQuality.high,
child: RiveWidget(
controller: controller,
fit: Fit.contain,
),
),
);
}
}