rive-app / rive-app/rive-flutter

Improve resizing on macOS

Open
#630 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
1.5k
Forks
240
PR merge metrics
No merged PRs in 30d

Description

Submission checklist
  • I have confirmed the issue is present in the latest version of the rive Flutter package
  • I have searched the documentation and forums and could not find an answer
  • I have searched existing issues and this is not a duplicate
Description

Rive native currently flickers a lot when resizing on macOS. Here's a quick win PR to improve (though not completely fix) the situation: https://github.com/knopp/rive_native/pull/1 .

Before:

https://github.com/user-attachments/assets/afc5cb1d-911b-422d-822c-c36071e02c84

After:

https://github.com/user-attachments/assets/27c03407-49fa-4577-9d51-903e738707c2

It's still flickers, but it doesn't freeze for longer periods of time. It is not a complete fix. Complete fix would include:

  • Creating the texture synchronously. Currently the texture is created asynchronously through platform channel. This adds enough latency where it can delay frames during resizing. The call can be replaced with synchronous FFI invocation.

  • Not using [FlutterTextureRegistry textureFrameAvailable]. This method is meant for situation where rendering is driven completely outside of flutter. That is not the case here. Ideally Rive should render to texture in platform thread and then immediately provide the texture when raster thread requests it (copyPixelBuffer). Obviously it's not so easy, because we currently don't have good way to synchronize Rive rendering with raster thread. We could hold raster thread until Rive Metal completion handler is called, but we don't really want to unnecessary delay CPU work for GPU. The real solution would be to extend external texture API in Flutter to include fences.

Reproduction steps / code

No response

Upload your reproduction files / stack trace

No response

Source .riv / .rev file

No response

Screenshots / video

No response

Rive Flutter package version

0.1.6

Flutter version

Flutter 3.44.0-1.0.pre-162 • channel [user-branch] • git@github.com:knopp/flutter.git
Framework • revision b14d6e3c93 (4 days ago) • 2026-04-21 16:21:40 +0200
Engine • hash f891d7e38b44e0a784f98ad39b8513aff66ba754 (revision 2844af6a71) (6 days ago) •
2026-04-19 07:03:37.000Z
Tools • Dart 3.13.0 (build 3.13.0-34.0.dev) • DevTools 2.57.0

Device

macOS

OS version

Any

Additional context

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the macOS native texture and resizing path referenced by the issue and the linked rive_native PR. Reproduce resizing with the Rive Flutter package on macOS, then compare the current behavior with the PR's improvement. Done means reducing flicker without the long freezes, while accounting for the asynchronous texture creation and textureFrameAvailable limitations described here.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
desktop-dev, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.