Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduce thorvg.flutter

권태뽕
November 13, 2026

Introduce thorvg.flutter

Deck delivered at Flutter Korea 2025

권태뽕

November 13, 2026

Transcript

64 slides
  1. Agenda 1 About Me 2 ThorVG Project 3 thorvg.flutter Project

    4 lottie → thorvg, and Contributing 5 From OSS User to Contributor 6 Wrap-up Source: Flutter Logo, ThorVG Logo, Nano Banana Flutter Korea 2025 @TaeBbong
  2. About Me Taehyung Kwon @TaeBbong B.S., Korea Univ. School of

    Cybersecurity Oops, signed a 7-yr security job (5 done) Free Inflearn Flutter course, ~18K students Wrote two borderline embarrassing books Met Flutter in 2019, still getting closer Lately hooked on OSS and Flutter core Flutter Korea 2025 @TaeBbong
  3. intro: Terms lottie file: a vector-based animation file in JSON

    lottie: the existing Flutter package to play them Flutter Korea 2025 @TaeBbong
  4. intro: Vector Graphics? Vector graphics: images as equations Rendering: drawing

    by computing them Source: GeoGebra Flutter Korea 2025 @TaeBbong
  5. intro: 2D Rendering Engines Impeller Renders 2D vector & raster

    graphics Source: Skia, Flutter Flutter Korea 2025 @TaeBbong
  6. intro: 2D Rendering Engines Renders 2D vector & raster graphics

    Source: Skia, Flutter, ThorVG Flutter Korea 2025 @TaeBbong
  7. ThorVG Project Ultralight cross-platform vector engine Light: embeddable from just

    150KB Runs on low-end devices like IoT and RTOS No third-party dependencies Multiple hardware acceleration backends Drawing to Lottie, SVG and other standards Source: thorvg.org Flutter Korea 2025 @TaeBbong
  8. ThorVG Project Someday: Flutter engine contributor → Contribute to ThorVG,

    a similar engine → Then dig into the Flutter engine → Learn OSS contribution properly Source: OSSCA website Flutter Korea 2025 @TaeBbong
  9. Introducing thorvg.flutter! Cross-platform: Windows, MacOS, Linux, Web(WASM), Embedded, Android, iOS,

    and Flutter Source: github.com/ThorVG Flutter Korea 2025 @TaeBbong
  10. Introducing thorvg.flutter! On Flutter, it starts with Lottie animation rendering

    A year-old OSS project, growing fast Source: github.com/ThorVG Flutter Korea 2025 @TaeBbong
  11. Introducing thorvg.flutter! What's a Lottie file? A vector animation file

    written in JSON Source: Lottiefiles Flutter Korea 2025 @TaeBbong
  12. Introducing thorvg.flutter! In flutter, until now? We used the lottie

    package Source: Lottiefiles Flutter Korea 2025 @TaeBbong
  13. Introducing thorvg.flutter! Going from lottie to thorvg is just a

    package swap “The new thorvg engine plays lottie files too!” Source: Lottiefiles Flutter Korea 2025 @TaeBbong
  14. lottie vs thorvg - Internals Device lottie.json Widget Flutter Framework

    App lottie.json Flutter Framework(App) CustomPainter Parsed JSON Canvas drawPath drawImage Rendering Engine Flutter Korea 2025 FFI saveLayer Rendering Engine Skia/Impeller ThorVG lottie thorvg @TaeBbong
  15. lottie vs thorvg - Internals lottie.json lottie.json Dart VM GC

    vs manual C++ memory management drawPath drawImage Skia/Impeller Flutter Korea 2025 saveLayer ThorVG @TaeBbong
  16. thorvg.flutter - Dev Env Setup thorvg: engine repo linked as

    a submodule src/: binding code to use just the engine's Lottie Flutter Korea 2025 @TaeBbong
  17. thorvg.flutter - Dev Env Setup Engine build → meson, ninja

    required Predefined build scripts per platform Flutter Korea 2025 @TaeBbong
  18. thorvg.flutter - Dev Env Setup Ideally Linux/Mac advised... Engine build

    → needs meson, ninja setup Predefined build scripts per platform Flutter Korea 2025 @TaeBbong
  19. thorvg.flutter - Dev Env Setup ffi lets Flutter call C++-based

    native libraries Source: Google Codelab Flutter Korea 2025 @TaeBbong
  20. thorvg.flutter - Dev Env Setup Dart/Flutter Side (Managed) 1) Dart

    Code (User Code) Struct/Pointer setup, typedefs 2) dart:ffi Binding • Load via DynamicLibrary.open(...) • lookup<NativeFunction<T>> → Dart function pointer 3) Memory/Type Marshalling • calloc / malloc pointer alloc & free • Dart ↔ C types (int, double, Utf8, Struct...) Callbacks via pointers; mind Isolate/thread safety Flutter Korea 2025 Native Side Function call Lookup/Binding Pointer/Buffer Returns/Errors A) Native Library (C/C++/Rust, etc.) Public: extern "C" funcs, fixed ABI B) Thread/State Management • Reentrancy / thread safety • Callback flow to main Isolate C) OS/System Calls • File/net/graphics/device APIs • Per-platform .so/.dll/.dylib Native → Dart callback @TaeBbong
  21. thorvg.flutter - Dev Env Setup C++ library setup via ffi,

    ffigen Flutter Korea 2025 @TaeBbong
  22. thorvg.flutter - Dev Env Setup Load the built engine lib

    dynamically Flutter Korea 2025 @TaeBbong
  23. thorvg.flutter - PR #25 (First PR) PR made during initial

    setup A PR adding common fvm files and the .cxx files generated by Android builds to .gitignore Flutter Korea 2025 @TaeBbong
  24. thorvg.flutter - PR #25 (First PR) Global OSS, so it's

    all in English (best effort ) Flutter Korea 2025 @TaeBbong
  25. thorvg.flutter - PR #25 (First PR) Easier than I thought?!

    Got confident, and greedy Flutter Korea 2025 @TaeBbong
  26. thorvg.flutter - Issue #26 (1st Oops) Looking for something to

    contribute, I pitched dotlottie format support Flutter Korea 2025 @TaeBbong
  27. thorvg.flutter - Issue #26 (1st Oops) Off from the project's

    direction, and my tone didn't suit OSS culture Flutter Korea 2025 @TaeBbong
  28. thorvg.flutter - Issue #26 (1st Oops) A classic newbie mistake

    Respect the process and timelines, and small tasks still matter Source: tvN YouTube Flutter Korea 2025 @TaeBbong
  29. thorvg.flutter - PR #27 (2nd, Small) Found an error in

    the example In the Android example, mismatched namespaces so Activity wasn't found Unified the namespace (org.thorvg.example) Flutter Korea 2025 @TaeBbong
  30. thorvg.flutter - Issue #22 (1st Fail) Urgent on the roadmap,

    seemed doable and meaningful, so I jumped in Flutter Korea 2025 @TaeBbong
  31. thorvg.flutter - Issue #22 (1st Fail) On iOS, dynamic libraries

    can't be shipped, and on arm64-based iOS simulators, dynamic library support wasn't ready Flutter Korea 2025 @TaeBbong
  32. thorvg.flutter - Issue #22 (1st Fail) Register sources in podspec

    Prevent stripping on static link Flutter Korea 2025 @TaeBbong
  33. thorvg.flutter - Issue #22 (1st Fail) Load the lib with

    process() to try static linking Flutter Korea 2025 @TaeBbong
  34. thorvg.flutter - Issue #22 (1st Fail) No C++ or native

    iOS experience, so it was very hard Promised to study more and retry (aka ran away) Flutter Korea 2025 @TaeBbong
  35. thorvg.flutter - PR #31 (My Strengths) Issue when Lottie has

    no size set and the parent provides it Flutter Korea 2025 @TaeBbong
  36. thorvg.flutter - PR #31 (My Strengths) Lottie's size calc logic

    ignored parent constraints Flutter Korea 2025 @TaeBbong
  37. thorvg.flutter - PR #31 (My Strengths) Filed an issue first,

    then started with warm buy-in Flutter Korea 2025 @TaeBbong
  38. thorvg.flutter - PR #31 (My Strengths) 1. Get parent constraints

    via LayoutBuilder 2. Extend RenderBox and write the layout logic 3. Read size via context.findRenderObject() Flutter Korea 2025 @TaeBbong
  39. thorvg.flutter - PR #31 (My Strengths) Get final size via

    context.findRenderObject(), then draw from the 2nd frame Flutter Korea 2025 @TaeBbong
  40. thorvg.flutter - PR #31 (My Strengths) Found a real problem

    to solve in the project, shared it as an issue first to build consensus, and drew on my background (Flutter pipeline) Flutter Korea 2025 @TaeBbong
  41. Wrap-up From user to contributor: hard at first, but anyone

    can do it Flutter Korea 2025 @TaeBbong
  42. Wrap-up In OSS, no one sits beside you, but it's

    teamwork with many people, so communication skills matter Flutter Korea 2025 @TaeBbong
  43. Wrap-up Not contributing for its own sake, but to grow

    the project and myself Flutter Korea 2025 @TaeBbong
  44. Wrap-up We all have our strengths, so find where yours

    can help Flutter Korea 2025 @TaeBbong

More Decks by 권태뽕

Other Decks in Programming