Code Monkey home page Code Monkey logo

flutterasclibrary's Introduction

buildroot

This is the build environment for the modified flutter engine. The majority of the logic is contained here izackp/engine.

I wanted to simplify the overall build environment, so I switched the project from using gsync for dependencies to github submodules. Subtrees are pretty tempting, but I need to do some more research first. I like the idea that a copy of the code will be in the repo and that it will be easier to checkout, but I don't like the idea of polluting the git history and the alleged difficulty of pushing up changes. Again, I need to do more research.

For whoever is reading this, I still have a few more things to do. I've gotten the project to successfully build after removing dart from the project. It's not at the point where you can just grab this and use this as a library. I may or may not need to make modifications and/or simplifications. The project was originally designed to run as the base/main loop of the program. It becomes the platform for a Dart VM which is then tied to most of the APIs. However, my goal is to turn it into a usable library which means drastically changing that aspect.

Getting this project into a usable state is pretty much the first milestone. Some of the things I'm working on:

  • Make it easier for people to pick up the code and work on it
    • Instructions, Simplier tools, explanation of the build process and gn, explanations on what does what in the code
  • Create a sample project that utilizes the flutter engine for rendering (windows)

Checking out the code

  • Clone the repo
  • git clone [email protected]:izackp/FlutterAsCLibrary.git (add: --depth 1 for shallow)

Full Submodules:

  • git submodule update --init --recursive

Shallow Submodules (Faster; takes less space): I recommend to do this, but only if you're comfortable with git

  • git submodule update --init --depth 1 --recursive
  • skia and libwebp won't work. You will need to cd into the directories fetch their respective branches noted in .gitmodules (flutter/1.0 and 0.6.0), cd back out then re run the command. (If anyone knows how to fix this, feel free to contact me!)
  • You may need to increase the depth or do a full checkout if the commit we're using gets behind
  • Be aware that using the depth argument may put the submodules in a state where it's tracking only master. If this is the case then no matter what you do (git pull or fetch) you will only get the master branch from remote.origin.
git config --get remote.origin.fetch
+refs/heads/master:refs/remotes/origin/master

If you need a branch other than master then you need to change the above in .git/config to this:

+refs/heads/*:refs/remotes/origin/*

Building the Project

  • Follow the above to checkout out the code.
  • Get chrome's depot_tools and add it to the path (Windows: $env:Path += ";C:\Dev_Tools\depot_tools")
  • cd into the repo and run gn gen out. This will generate ninja files into the out folder.
  • cd into out and run ninja.
  • If you're using windows refer to the notes at the bottom of this readme

TODO

  • Some git commits needed are unreachable when using -depth 1 option checkout for submodules. I would like to make the repo easy to checkout, so I may fork some of the dependecies so they may be accessable without downloading 2GB of data.
  • Add Instructional documention for checking out the code.
  • Add instructions on how to build the project and use GN (GN is the build system for this project; it replaces CMAKE)
  • Create Outline Documentation on the overall heirachy of the code. (What is lib/ui, shell, runtime, ect)

Milestones

  • Remove DART done
  • Working C++ Desktop Example for Windows
  • Modify the API for ease of use and portablility (Ex: What do we need to do to integrate this into a Unity or Mono game? How will events be handled between the main app and this library? Will/Can this library handle rendering or do I need to pass a sort of command list to the hosting application to render?)
  • Then Linux, and OSX
  • Then Android and iOS
  • Create C Interface
  • Create a 'standard library' of UI elements (tables, constraints, ect; Will be seperate project)
  • Maybe build C# / DLang wrappers to the C Interface.
  • Create a UI Builder

Dependencies Overview

If I know where, why, how something is used. I'll mention it here otherwise I don't immediately know.

  • benchmark - Tools for measuring performance. Lost of tests and related stuff has been taken out. I kept this because it seems like it could be useful.
  • icu - What is ICU? Handles a lot of text stuff. Used in paragraph builder (txt mentioned below).
  • expat - (Embedded; not a submodule) XML Parser.
  • freetype2 - Font Library.
  • googletest - Unit testing library.
  • gyp - Google's previous build system. Scripts in here seem to be needed for the build process.
  • harfbuzz - A text shaping library. Not sure where it's used.
  • libjpeg-turbo - Decodes jpegs.
  • libpng - Decodes pngs.
  • libwebp - Decodes webp.
  • libxml - Seems to be another xml library. TODO: What is the difference between this and expat?
  • rapidjson - Decodes json.
  • skia - A complete 2D graphic library for drawing Text, Geometries, and Images.
  • vulkan - Vulkan headers and Docs. API for the graphics card.
  • zlib - Data compression library.
  • flutter - The main source code.
  • flutter/third_party/txt - (Embedded; not a submodule) Seems to handle everything that has to do with text that can be represented with data. Styling, integration with Skia, ect.

Misc Notes

  • [Windows] To get the windows cl.exe compiler to work. (Might be fixed in the newest version). The folder containing the repo needs case sensitivity disabled. Otherwise, you'll get c1xx: fatal error C1083: Cannot open source file errors.
  • [Windows/VSCode] To get cpp plugins in vscode to work. The root folder(?) needs case sensitivity disabled.
Disable: fsutil.exe file setCaseSensitiveInfo path disable
Enable : fsutil.exe file setCaseSensitiveInfo path enable
Query  : fsutil.exe file queryCaseSensitiveInfo path

flutterasclibrary's People

Contributors

a-siva avatar aam avatar abarth avatar abhishekamit avatar amirh avatar bbalet avatar bkonyi avatar cbracken avatar chinmaygarde avatar dnfield avatar garyqian avatar goderbauer avatar gspencergoog avatar hixie avatar izackp avatar jamesr avatar jason-simmons avatar kf6gpe avatar pylaligand avatar rmacnak-google avatar tvolkert avatar vearthtek avatar yjbanov avatar zanderso avatar

Watchers

 avatar  avatar

flutterasclibrary's Issues

Use a taskpool over dedicated threads.

4 Threads are created on startup (gpu, ui, io, platform). These threads can be left under-utilized. Ideally, we will create x threads for as many hardware cpu threads available. Each thread will pull and execute tasks from a pool.

We will need to convert gpu, ui, io, and platform into 4 serial queues. We basically should create a queue as a task (task of tasks). Every time you add to the queue and it isn't being executed then it schedules its self to run in the task pool. When it runs, we pull a out sub task sequentially. (see: https://github.com/izackp/C-Sharp-Library/blob/master/Utility/DispatchSerialQueue.cs)

We also need an option to specify a queue to run on it's own dedicated thread. OpenGL is bound to a single thread via driver. All gpu calls must be done from the same thread in this case. We should avoid oversubscribing this thread so it should be left alone. However, if vulkan is the renderer we are free to use whatever thread we want.

To prevent similar unforeseen issues we should have the same options for all of the queues.

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.