Skip to content
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

[MacOS] Add support for creating and presenting platform views. #22905

Closed

Conversation

RichardJCai
Copy link
Contributor

@RichardJCai RichardJCai commented Dec 7, 2020

Add support for:

  1. Registering view factories.
  2. Creating / Disposing platform views.
  3. Presenting platform views in FlutterGLCompositor

Will add follow up PR for static thread merging, there may be visual bugs since raster/ui threads are not merged.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@RichardJCai RichardJCai changed the title Add MacOS platform view support to FlutterViewController [MacOS] Add support for creating and presenting platform views. Dec 7, 2020
@RichardJCai RichardJCai force-pushed the macos_pv_support_present branch 2 times, most recently from 99a48ad to 9ee9d45 Compare December 7, 2020 16:09
Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

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

We are also missing tests in this PR.

Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

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

LGTM % nits, assuming @iskakaushik LGTMed as well.
Thanks for adding tests!

@RichardJCai RichardJCai force-pushed the macos_pv_support_present branch 2 times, most recently from 444f71e to 6874a3e Compare December 7, 2020 21:23
@iskakaushik
Copy link
Contributor

Please don't merge this until i've taken a look :-) I think the public API here needs a little more scrutiny.

@RichardJCai
Copy link
Contributor Author

I did a first pass. I'm confused by what's expected to work as a result of this PR though, given that there are references to adding public API but this PR doesn't appear to actually add any public API.

Thanks for the review! I'll update this on Friday.

@RichardJCai
Copy link
Contributor Author

RichardJCai commented Jan 18, 2021

@stuartmorgan @iskakaushik
I'm trying to update this PR but whenever I try building with a local engine, I'm getting the following error.

Building macOS application...
2021-01-18 16:42:24.578 testapp3[52826:2671766] Failed to find path for "flutter_assets"
2021-01-18 16:42:24.578 testapp3[52826:2671766] Failed to find path for "flutter_assets"
embedder.cc (764): 'FlutterEngineInitialize' returned 'kInvalidArguments'. The assets path in the Flutter project arguments was missing.
2021-01-18 16:42:24.578 testapp3[52826:2671766] Failed to initialize Flutter engine: error 2

First ran into after rebasing this branch ontop of master but it seems like I'm running into on master as well with a local engine.

Tried following the suggestions in this issue flutter/flutter#72608, ie upgrading and doing a new project but none seem to work with a local engine.

flutter run -d macos seems to work fine.

Anyone have any ideas whats wrong here?

@stuartmorgan
Copy link
Contributor

I wouldn't have expected a local engine to have any effect on App.framework copying. I'll see if I can reproduce locally and follow up in flutter/flutter#72608

@google-cla
Copy link

google-cla bot commented Jan 20, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot removed the cla: yes label Jan 20, 2021
@google-cla google-cla bot added the cla: no label Jan 20, 2021
@jmagman
Copy link
Member

jmagman commented Jan 20, 2021

I'm getting the same failures as https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket.appspot.com/8857625998621949056/+/steps/build_host_debug_unopt/0/stdout locally. Can you fix those up and see if you are still reproducing flutter/flutter#72608?

@RichardJCai
Copy link
Contributor Author

I'm getting the same failures as https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket.appspot.com/8857625998621949056/+/steps/build_host_debug_unopt/0/stdout locally. Can you fix those up and see if you are still reproducing flutter/flutter#72608?

Never mind, I was able to solve the problem by recloning the repos and setting up the environment again.

@chinmaygarde chinmaygarde added the Work in progress (WIP) Not ready (yet) for review! label Feb 4, 2021
@iskakaushik
Copy link
Contributor

Hey @RichardJCai , thanks for continuing to work and make progress on this PR. Given the inactivity over the last week, I'm closing this. Feel free to open a new PR once you get a chance to address the failing pre-submit checks and tag me. Thanks!

@iskakaushik iskakaushik closed this Feb 4, 2021
@RichardJCai
Copy link
Contributor Author

Hey @RichardJCai , thanks for continuing to work and make progress on this PR. Given the inactivity over the last week, I'm closing this. Feel free to open a new PR once you get a chance to address the failing pre-submit checks and tag me. Thanks!

Sorry tried to address the PR comments but I still can't seem to get my engine environment set up for some reason.

@cbenhagen
Copy link
Contributor

@RichardJCai did you have a chance to fix your environment? I know you probably already checked this but I once got this exact same error message when the underlying issue was in fact a build error in my dart code. Can you maybe post a verbose output of your build with the local engine? I'd be happy to help you debug your environment as good as I can. Here on or on Discord (cben#2483).

iskakaushik added a commit to iskakaushik/engine that referenced this pull request Jan 13, 2022
* The plan is to only support platform views when using Metal rendering
backend.

* This PR is based on the work done in: flutter#22905
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Jan 14, 2022
* The plan is to only support platform views when using Metal rendering backend.
* This PR is based on the work done in: flutter#22905
* There are some threading issues to be addressed still to make this feature usable.
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Jan 14, 2022
* The plan is to only support platform views when using Metal rendering backend.
* This PR is based on the work done in: flutter#22905
* There are some threading issues to be addressed still to make this feature usable: flutter/flutter#96668
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Jan 14, 2022
* The plan is to only support platform views when using Metal rendering backend.
* This PR is based on the work done in: flutter#22905
* There are some threading issues to be addressed still to make this feature usable: flutter/flutter#96668
* Example is at: https://github.com/iskakaushik/flutter_macos_platform_view_example
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Jan 20, 2022
* The plan is to only support platform views when using Metal rendering backend.
* This PR is based on the work done in: flutter#22905
* There are some threading issues to be addressed still to make this feature usable: flutter/flutter#96668
* Example is at: https://github.com/iskakaushik/flutter_macos_platform_view_example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: no Work in progress (WIP) Not ready (yet) for review!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants