Coder Social home page Coder Social logo

Comments (11)

jwinarske avatar jwinarske commented on July 4, 2024 1

For DRM this is a good reference:
https://github.com/dvdhrm/docs/blob/master/drm-howto/modeset-vsync.c

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on July 4, 2024 1

I'm implementing to add vsync support for Wayland, but I separed this issue into x11, drm, and wayland respectively.

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on July 4, 2024

Thank you. Actually, I don't understand what to use FlutterEngineOnVsync for. Could you tell me the purpose of it?

from flutter-embedded-linux.

guangoon avatar guangoon commented on July 4, 2024

VSync can be understood as a timed interrupt. The system will send a VSync signal every time it can proceed, and the CPU/GPU will immediately process the rendering after receiving the signal. Therefore, in Flutter, when rendering is needed, we need to monitor the VSync signal, and when a VSync signal is generated, we can start GPU rendering. and if we don't set VsyncCallback in embedder, engine will set a default VsyncCallback which is 60 fps.

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on July 4, 2024

Thank you. That's quite understandable. What should this embedder do is to prepare the API so that the user program or plugins can receive Vsync, right?

from flutter-embedded-linux.

guangoon avatar guangoon commented on July 4, 2024

FlutterProjectArgs args = {};
args.vsync_callback =
you should implement this callback,
When this callback is triggered, you need request vsync signal,
when receive vsync signal callback, you need call FlutterEngineOnVsync.

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on July 4, 2024

Thanks. I'll implement vsync.

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on July 4, 2024

By the way, is there any good way to detect Vsync on Linux platforms? I couldn't find it.

from flutter-embedded-linux.

jwinarske avatar jwinarske commented on July 4, 2024

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on July 4, 2024

Thanks!

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on July 4, 2024

In terms of Wayland backend, I think wp_presentation is better than wl_callback_listener. We can also get a refresh rate by using it. However, we don't call wl_surface_commit because of using eglSwapBuffers which is called from Flutter Engine. So, wp_presentation events don't happen continuously every frame.

from flutter-embedded-linux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.