Skip to content

Add support for running flutter engine without UI #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 30, 2021

Conversation

rwalczyna
Copy link

Adding support for non UI application for Tizen. I have added FlutterCreateService function, which initializes Engine without window.

I also work on change in flutter-tizen to add selector for creating service app (without UI).

@rwalczyna rwalczyna requested a review from a team April 16, 2021 14:29
@swift-kim
Copy link
Member

Have you checked other platforms (such as windows and glfw) on how they implemented their headless mode? It will help you with API design and implementation. Note that you don't have to care about the API compatibilities, that is, that you don't necessarily have to keep the current Tizen embedder APIs as they are but can also change them if necessary.

@rwalczyna
Copy link
Author

I've checked glfw implementation - as it is most similar to Tizen implementation. They are using open_gl config, but without gl_proc resolver. In our implementation it would require change to all open_gl methods (as there are no checks for empty renderer), so I decided to use software renderer - as it is not used anyway. I am only not sure whether name FlutterCreateService is the most suitable - I followed FlutterCreateWindow name.

glfw uses FlutterDesktopRunEngine so I don't know if FlutterRunEngine wouldn't be better instead of FlutterCreateService.

@swift-kim
Copy link
Member

I think FlutterRunEngine or FlutterEngineRun (flutter_windows.h) would be better because

  • It's more consistent with other platforms (otherwise you should add some API description for your new API)
  • Flutter desktop APIs are usually platform app model agnostic, but "Service" is not

p.s. I'm going to deprecate FlutterWindowProperties soon and let the embedder decide the window size (there's some reason for this), so your implementation based on constructor overloading will need some change.

@rwalczyna
Copy link
Author

rwalczyna commented Apr 23, 2021

I have changed function name to FlutterRunEngine. I think that the PR can wait till you update the embedder. Then I will adapt this commit to your change.

@rwalczyna rwalczyna marked this pull request as ready for review April 28, 2021 09:23
@rwalczyna rwalczyna requested a review from a team April 28, 2021 09:23
Copy link
Member

@swift-kim swift-kim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good to me.

} else {
config.type = kSoftware;
config.software.struct_size = sizeof(config.software);
config.software.surface_present_callback = SurfacePresentCallback;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this?

Suggested change
config.software.surface_present_callback = SurfacePresentCallback;
config.software.surface_present_callback =
[](void* user_data, const void* allocation, size_t row_bytes,
size_t height) -> bool { return true; };

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I applied this suggestion, it simplifies code a bit.

Copy link

@pwasowski2 pwasowski2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👌 (however, I'm not yet very familiar with embedder's code, so someone else should approve it)

Copy link

@pwasowski2 pwasowski2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👌

@swift-kim swift-kim merged commit ec02d68 into flutter-tizen:flutter-2.0.1-tizen Apr 30, 2021
swift-kim pushed a commit that referenced this pull request Jun 7, 2021
* Add support for running flutter engine without UI

Signed-off-by: Rafal Walczyna <[email protected]>

* Change surface_present_callback to lambda function

Signed-off-by: Rafal Walczyna <[email protected]>

* Fix nullptr exception when TIZEN_RENDERER_EVAS_GL was used

Signed-off-by: Rafal Walczyna <[email protected]>
swift-kim pushed a commit that referenced this pull request Sep 27, 2021
* Add support for running flutter engine without UI

Signed-off-by: Rafal Walczyna <[email protected]>

* Change surface_present_callback to lambda function

Signed-off-by: Rafal Walczyna <[email protected]>

* Fix nullptr exception when TIZEN_RENDERER_EVAS_GL was used

Signed-off-by: Rafal Walczyna <[email protected]>
swift-kim pushed a commit that referenced this pull request Nov 14, 2021
* Add support for running flutter engine without UI

Signed-off-by: Rafal Walczyna <[email protected]>

* Change surface_present_callback to lambda function

Signed-off-by: Rafal Walczyna <[email protected]>

* Fix nullptr exception when TIZEN_RENDERER_EVAS_GL was used

Signed-off-by: Rafal Walczyna <[email protected]>
swift-kim pushed a commit that referenced this pull request Dec 9, 2021
* Add support for running flutter engine without UI

Signed-off-by: Rafal Walczyna <[email protected]>

* Change surface_present_callback to lambda function

Signed-off-by: Rafal Walczyna <[email protected]>

* Fix nullptr exception when TIZEN_RENDERER_EVAS_GL was used

Signed-off-by: Rafal Walczyna <[email protected]>
swift-kim pushed a commit that referenced this pull request Dec 17, 2021
* Add support for running flutter engine without UI

* Change surface_present_callback to lambda function

* Fix nullptr exception when TIZEN_RENDERER_EVAS_GL was used
swift-kim pushed a commit that referenced this pull request Feb 7, 2022
* Add support for running flutter engine without UI

* Change surface_present_callback to lambda function

* Fix nullptr exception when TIZEN_RENDERER_EVAS_GL was used
swift-kim pushed a commit that referenced this pull request Feb 11, 2022
* Add support for running flutter engine without UI

* Change surface_present_callback to lambda function

* Fix nullptr exception when TIZEN_RENDERER_EVAS_GL was used
swift-kim pushed a commit that referenced this pull request May 12, 2022
* Add support for running flutter engine without UI

* Change surface_present_callback to lambda function

* Fix nullptr exception when TIZEN_RENDERER_EVAS_GL was used
swift-kim pushed a commit that referenced this pull request Aug 5, 2022
* Add support for running flutter engine without UI

* Change surface_present_callback to lambda function

* Fix nullptr exception when TIZEN_RENDERER_EVAS_GL was used
swift-kim pushed a commit that referenced this pull request Sep 1, 2022
…rs. (#66)

Targets in the engine had to individually depend on each sub-target in Impeller when all they cared about was all the client libs. The compiler is a build time implicit dependency. So that has been removed from the top-level group.

Also fixed all the headers so that TUs within Impeller don't care about where Impeller itself sits in the source tree.
swift-kim pushed a commit that referenced this pull request Sep 1, 2022
* Add support for running flutter engine without UI

* Change surface_present_callback to lambda function

* Fix nullptr exception when TIZEN_RENDERER_EVAS_GL was used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants