Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Create root isolate asynchronously #20142

Merged

Conversation

scutlight
Copy link
Member

@scutlight scutlight commented Jul 30, 2020

Description

As the related issue refer, the application may be doing too much work on its main thread even in a simple hello_world demo.
That is because the creation of Engine on the ui thread takes a noticeable time, and it is blocking the platform thread in order to run Shell::Setup synchronously.
The cost of Engine's constructor is mainly about the creating of root isolate. Actually, there used to be another time-consuming process, the default font manager setup, which was resolved by #18225.
Similar to #18225, this pr move the creation of root isolate out from creating Engine. After this action, the main thread blocking is quite an acceptable slice.

Related Issues

flutter/flutter#40563 could be resolved by this pr.

Tests

I added the following tests:

Replace this with a list of the tests that you added as part of this PR. A
change in behaviour with no test covering it will likely get reverted
accidentally sooner or later. PRs must include tests for all
changed/updated/fixed behaviors. See testing the engine for instructions on
writing and running engine tests.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the contributor guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the C++, Objective-C, Java style guides for the engine.
  • I read the tree hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation.
  • All existing and new tests are passing.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read handling breaking changes.

@auto-assign auto-assign bot requested a review from GaryQian July 30, 2020 06:20
@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.

@liyuqian
Copy link
Contributor

liyuqian commented Aug 1, 2020

The engine failed to restart in one of our unit tests. Below is some useful error messages that I copied from the full log

[ RUN      ] ShellTest.MissAtMostOneFrameForIrregularInputEvents
[ERROR:flutter/shell/common/engine.cc(144)] Engine not prepare and launch isolate.
../../flutter/shell/common/shell_test.cc:73: Failure
Value of: restarted.get_future().get()
  Actual: false
Expected: true

@scutlight : I'm curious whether you've tested this locally with our shell_benchmarks, and what change this PR has brought to the BM_ShellInitialization benchmark?

CC @jason-simmons @gaaclarke @chinmaygarde to see if there's any extra concern on deferring loading the isolate.

Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

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

This is racy for the reasons listed and uses an embedder specific API.

FML_CHECK(strong_root_isolate) << "Could not create root isolate.";

// The root isolate ivar is weak.
self->root_isolate_ = strong_root_isolate;
Copy link
Member

Choose a reason for hiding this comment

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

The API as originally designed expects the root isolate to be ready when the runtime controller has been created (this assumption is prevalent throughout the engine). Now, a race has been introduced with no way of telling from the caller about when the root isolate is ready (or the other ivars).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it breaks the assumption but also makes sure the root isolate must be ready before running.

@scutlight scutlight force-pushed the pr/create-root-isolate-asynchronously branch from 0b3e732 to bc8f6aa Compare August 5, 2020 07:55
@scutlight scutlight marked this pull request as draft August 5, 2020 14:13
@scutlight scutlight force-pushed the pr/create-root-isolate-asynchronously branch 2 times, most recently from a265256 to 2765246 Compare August 6, 2020 11:54
@scutlight scutlight marked this pull request as ready for review August 6, 2020 12:36
@auto-assign auto-assign bot requested a review from flar August 6, 2020 12:36
@scutlight scutlight requested a review from chinmaygarde August 6, 2020 12:44
@scutlight
Copy link
Member Author

scutlight commented Aug 6, 2020

@liyuqian : All failed test cases are resolved now, and benchmarks as follow. BM_ShellInitialization shows ~5x reduction.

before this pr:

../out/host_profile/shell_benchmarks

Run on (8 X 4023.94 MHz CPU s)
2020-08-06 20:39:41
Benchmark                                  Time           CPU Iterations
BM_ShellInitialization               2786435 ns     273327 ns       1000
BM_ShellShutdown                      852115 ns     232808 ns       2974
BM_ShellInitializationAndShutdown   46545353 ns     467147 ns        100

after this pr:

../out/host_profile/shell_benchmarks

Run on (8 X 4002.75 MHz CPU s)
2020-08-06 20:21:21
Benchmark                                  Time           CPU Iterations
BM_ShellInitialization                528979 ns     270995 ns       2568
BM_ShellShutdown                      878690 ns     234845 ns       3030
BM_ShellInitializationAndShutdown   46339905 ns     478631 ns        100

@scutlight scutlight requested a review from liyuqian August 11, 2020 06:51
@scutlight scutlight force-pushed the pr/create-root-isolate-asynchronously branch 4 times, most recently from 8d797cd to 6449350 Compare August 12, 2020 12:15
@scutlight
Copy link
Member Author

scutlight commented Aug 12, 2020

Mac iOS Engine
ScenariosTests:
-[FlutterViewControllerTest testFirstFrameCallback]
failed, I'll figure it out later.

@scutlight scutlight force-pushed the pr/create-root-isolate-asynchronously branch 2 times, most recently from bcab97d to df1b9f5 Compare August 17, 2020 10:45
@scutlight
Copy link
Member Author

Mac iOS Engine
ScenariosTests:
-[FlutterViewControllerTest testFirstFrameCallback]
failed, I'll figure it out later.

The failed test case has nothing to do with this pr, just rebase and get all checks passed.

@liyuqian liyuqian requested review from gaaclarke and jason-simmons and removed request for GaryQian and flar August 17, 2020 21:45
@@ -1246,6 +1257,12 @@ bool Shell::HandleServiceProtocolMessage(
// |ServiceProtocol::Handler|
ServiceProtocol::Handler::Description Shell::GetServiceProtocolDescription()
const {
FML_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread());

if (!engine_) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder in what situation would this !engine_ become true? It seems that we would only call GetServiceProtocolDescription after the engine_ is created.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a bit obscure. For the case 'ShellTest.OnServiceProtocolGetSkSLsWorks', Shell is created and destroyed without running the engine. When destructing Shell, engine_ was moved in Shell::~Shell() https://github.com/flutter/engine/blob/master/shell/common/shell.cc#L395, and then comes Shell::OnRootIsolateCreated() and calls GetServiceProtocolDescription() meeting the invalid engine_.
Anyway, it is a protection better than none.

Copy link
Member

Choose a reason for hiding this comment

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

We reviewed this patch again and I believe this is good to go except this one case where we all preferred if it were an assert. The unit test seems to be accessing the private method because it is a friend of the shell. Now that this code has been reworked, the assumption in the test failed. Can we rework the test to not make this assumption anymore? Let's land then patch then.

Copy link
Member Author

Choose a reason for hiding this comment

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

Appreciate and agree your comments. To keep this as an assert, I just simply change engine_ to weak_engine_ since it should run on the ui thread. For the test case, when it was called from Shell::OnRootIsolateCreated(), engine_ had been moved but not destructed and weak_engine_ was safe to refer.

Copy link
Member

Choose a reason for hiding this comment

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

I've proposed a PR that starts an engine in ShellTest.OnServiceProtocolGetSkSLsWorks (#20801).

With that change, a workaround in Shell::GetServiceProtocolDescription will not be needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've patched #20801 and run the test locally without the workaround in Shell::GetServiceProtocolDescription, and the result is crash for the same reason that Shell::~Shell() is called before Shell::OnRootIsolateCreated(). I think using weak_engine_ instead of engine_ inside Shell::GetServiceProtocolDescription is more reasonable.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, now I see - the Shell::~Shell() call will happen on the platform thread and will transfer ownership of the shell's engine_ into the task queued to the UI thread that deletes the engine.

The task that calls Shell::OnRootIsolateCreated was previously queued to the UI thread when CreateShellOnPlatformThread posted the task that creates the Engine and its RuntimeController. So when Shell::OnRootIsolateCreated calls GetServiceProtocolDescription, the Engine deletion task has not yet run and it's safe to assume that weak_engine_ is still valid.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that it is.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm glad we figured it out. Maybe put Jason's reasoning in the comment so future contributors would understand why we chose weak_engine_ here instead of engine_.

Alternatively, there are many pieces of if (!weak_engine_) {...} or [engine = weak_engine_]{ if (engine) { ... } } code in shell.cc. So it looks very reasonable if we put a if (!weak_engine_) {...} here.

@jason-simmons : there's one more thing that I don't completely understand. Line 1641 won't return until the UI thread task to run the engine was fully completed. The shell destruction happened on line 1651 after it. The UI thread task of OnRootIsolateCreated was added at RuntimeController and Engine construction which seems to be earlier than RunEngine. So I'd expect OnRootIsolateCreated to be executed before shell destruction in line 1651?

Copy link
Member

Choose a reason for hiding this comment

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

The crash in the unit test happened because Shell::engine_ was null even though the shell had not yet been fully destructed and the engine had not been deleted.

Shell::engine_ is set to null on the platform thread within the Shell destructor by https://github.com/flutter/engine/blob/master/shell/common/shell.cc#L395. The platform thread can do this at any time regardless of what the UI thread is doing. The platform thread will then queue a task to the UI thread that actually deletes the engine.

So it's unsafe to access Shell::engine_ directly from a UI thread task. UI thread tasks should use weak_engine_ and check if it is null.

return root_isolate ? root_isolate->GetLastError() : tonic::kNoError;
}

std::weak_ptr<DartIsolate> RuntimeController::GetRootIsolate() {
std::shared_ptr<DartIsolate> root_isolate = root_isolate_.lock();
Copy link
Contributor

Choose a reason for hiding this comment

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

Previously root_isolate_ was private. Now GetRootIsolate is public. I wonder if there's any specific reason to expose it publicly? Its usage seems to be still completely internal. If possible, we'd like to minimize our public API surface.

Copy link
Member Author

Choose a reason for hiding this comment

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

GetRootIsolate() is originally public. Engine calls this API to prepare, launch isolate, and do some callbacks. But seems these processes can be withdraw back into RuntimeController and then this API can be marked private.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I missed it as I originally that GetRootIsolate wasn't there. Then it's fine to keep using the public GetRootIsolatehere.

bool RuntimeController::IsRootIsolateRunning() const {
std::shared_ptr<DartIsolate> root_isolate = root_isolate_.lock();
bool RuntimeController::IsRootIsolateRunning() {
std::shared_ptr<DartIsolate> root_isolate = GetRootIsolate().lock();
Copy link
Contributor

Choose a reason for hiding this comment

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

Relying on GetRootIsolate().lock() seems to be fragile as one can easily write a root_isolate_.lock() in the future and didn't realize it can cause some issue.

Besides, even if GetRootIsolate().lock() is enforced everywhere, the async speedup may easily be broken if someone calls GetRootIsolate() or some methods that calls it in the wrong place. I believe that's why this PR moves GetServiceProtocol()->AddHandler(this, GetServiceProtocolDescription()); to another place.

(#18225 doesn't seem to have this problem.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Access to root_isolate_ directly may escape from creating the isolate, this fragility is a price of this pr. Since it is a private variable, the affection scope is inside RuntimeController and it might be acceptable in my personal opinion. I'll add some comments for root_isolate_ to point it out, is there any better workaround?

If someone calls GetRootIsolate(), it means the root isolate is required right now, then it is necessary to create it in a synchronous way if the isolate is not created yet.
Another reason of moving GetServiceProtocol()->AddHandler(this, GetServiceProtocolDescription()); is that RuntimeController should be accessed only on the UI thread, while originally it was running inside Shell::Setup() on the platform thread.

Copy link
Contributor

Choose a reason for hiding this comment

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

Another reason of moving GetServiceProtocol()->AddHandler(this, GetServiceProtocolDescription()); is that RuntimeController should be accessed only on the UI thread, while originally it was running inside Shell::Setup() on the platform thread.

Good catch, I guess we'll want to fix this regardless if we're going to adopt the bigger solution. We'll have more discussions about whether to accept the price of this pr.

@scutlight scutlight force-pushed the pr/create-root-isolate-asynchronously branch from df1b9f5 to e6b494a Compare August 21, 2020 07:18
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 2, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 2, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 3, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 3, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 3, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 3, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 3, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 3, 2020
zanderso pushed a commit to flutter/flutter that referenced this pull request Sep 3, 2020
* 5e54c70 Reland: Enable hybrid composition by default on Android (#20722) (flutter/engine#20864)

* 9398717 Roll Skia from db5582b71116 to 44e96bee4b6a (4 revisions) (flutter/engine#20908)

* 5f49a95 Add auto plugin registration to FlutterFragmentActivity as well (flutter/engine#20865)

* c4c4f34 Wait for first frame before checking layer tree (flutter/engine#20910)

* 0773bf0 Roll Skia from 44e96bee4b6a to 3913d3e137ed (2 revisions) (flutter/engine#20909)

* 8ec8af7 [windows] Add horizontal scroll support (flutter/engine#20668)

* 1bd9b8e Reset Shell::weak_factory_gpu_ on the raster thread (flutter/engine#20869)

* d67923f Pass text input key events to the EventResponder if they do not yield characters (flutter/engine#20912)

* abe10d1 Roll Dart SDK from 84c3eacc7ba0 to 6eab35f49cbb (2 revisions) (flutter/engine#20913)

* 101316b [web] migrate from e2e to integration_test (flutter/engine#20914)

* 1f52ec3 Roll Dart SDK from 6eab35f49cbb to 2a5f37d25453 (1 revision) (flutter/engine#20917)

* 8019058 Default C++ wrapper templates to EncodableValue (flutter/engine#20760)

* 5f3ec38 Roll Fuchsia Mac SDK from sI2DAAmSI... to waj2pOhDh... (flutter/engine#20919)

* a651020 Roll Fuchsia Linux SDK from _SVZn8uN2... to 9tLNFbjA1... (flutter/engine#20920)

* 696c2aa Roll Skia from 3913d3e137ed to 7b46300fe4ff (4 revisions) (flutter/engine#20924)

* 95f2b72 Create root isolate asynchronously (flutter/engine#20142)

* 58a6207 Adds fuchsia node roles to accessibility bridge updates. (flutter/engine#20385)

* a762143 Roll Dart SDK from 2a5f37d25453 to e8e0d5a539fb (3 revisions) (flutter/engine#20928)

* 49d6805 Ensure all images are closed in FlutterImageView (flutter/engine#20842)

* d67bda7 Image.toByteData and Picture.toImage implementations (#3) (flutter/engine#20750)

* 96efe39 Revert "Adds fuchsia node roles to accessibility bridge updates. (#20385)" (flutter/engine#20936)

* 5585ed9 Revert "Create root isolate asynchronously (#20142)" (flutter/engine#20937)

* f6270c0 Roll Dart SDK from e8e0d5a539fb to b29f228f62e2 (3 revisions) (flutter/engine#20939)

* 15bf1bb [Android R] Integrate DisplayCutouts into viewportMetrics (flutter/engine#20921)

* 615e668 Clear the GL context only after submitting the frame (flutter/engine#20931)

* ca989b8 Roll Skia from 7b46300fe4ff to 1338a37a1add (16 revisions) (flutter/engine#20943)

* 8f3f711 Roll Fuchsia Linux SDK from 9tLNFbjA1... to knpSoAoZq... (flutter/engine#20944)

* 873c007 Log exception in addition to the stack trace for unhandled exceptions. (flutter/engine#20935)

* d761629 Roll Skia from 1338a37a1add to 8fa3b4e8cde5 (6 revisions) (flutter/engine#20949)

* f6920da Roll Skia from 8fa3b4e8cde5 to e9a9ad908226 (5 revisions) (flutter/engine#20952)

* 634e499 Use hint freed specifically for image disposal (flutter/engine#20754)

* c700479 Revert external size changes to Picture (flutter/engine#20950)

* 4353797 Roll Skia from e9a9ad908226 to 3d1d636cd839 (6 revisions) (flutter/engine#20955)

* 80f4481 renaming e2e tests to integration (flutter/engine#20954)

* 61e057a Clear GL context before Gr context (flutter/engine#20957)

* f43c3d7 Roll Fuchsia Mac SDK from waj2pOhDh... to 0r88gDzUP... (flutter/engine#20958)

* 5a2db33 Roll Skia from 3d1d636cd839 to 683beccf6776 (13 revisions) (flutter/engine#20961)

* efb339f Only clear GL context after changing the thread configuration (flutter/engine#20965)

* 58d5132 Roll Fuchsia Linux SDK from knpSoAoZq... to odFvFQV9Z... (flutter/engine#20968)

* 3729fdb Roll Skia from 683beccf6776 to a66a9c31a318 (4 revisions) (flutter/engine#20969)

* 40fe7f3 Roll Fuchsia Mac SDK from 0r88gDzUP... to gOI3W1UNU... (flutter/engine#20970)

* e979c29 Roll Skia from a66a9c31a318 to be72801f29f9 (1 revision) (flutter/engine#20971)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 3, 2020
flar pushed a commit to flutter/flutter that referenced this pull request Sep 3, 2020
* 5e54c70 Reland: Enable hybrid composition by default on Android (#20722) (flutter/engine#20864)

* 9398717 Roll Skia from db5582b71116 to 44e96bee4b6a (4 revisions) (flutter/engine#20908)

* 5f49a95 Add auto plugin registration to FlutterFragmentActivity as well (flutter/engine#20865)

* c4c4f34 Wait for first frame before checking layer tree (flutter/engine#20910)

* 0773bf0 Roll Skia from 44e96bee4b6a to 3913d3e137ed (2 revisions) (flutter/engine#20909)

* 8ec8af7 [windows] Add horizontal scroll support (flutter/engine#20668)

* 1bd9b8e Reset Shell::weak_factory_gpu_ on the raster thread (flutter/engine#20869)

* d67923f Pass text input key events to the EventResponder if they do not yield characters (flutter/engine#20912)

* abe10d1 Roll Dart SDK from 84c3eacc7ba0 to 6eab35f49cbb (2 revisions) (flutter/engine#20913)

* 101316b [web] migrate from e2e to integration_test (flutter/engine#20914)

* 1f52ec3 Roll Dart SDK from 6eab35f49cbb to 2a5f37d25453 (1 revision) (flutter/engine#20917)

* 8019058 Default C++ wrapper templates to EncodableValue (flutter/engine#20760)

* 5f3ec38 Roll Fuchsia Mac SDK from sI2DAAmSI... to waj2pOhDh... (flutter/engine#20919)

* a651020 Roll Fuchsia Linux SDK from _SVZn8uN2... to 9tLNFbjA1... (flutter/engine#20920)

* 696c2aa Roll Skia from 3913d3e137ed to 7b46300fe4ff (4 revisions) (flutter/engine#20924)

* 95f2b72 Create root isolate asynchronously (flutter/engine#20142)

* 58a6207 Adds fuchsia node roles to accessibility bridge updates. (flutter/engine#20385)

* a762143 Roll Dart SDK from 2a5f37d25453 to e8e0d5a539fb (3 revisions) (flutter/engine#20928)

* 49d6805 Ensure all images are closed in FlutterImageView (flutter/engine#20842)

* d67bda7 Image.toByteData and Picture.toImage implementations (#3) (flutter/engine#20750)

* 96efe39 Revert "Adds fuchsia node roles to accessibility bridge updates. (#20385)" (flutter/engine#20936)

* 5585ed9 Revert "Create root isolate asynchronously (#20142)" (flutter/engine#20937)

* f6270c0 Roll Dart SDK from e8e0d5a539fb to b29f228f62e2 (3 revisions) (flutter/engine#20939)

* 15bf1bb [Android R] Integrate DisplayCutouts into viewportMetrics (flutter/engine#20921)

* 615e668 Clear the GL context only after submitting the frame (flutter/engine#20931)

* ca989b8 Roll Skia from 7b46300fe4ff to 1338a37a1add (16 revisions) (flutter/engine#20943)

* 8f3f711 Roll Fuchsia Linux SDK from 9tLNFbjA1... to knpSoAoZq... (flutter/engine#20944)

* 873c007 Log exception in addition to the stack trace for unhandled exceptions. (flutter/engine#20935)

* d761629 Roll Skia from 1338a37a1add to 8fa3b4e8cde5 (6 revisions) (flutter/engine#20949)

* f6920da Roll Skia from 8fa3b4e8cde5 to e9a9ad908226 (5 revisions) (flutter/engine#20952)

* 634e499 Use hint freed specifically for image disposal (flutter/engine#20754)

* c700479 Revert external size changes to Picture (flutter/engine#20950)

* 4353797 Roll Skia from e9a9ad908226 to 3d1d636cd839 (6 revisions) (flutter/engine#20955)

* 80f4481 renaming e2e tests to integration (flutter/engine#20954)

* 61e057a Clear GL context before Gr context (flutter/engine#20957)

* f43c3d7 Roll Fuchsia Mac SDK from waj2pOhDh... to 0r88gDzUP... (flutter/engine#20958)

* 5a2db33 Roll Skia from 3d1d636cd839 to 683beccf6776 (13 revisions) (flutter/engine#20961)

* efb339f Only clear GL context after changing the thread configuration (flutter/engine#20965)

* 58d5132 Roll Fuchsia Linux SDK from knpSoAoZq... to odFvFQV9Z... (flutter/engine#20968)

* 3729fdb Roll Skia from 683beccf6776 to a66a9c31a318 (4 revisions) (flutter/engine#20969)

* 40fe7f3 Roll Fuchsia Mac SDK from 0r88gDzUP... to gOI3W1UNU... (flutter/engine#20970)

* e979c29 Roll Skia from a66a9c31a318 to be72801f29f9 (1 revision) (flutter/engine#20971)

* 6e8930b Roll Skia from be72801f29f9 to f8823b572600 (1 revision) (flutter/engine#20973)

* 68b7b84 [fuchsia] Send trace events to system tracing on all configurations (flutter/engine#20974)

* 3f05b52 Always set the callback during Rasterizer setup (flutter/engine#20976)
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
* 5e54c70 Reland: Enable hybrid composition by default on Android (flutter#20722) (flutter/engine#20864)

* 9398717 Roll Skia from db5582b71116 to 44e96bee4b6a (4 revisions) (flutter/engine#20908)

* 5f49a95 Add auto plugin registration to FlutterFragmentActivity as well (flutter/engine#20865)

* c4c4f34 Wait for first frame before checking layer tree (flutter/engine#20910)

* 0773bf0 Roll Skia from 44e96bee4b6a to 3913d3e137ed (2 revisions) (flutter/engine#20909)

* 8ec8af7 [windows] Add horizontal scroll support (flutter/engine#20668)

* 1bd9b8e Reset Shell::weak_factory_gpu_ on the raster thread (flutter/engine#20869)

* d67923f Pass text input key events to the EventResponder if they do not yield characters (flutter/engine#20912)

* abe10d1 Roll Dart SDK from 84c3eacc7ba0 to 6eab35f49cbb (2 revisions) (flutter/engine#20913)

* 101316b [web] migrate from e2e to integration_test (flutter/engine#20914)

* 1f52ec3 Roll Dart SDK from 6eab35f49cbb to 2a5f37d25453 (1 revision) (flutter/engine#20917)

* 8019058 Default C++ wrapper templates to EncodableValue (flutter/engine#20760)

* 5f3ec38 Roll Fuchsia Mac SDK from sI2DAAmSI... to waj2pOhDh... (flutter/engine#20919)

* a651020 Roll Fuchsia Linux SDK from _SVZn8uN2... to 9tLNFbjA1... (flutter/engine#20920)

* 696c2aa Roll Skia from 3913d3e137ed to 7b46300fe4ff (4 revisions) (flutter/engine#20924)

* 95f2b72 Create root isolate asynchronously (flutter/engine#20142)

* 58a6207 Adds fuchsia node roles to accessibility bridge updates. (flutter/engine#20385)

* a762143 Roll Dart SDK from 2a5f37d25453 to e8e0d5a539fb (3 revisions) (flutter/engine#20928)

* 49d6805 Ensure all images are closed in FlutterImageView (flutter/engine#20842)

* d67bda7 Image.toByteData and Picture.toImage implementations (flutter#3) (flutter/engine#20750)

* 96efe39 Revert "Adds fuchsia node roles to accessibility bridge updates. (flutter#20385)" (flutter/engine#20936)

* 5585ed9 Revert "Create root isolate asynchronously (flutter#20142)" (flutter/engine#20937)

* f6270c0 Roll Dart SDK from e8e0d5a539fb to b29f228f62e2 (3 revisions) (flutter/engine#20939)

* 15bf1bb [Android R] Integrate DisplayCutouts into viewportMetrics (flutter/engine#20921)

* 615e668 Clear the GL context only after submitting the frame (flutter/engine#20931)

* ca989b8 Roll Skia from 7b46300fe4ff to 1338a37a1add (16 revisions) (flutter/engine#20943)

* 8f3f711 Roll Fuchsia Linux SDK from 9tLNFbjA1... to knpSoAoZq... (flutter/engine#20944)

* 873c007 Log exception in addition to the stack trace for unhandled exceptions. (flutter/engine#20935)

* d761629 Roll Skia from 1338a37a1add to 8fa3b4e8cde5 (6 revisions) (flutter/engine#20949)

* f6920da Roll Skia from 8fa3b4e8cde5 to e9a9ad908226 (5 revisions) (flutter/engine#20952)

* 634e499 Use hint freed specifically for image disposal (flutter/engine#20754)

* c700479 Revert external size changes to Picture (flutter/engine#20950)

* 4353797 Roll Skia from e9a9ad908226 to 3d1d636cd839 (6 revisions) (flutter/engine#20955)

* 80f4481 renaming e2e tests to integration (flutter/engine#20954)

* 61e057a Clear GL context before Gr context (flutter/engine#20957)

* f43c3d7 Roll Fuchsia Mac SDK from waj2pOhDh... to 0r88gDzUP... (flutter/engine#20958)

* 5a2db33 Roll Skia from 3d1d636cd839 to 683beccf6776 (13 revisions) (flutter/engine#20961)

* efb339f Only clear GL context after changing the thread configuration (flutter/engine#20965)

* 58d5132 Roll Fuchsia Linux SDK from knpSoAoZq... to odFvFQV9Z... (flutter/engine#20968)

* 3729fdb Roll Skia from 683beccf6776 to a66a9c31a318 (4 revisions) (flutter/engine#20969)

* 40fe7f3 Roll Fuchsia Mac SDK from 0r88gDzUP... to gOI3W1UNU... (flutter/engine#20970)

* e979c29 Roll Skia from a66a9c31a318 to be72801f29f9 (1 revision) (flutter/engine#20971)
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
* 5e54c70 Reland: Enable hybrid composition by default on Android (flutter#20722) (flutter/engine#20864)

* 9398717 Roll Skia from db5582b71116 to 44e96bee4b6a (4 revisions) (flutter/engine#20908)

* 5f49a95 Add auto plugin registration to FlutterFragmentActivity as well (flutter/engine#20865)

* c4c4f34 Wait for first frame before checking layer tree (flutter/engine#20910)

* 0773bf0 Roll Skia from 44e96bee4b6a to 3913d3e137ed (2 revisions) (flutter/engine#20909)

* 8ec8af7 [windows] Add horizontal scroll support (flutter/engine#20668)

* 1bd9b8e Reset Shell::weak_factory_gpu_ on the raster thread (flutter/engine#20869)

* d67923f Pass text input key events to the EventResponder if they do not yield characters (flutter/engine#20912)

* abe10d1 Roll Dart SDK from 84c3eacc7ba0 to 6eab35f49cbb (2 revisions) (flutter/engine#20913)

* 101316b [web] migrate from e2e to integration_test (flutter/engine#20914)

* 1f52ec3 Roll Dart SDK from 6eab35f49cbb to 2a5f37d25453 (1 revision) (flutter/engine#20917)

* 8019058 Default C++ wrapper templates to EncodableValue (flutter/engine#20760)

* 5f3ec38 Roll Fuchsia Mac SDK from sI2DAAmSI... to waj2pOhDh... (flutter/engine#20919)

* a651020 Roll Fuchsia Linux SDK from _SVZn8uN2... to 9tLNFbjA1... (flutter/engine#20920)

* 696c2aa Roll Skia from 3913d3e137ed to 7b46300fe4ff (4 revisions) (flutter/engine#20924)

* 95f2b72 Create root isolate asynchronously (flutter/engine#20142)

* 58a6207 Adds fuchsia node roles to accessibility bridge updates. (flutter/engine#20385)

* a762143 Roll Dart SDK from 2a5f37d25453 to e8e0d5a539fb (3 revisions) (flutter/engine#20928)

* 49d6805 Ensure all images are closed in FlutterImageView (flutter/engine#20842)

* d67bda7 Image.toByteData and Picture.toImage implementations (flutter#3) (flutter/engine#20750)

* 96efe39 Revert "Adds fuchsia node roles to accessibility bridge updates. (flutter#20385)" (flutter/engine#20936)

* 5585ed9 Revert "Create root isolate asynchronously (flutter#20142)" (flutter/engine#20937)

* f6270c0 Roll Dart SDK from e8e0d5a539fb to b29f228f62e2 (3 revisions) (flutter/engine#20939)

* 15bf1bb [Android R] Integrate DisplayCutouts into viewportMetrics (flutter/engine#20921)

* 615e668 Clear the GL context only after submitting the frame (flutter/engine#20931)

* ca989b8 Roll Skia from 7b46300fe4ff to 1338a37a1add (16 revisions) (flutter/engine#20943)

* 8f3f711 Roll Fuchsia Linux SDK from 9tLNFbjA1... to knpSoAoZq... (flutter/engine#20944)

* 873c007 Log exception in addition to the stack trace for unhandled exceptions. (flutter/engine#20935)

* d761629 Roll Skia from 1338a37a1add to 8fa3b4e8cde5 (6 revisions) (flutter/engine#20949)

* f6920da Roll Skia from 8fa3b4e8cde5 to e9a9ad908226 (5 revisions) (flutter/engine#20952)

* 634e499 Use hint freed specifically for image disposal (flutter/engine#20754)

* c700479 Revert external size changes to Picture (flutter/engine#20950)

* 4353797 Roll Skia from e9a9ad908226 to 3d1d636cd839 (6 revisions) (flutter/engine#20955)

* 80f4481 renaming e2e tests to integration (flutter/engine#20954)

* 61e057a Clear GL context before Gr context (flutter/engine#20957)

* f43c3d7 Roll Fuchsia Mac SDK from waj2pOhDh... to 0r88gDzUP... (flutter/engine#20958)

* 5a2db33 Roll Skia from 3d1d636cd839 to 683beccf6776 (13 revisions) (flutter/engine#20961)

* efb339f Only clear GL context after changing the thread configuration (flutter/engine#20965)

* 58d5132 Roll Fuchsia Linux SDK from knpSoAoZq... to odFvFQV9Z... (flutter/engine#20968)

* 3729fdb Roll Skia from 683beccf6776 to a66a9c31a318 (4 revisions) (flutter/engine#20969)

* 40fe7f3 Roll Fuchsia Mac SDK from 0r88gDzUP... to gOI3W1UNU... (flutter/engine#20970)

* e979c29 Roll Skia from a66a9c31a318 to be72801f29f9 (1 revision) (flutter/engine#20971)

* 6e8930b Roll Skia from be72801f29f9 to f8823b572600 (1 revision) (flutter/engine#20973)

* 68b7b84 [fuchsia] Send trace events to system tracing on all configurations (flutter/engine#20974)

* 3f05b52 Always set the callback during Rasterizer setup (flutter/engine#20976)
liyuqian added a commit to liyuqian/engine that referenced this pull request Oct 10, 2020
liyuqian added a commit that referenced this pull request Oct 12, 2020
This reverts commit 5585ed9.

Additionally, the following _flutter.runInView deadlock is fixed.

Previously, a deadlock would occur when service protocol
_flutter.runInView is used to restart the engine wihtout tearing down
the shell: the shared mutex of the service protocol will be locked
during the restart as it's in the middle of handling a service protocol
message; if ServiceProtocol::AddHandler is also called during the
restart, the deadlock happens as AddHandler also requires such lock.

test/integration.shard/background_isolate_test.dart would fail
without this fix.
jonahwilliams added a commit that referenced this pull request Oct 15, 2020
gspencergoog pushed a commit to gspencergoog/engine that referenced this pull request Oct 20, 2020
…21747)

This reverts commit 5585ed9.

Additionally, the following _flutter.runInView deadlock is fixed.

Previously, a deadlock would occur when service protocol
_flutter.runInView is used to restart the engine wihtout tearing down
the shell: the shared mutex of the service protocol will be locked
during the restart as it's in the middle of handling a service protocol
message; if ServiceProtocol::AddHandler is also called during the
restart, the deadlock happens as AddHandler also requires such lock.

test/integration.shard/background_isolate_test.dart would fail
without this fix.
chriscraws pushed a commit to chriscraws/engine that referenced this pull request Oct 22, 2020
* Add an adjustment to currentLineWidth comparisons when pushing greedy line breaks (#21356)

This is similar to the workaround used for
https://github.com/flutter/flutter/issues/30347

The Minikin line breaker inserts greedy breaks based on a comparison of
postBreak width and currentLineWidth.  currentLineWidth is provided by
the framework based on previous calls to Layout::measureText.
That calculation may not exactly match the calculation of postBreak.

This change ensures that breaks are only added if the difference
between postBreak and currentLineWidth is significant.

Fixes https://github.com/flutter/flutter/issues/65419

* Run desktop darwin tests in debug mode (#21660)

* [macOS] Allow loading of AOT snapshots and instructions from elf bundle (#21670)

* Ensure JNI is not called from raster thread (#21665)

* Roll Skia from a7f69c290667 to 041fd0ad7d93 (5 revisions) (#21676)

* [web] Support custom url strategies (#19134)

* Enabled metal on ios simulator (#17881)

* Roll Dart SDK from 9560a32779fc to 8f1a96317589 (12 revisions) (#21678)

* Avoid leaking the FlutterEngineAOTData structure in FlutterEngineCollectAOTData. (#21680)

* Store selection base/extent as integers (#21663)

Previously, the selection base and extent were stored internally as
iterators over text_. Since iterators must be treated as invalidated
whenever the underlying container changes, this requires that
selection_base_ and selection_extent_ be re-assigned after every change
to text_.

This is not currently particularly problematic, but once we add fields
to track the base and extent of the composing region for multi-step
input method support, as well as support for the sub-range within the
composing region to which edits/completions apply, we end up having to
regenerate a lot of iterators with each change, many of which are
logically unchanged in position.

A side benefit is that this simplifies inspection of these fields when
debugging.

* Revert "[web] Support custom url strategies (#19134)" (#21687)

This reverts commit 02324994a3f44a2777ade96b3d69aa61901fb9b4.

* Make TextInputModel::selection_start/end const (#21685)

Neither of these methods mutate the state of the model.

* Roll Skia from 041fd0ad7d93 to 38e6d226f24e (1 revision) (#21683)

* Roll Fuchsia Linux SDK from kr1tNtZvZ... to ZJHmp3INU... (#21684)

* Roll Dart SDK from 8f1a96317589 to 8572b5c0f6dc (1 revision) (#21686)

* Roll Skia from 38e6d226f24e to ac0723a06b53 (3 revisions) (#21688)

* Roll Fuchsia Mac SDK from m6w8tDXMm... to zhRBO0hCr... (#21689)

* Roll Dart SDK from 8572b5c0f6dc to 98ea0b4971dd (1 revision) (#21691)

* Skip flaky test (#21694)

* Preserve specified AssetResolvers when performing a hot restart or updating the asset directory (#21611)

Follow up from #21436 . That PR works for all embeddings except for Android, which creates a special JNI AssetResolver. Since the shell cannot recreate this resolver, update the logic to preserve existing resolvers instead.

* Roll Skia from ac0723a06b53 to 8d43858ed21a (1 revision) (#21692)

* Remove dependencies on _product variants of libdart from the Fuchsia release mode build (#21668)

* fixing the autofill overlay problem (blue area for chrome) (#21610)

* fixing the autofill overlay problem (blue area for chrome)

* addression comments

* [macOS] flutter_desktop_darwin_unittests can be enabled for all runtime modes (#21681)

* Roll Dart SDK from 98ea0b4971dd to 44fa3b9e566c (1 revision) (#21695)

* Update PR template to include the presubmit flake form (#21697)

* [macOS] Fix docs for loadAOTData and minor refactor (#21699)

* Roll Skia from 8d43858ed21a to 9c0b79a35489 (14 revisions) (#21698)

* Fix engine Xcode projection for newer versions of Xcode. (#21701)

* chrome driver for chrome 86 (#21705)

* Clear the Minikin layout cache during engine destruction (#21473)

* Roll Skia from 9c0b79a35489 to e17b0501963a (15 revisions) (#21707)

* [web] Reland Support custom url strategies (#21702)

* SecurityException: Permission Denial (#21290)

Fix `java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider`

Fixes flutter/flutter#66108

Co-authored-by: Dan Field <[email protected]>

* Roll ICU to 146cb611fb2c1f53e63c2e59bd735d7a8ac6ec8c (#21606)

* fl_method_response.cc: fix lint failures (#21406)

Fix lint issues caused by `google-readability-braces-around-statements`.

* Forbid android.util.Log (#21696)

* Roll Dart SDK from 44fa3b9e566c to 4ba58cad60e4 (1 revision) (#21708)

* Roll Fuchsia Linux SDK from ZJHmp3INU... to wrXNShr_8... (#21709)

* Perform selection check in DeleteSelected (#21711)

At every call site for TextInputModel::DeleteSelected, we perform a
check for a collapsed selection. This moves that check into the method
itself.

* Roll Dart SDK from 4ba58cad60e4 to fe566e6d08b1 (1 revision) (#21718)

* Roll Fuchsia Mac SDK from zhRBO0hCr... to LyP59nILn... (#21720)

* Roll Dart SDK from fe566e6d08b1 to 1e7250f91944 (1 revision) (#21723)

* Roll Dart SDK from 1e7250f91944 to 712e35f7fd0b (1 revision) (#21725)

https://dart.googlesource.com/sdk.git/+log/1e7250f91944..712e35f7fd0b

2020-10-09 [email protected] Version 2.11.0-205.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

* Roll Skia from e17b0501963a to 453f67ff0ade (28 revisions) (#21732)

https://skia.googlesource.com/skia.git/+log/e17b0501963a..453f67ff0ade

2020-10-09 [email protected] SkSL enum changes
2020-10-09 [email protected] Suppress vulkan validation layers bug.
2020-10-09 [email protected] more SkSL IRNode refactoring
2020-10-09 [email protected] Make sure the normal GrProgramDesc handles input attachment key.
2020-10-09 [email protected] SkDevice::drawSpecial accepts arbitrary matrix v2
2020-10-09 [email protected] Reorganize how SkSL includes are parsed and stored
2020-10-09 [email protected] Reland "Add sk_Caps.builtinDeterminantSupport and use it in cross()."
2020-10-09 [email protected] Reland "Merge GrContext::init into GrDirectContext ..."
2020-10-09 [email protected] Add test for sk_Caps.mustGuardDivisionEvenAfterExplicitZeroCheck.
2020-10-09 [email protected] Add test for sk_Caps.inBlendModesFailRandomlyForAllZeroVec.
2020-10-09 [email protected] Reland "Put top level FPs into their own functions"
2020-10-09 [email protected] refactored more SkSL IRNodes
2020-10-09 [email protected] Reland "Rename GrStencilAttachment class to generic GrAttachment"
2020-10-09 [email protected] Roll Chromium from af82ff2606e9 to 4a368eae5a6f (468 revisions)
2020-10-09 [email protected] Roll SwiftShader from 5f4e70b81046 to 952149303d06 (1 revision)
2020-10-09 [email protected] Roll Dawn from 6b4a4a85dfd7 to 793a07e36636 (12 revisions)
2020-10-09 [email protected] Revert "Add sk_Caps.builtinDeterminantSupport and use it in cross()."
2020-10-09 [email protected] Remove custom iterators from SkSL::Program
2020-10-08 [email protected] Revert "Rename GrStencilAttachment class to generic GrAttachment"
2020-10-08 [email protected] Add sk_Caps.builtinDeterminantSupport and use it in cross().
2020-10-08 [email protected] Add SkImageFilters::Shader in place of Paint factory
2020-10-08 [email protected] Clip perspective bounds by device clip in SkPDFDevice
2020-10-08 [email protected] Revert "Merge GrContext::init into GrDirectContext ..."
2020-10-08 [email protected] Add push constant support to GrCaps.
2020-10-08 [email protected] Merge GrContext::init into GrDirectContext ...
2020-10-08 [email protected] Expose ManagedBackendTexture from BackendTextureImageFactory.
2020-10-08 [email protected] [canvaskit] Attempt to turn off rtti
2020-10-08 [email protected] Use SkSTArray to track CFG exits instead of std<set>.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

* Roll Fuchsia Mac SDK from LyP59nILn... to lqn8xmlDn... (#21733)

* Roll Dart SDK from 712e35f7fd0b to 06536d68ca0f (2 revisions) (#21736)

* Roll Fuchsia Linux SDK from wrXNShr_8... to EBX49sN_X... (#21729)

* Roll Skia from 453f67ff0ade to 269e43fd9830 (11 revisions) (#21739)

* Fix filesystem access prior to macOS 10.15 (#21740)

* Roll Skia from 269e43fd9830 to 88cda17bbeb8 (3 revisions) (#21742)

* [web] Add ShaderBuilder, change drawVertices to use builder. (#21716)

* Move shader.dart into shaders directory
* Add Shader builder basic structure and decls
* rewrite drawVertices with ShaderBuilder
* Fix in parameters in fragment shader to use varying for webgl1

* Add dart_entrypoint_argc/argv to the FlutterProjectArgs (#21737)

* Migration to PlatformDispatcher and multi-window (#20496)

This is a PR for converting the dart:ui code in the engine to use a multi-window API. The goal here is to convert from the window singleton to an API that has the concept of multiple windows. Also, I'm matching up the new PlatformDispatcher class to talk directly to the PlatformConfiguration class in the engine. I'm not attempting to actually enable creating multiple windows here, just migrate to an API that has a concept of multiple windows. The multi-window API in this PR currently only ever creates one window.

The design doc for this change is here.

The major changes in this PR:

Move the platfom-specific attributes out of Window, and into the new PlatformDispatcher class that holds all of the platform state, so that the platform code need only update the configuration on this class.
Create FlutterView, FlutterWindow, and SingletonFlutterWindow classes to separate out the concepts of a view (of which there may be multiple in a window), a window (of which there may be multiple on a screen, and they host views), and a window where there is only ever expected to be one (this hosts the entire API of the former Window class, and will eventually be the type of the window singleton).
Next step after this PR lands:

Remove the Window class entirely (it is replaced by SingletonFlutterWindow). Some minor changes in the Framework are needed to switch to using SingletonFlutterWindow directly first.

The Window class still exists in this PR, but will be removed as soon as the framework is converted to point to the SingletonFlutterWindow class instead. They share the same API, just have different names (Window is currently a subclass of SingletonFlutterWindow). The intention is that the Window name will be freed up to use as a widget class name in the framework for managing windows. The singleton called window will remain, and keep the same API it has now.

* Remove uses of Dart VM bytecode mode from Flutter engine (#21741)

* Roll Skia from 88cda17bbeb8 to 61003cde7688 (4 revisions) (#21744)

* Revert "fix On iOS, dialog titles are announced twice (#19826)" (#21714)

* Roll Skia from 61003cde7688 to 13fc260c7080 (1 revision) (#21746)

* Roll Fuchsia Mac SDK from lqn8xmlDn... to gzhbqRUap... (#21749)

* Roll Skia from 13fc260c7080 to aa64c352b349 (1 revision) (#21752)

* Roll Fuchsia Linux SDK from EBX49sN_X... to YRTc9YoiB... (#21753)

* Roll Skia from aa64c352b349 to d71dc2d25b8b (1 revision) (#21758)

* Roll Fuchsia Mac SDK from gzhbqRUap... to _0R2HD4c8... (#21759)

* Roll Fuchsia Linux SDK from YRTc9YoiB... to Nw5-0_sVF... (#21760)

* Roll Fuchsia Mac SDK from _0R2HD4c8... to 82ankF-Ht... (#21762)

* Roll Fuchsia Mac SDK from 82ankF-Ht... to FFpTJfmj1... (#21768)

* Use buildroot clang for scenario app (#21690)

* Roll Fuchsia Linux SDK from Nw5-0_sVF... to h-DeV4tgE... (#21771)

* Roll Skia from d71dc2d25b8b to ceb6214a556a (5 revisions) (#21772)

* Ignore analysis warning for doc comment (#21773)

This is to unblock a Dart -> engine roll.

* Roll Skia from ceb6214a556a to 9213e610ed92 (8 revisions) (#21774)

* Roll Dart SDK from 06536d68ca0f to e256855d07ba (6 revisions) (#21775)

* Reland "Create root isolate asynchronously (#20142)" (#21747)

This reverts commit 5585ed99039efb3705025e1c58170cdb86af111b.

Additionally, the following _flutter.runInView deadlock is fixed.

Previously, a deadlock would occur when service protocol
_flutter.runInView is used to restart the engine wihtout tearing down
the shell: the shared mutex of the service protocol will be locked
during the restart as it's in the middle of handling a service protocol
message; if ServiceProtocol::AddHandler is also called during the
restart, the deadlock happens as AddHandler also requires such lock.

test/integration.shard/background_isolate_test.dart would fail
without this fix.

* Roll Skia from 9213e610ed92 to 840e8ea7403e (11 revisions) (#21779)

* Roll Skia from 840e8ea7403e to ab6e62c131e9 (7 revisions) (#21783)

* Fix documentation build for window changes. (#21780)

* Fix documentation build for window changes.

* Add missing interfaces for web_ui

* E2e screenshot tests2 (#21383)

* carrying code

* more changes for carrying the code

* rebase changes onto ios-screenshot tests

* adding screenshot capability to text_editing e2e test

* address some comments

* change enable flag for isUnitTestsScreenshotsAvailable

* addressing the reviewer comments

* change the dependency for path

* add to licencense file

* changing goldens commit no. the new commit has the screenshot goldens

* update readme file

* firefox tests needs LUCI changes

* change to release mode since screenshots were taken in release mode

* change window size

* some argument changes

* small comment change

* test the chrome linux tests again

* use roboto font instead of default font

* addressing reviewer comments

* change commit for goldens

* [null-safety] fix build rule to produce sound dill (#21784)

The space in the argument name was causing this argument to be dropped and the sound and unsound dills to be identical.

* Extract a TextRange class for selection (#21722)

Extracts a TextRange class with a base and extent, and start(), end(),
collapsed(), and length() getters.

The possibility of reversed base and extent in selections and composing
ranges makes reasoning about them complex and increases the chances of
errors in the code. This change migrates most uses of base and extent in
the text model to start()/end() or position(). The position() method is
intended purely as an aid to readability to indicate that a collapsed
selection is expected at the call site; it also enforces a debug-time
assertion that this is the case.

* Revert "Migration to PlatformDispatcher and multi-window #20496" (#21792)

* Revert "Fix documentation build for window changes. (#21780)"

This reverts commit 931a04683d6eb49fc92059b2384ac5b1618d5422.

* Revert "Migration to PlatformDispatcher and multi-window (#20496)"

This reverts commit 85b0031f73544e448354047dc6a236c0b0808252.

* Add workaround for missing fl_method_xxx_response_get_type() symbols (#21405)

* Support Wayland only (without X11 support in gdk) (#21218)

Adds a support for compiling flutter engine when
gdk does not have X11 backend. In such a configuration
the generated gdkconfig.h header file looks like the following:

 /* gdkconfig.h
  *
  * This is a generated file.  Please modify `configure.ac'
  */

 #ifndef __GDKCONFIG_H__
 #define __GDKCONFIG_H__

 #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
 #error "Only <gdk/gdk.h> can be included directly."
 #endif

 #include <glib.h>

 G_BEGIN_DECLS

 #define GDK_WINDOWING_WAYLAND

 G_END_DECLS

 #endif  /* __GDKCONFIG_H__ */

Additionally headers like <gdk/gdkx.h> are not available at all.

Above configuration can be found on the most of the embedded systems.

This patch enables compilation of X11 specific code only when gdk
defines GDK_WINDOWING_X11.

Signed-off-by: Damian Wrobel <[email protected]>

* Roll Skia from ab6e62c131e9 to f58db3c94da3 (6 revisions) (#21794)

* Roll Fuchsia Mac SDK from FFpTJfmj1... to 8Cb2zG9e3... (#21795)

* Roll Fuchsia Linux SDK from h-DeV4tgE... to gdo4mZ5oI... (#21797)

* Roll Skia from f58db3c94da3 to 387fd62a1280 (3 revisions) (#21801)

* Roll Skia from 387fd62a1280 to c89a7ee628db (1 revision) (#21803)

* Roll Skia from c89a7ee628db to fa8891164062 (1 revision) (#21804)

* [web] Fix Altgr keyboard crash (#21781)

* Fix AltGr modifier crash
* update integration test

* Roll Skia from fa8891164062 to 01b93eabe25b (4 revisions) (#21805)

* Ocmock dylib (#21786)

- Build OCMock as a dylib for iOS tests
- Set install_name for ios_flutter_test and ocmock dylibs
- Copy and sign dylibs during build process

* Roll Dart SDK from e256855d07ba to a3b62f366529 (4 revisions) (#21808)

* Roll Dart SDK from e256855d07ba to a3b62f366529 (4 revisions) (#21809)

* Roll Skia from 01b93eabe25b to 2e0c70dc9c3e (10 revisions) (#21810)

* Roll Fuchsia Linux SDK from gdo4mZ5oI... to 41fVbRhb0... (#21814)

* Revert "Roll Fuchsia Linux SDK from gdo4mZ5oI... to 41fVbRhb0... (#21814)" (#21823)

This reverts commit 7959d80c10d586a71f2671febe877bfba3d2d014.

* Allow TalkBack navigation while a platform view is rendered (#21719)

* [ios] Create a standalone external view embedder on iOS (#21798)

* Add missing ninja call to analyze.sh so it can be run locally easily (#21782)

* Roll Skia from 2e0c70dc9c3e to 7bbdde059685 (10 revisions) (#21816)

* Call PlatformView.dispose when removing hybrid composition platform views (#21790)

Also force disposal of all hybrid platform views when shutting down the
engine.

Fixes https://github.com/flutter/flutter/issues/66764

* [fuchsia] add intercept_all_input flag support (#21821)

[fuchsia] add intercept_all_input flag support

This change also fixes an issue where FlutterRunnerProductConfiguration
crashes when a field is missing, when building with --unopt.

Test: Added unit tests
Bug: fxb/61466, fxb/61942

* [web] enabling firefox screenshot tests. adding to documentation (#21807)

* enabling firefox screenshot tests. adding to documentation

* test with correct goldens

* update goldens SHA

* change the goldens with flutter/goldens repo

* do not run preparation step twice. this will cause test_results to be deleted

* Revert Linux Fuchsia SDK rolls to 10/8 (#21829)

* Roll Dart SDK from a3b62f366529 to 4226116043f5 (1 revision) (#21830)

* Roll Fuchsia Mac SDK from 8Cb2zG9e3... to SFNhlfVb_... (#21832)

* Roll Skia from 7bbdde059685 to 99446001182c (5 revisions) (#21834)

* Fix the offset passed to minikin::GraphemeBreak::isGraphemeBreak (#21706)

The character offset passed to isGraphemeBreak is relative to the beginning
of the string (not relative to the text_start parameter).  This caused bad
results when searching for grapheme breaks beyond the first line of text
(see https://github.com/flutter/flutter/issues/24802).

This PR fixes the offset value.  It also reverts the workaround applied in
https://github.com/flutter/engine/pull/10063, which caused incorrect
calculation of boundaries between graphemes within ligatures.

* Update flutter to pass Skia the VkImageUsageFlags and Samples (#21842)

Previously Skia did not require the clients to pass in the usage flags and Skia would just assumed they contained specific ones depending on how the client wrapped the VkImage. Now Skia allows the client to pass in the specific usage flags used so that Skia knows exactly what type of operations are legal without having to guess/assume what the client did.

Also update to set the sample count as well while I'm in here.

* [android] Refactor surface factory and wire in external view embedder (#21839)

* Upgrade to latest process runner, fix commands that throw to fail test (#21827)

This fixes the lint script to fail when the clang-tidy command itself fails to execute, and print the exception that was raised.

* Prevent a race between SurfaceTexture.release and updateTexImage (#21777)

* Explicitly make the X connection for EGL. (#21831)

Explicitly make the X connection for EGL.

EGL can mistakenly choose the GBM backend when using EGL_DEFAULT_DISPLAY.

Fixes https://github.com/flutter/flutter/issues/60429

* Revert "Explicitly make the X connection for EGL. (#21831)" (#21851)

This reverts commit 516cbaee8736cb4bbc9fdaa6af4ae9a2ec55c5cc.

* Roll Dart SDK from 4226116043f5 to 04cf6ade9fc4 (4 revisions) (#21846)

* Roll Skia from 99446001182c to f4bda743ff8d (22 revisions) (#21848)

* Migrate TextInputPlugin API to TextRange (#21854)

Replaces selection_base() and selection_extent() with selection() and
SetSelection(int, int) with SetSelection(range).

This also adds the following convenience methods to TextRange:
* reversed()
* Contains(size_t position)
* Contains(const TextRange& range)

as well as operator== for use in unit tests. When Flutter migrates to
C++20, we can replace that method with a default declaration.

* Add a style note about Linux embedding style (#21819)

* Add flag to not publish the observatory port over mDNS (#21632)

* Add flag to not publish the observatory port over mDNS

* Review edits

* Format

* Fix destruction order in C++ plugin registrar (#21840)

The C++ wrapper's plugin registrar can own plugins to provided lifetime
management. However, plugins expect the registrar to be valid for the
life of the object, including during destruction, so any owned plugins
must be explicitly cleared before any registrar-specific destruction
happens.

* Revert "Add flag to not publish the observatory port over mDNS (#21632)" (#21882)

This reverts commit dc848f154b9c5534262e5b8d3f0360a1beafdeb5.

* Add flag to not publish the observatory port over mDNS (#21883)

* begin to add uniformData

* Update more class names from GrContext to GrDirectContext (#21864)

This name change has to do with SkDeferredDisplayList, which Flutter
does not use. As far as Flutter is concerned, this is a no-op.

* Add more TextStyle support to Paragraph in CanvasKit mode (#21629)

* WIP on Paragraph

* WIP skparagraph

* Add more Paragraph features in CanvasKit mode

* Fix addRoundRect test

* Respond to review comments

* Remove unused (and potentially harmful) getters from Sk classes

* disabled the auto assign bot (#21341)

* Fix incldues to be flutter/shell rather than shell/ (#21889)

* Check for null images in ImageFromCompressedData (#21891)

* Roll buildroot to 9184ff0695be1b3e4bb20cf64efcfa56daa0a3c0 (#21884)

This fixes Windows build on goma.

Rolls in buildroot change https://github.com/flutter/buildroot/pull/406 https://github.com/flutter/engine/pull/21884 by stuartmorgan which removes the /FC flag in Windows builds. That flag is incompatible with upstream goma changes.

See: https://source.chromium.org/chromium/chromium/src/+/2e6d17c6948b2ca1e4dbd6bf15fcb52d32fa338d

* Add TextRange::Contains tests spanning base/extent (#21874)

Adds tests for TextRange::Contains(const TextRange&) where the range
being tested spans the base/extent of the testing range.

This was originally intended to land in #21854, but it seems I didn't
push the additional tests before landing.

* Roll Skia from f4bda743ff8d to f1b53836b705 (21 revisions) (#21892)

* [fuchsia] External view embedder will be shared with platform view (#21850)

* Add multi-step IME support to TextInputModel (#21682)

* Add multi-step IME support to TextInputModel

This updates the platform-independent TextInputModel to add support for
input method (abbreviated IM or IME) composing regions.

In contrast to languages such as English, where keyboard input is
managed keystroke-by-keystroke, languages such as Japanese require a
multi-step input process wherein the user begins a composing sequence,
during which point their keystrokes are captured by a system input
method and converted into a text sequence. During composing, the user is
able to edit the composing range and manage the conversion from keyboard
input to text before eventually committing the text to the underlying
text input field.

To illustrate this, in Japanese, this sequence might look something like
the following:

1. User types 'k'. The character 'k' is added to the composing region.
   Typically, the text 'k' will be inserted inline into the underlying
   text field but the composing range will be highlighted in some manner,
   frequently with a highlight or underline.
2. User types 'a'. The composing range is replaced with the phonetic
   kana character 'か' (ka). The composing range continues to be
   highlighted.
3. User types 'k'. The character 'k' is appended to the composing
   range such that the highlighted text is now 'かk'
4. User types 'u'. The trailing 'k' is replaced with the phonetic kana
   character 'く' (ku) such that the composing range now reads 'かく'
   The composing range continues to be highlighted.
5. The user presses the space bar to convert the kana characters to
   kanji. The composing range is replaced with '書く' (kaku: to write).
6. The user presses the space bar again to show other conversions. The
   user's configured input method (for example, ibus) pops up a
   completions menu populated with alternatives such as 各 (kaku:
   every), 描く (kaku: to draw), 核 (kaku: pit of a fruit, nucleus), 角
   (kaku: angle), etc.
7. The user uses the arrow keys to navigate the completions menu and
   select the alternative to input. As they do, the inline composing
   region in the text field is updated. It continues to be highlighted
   or underlined.
8. The user hits enter to commit the composing region. The text is
   committed to the underlying text field and the visual highlighting is
   removed.
9. If the user presses another key, a new composing sequence begins.

If a selection is present when composing begins, it is preserved until
the first keypress of input is received, at which point the selection is
deleted. If a composing sequence is aborted before the first keypress,
the selection is preserved. Creating a new selection (with the mouse,
for example) aborts composing and the composing region is automatically
committed. A composing range and selection, both with an extent, are
not permitted to co-exist.

During composing, keyboard navigation via the arrow keys, or home and
end (or equivalent shortcuts) is restricted to the composing range, as
are deletions via backspace and the delete key. This patch adds two new
private convenience methods, `editing_range` and `text_range`. The
former returns the range for which editing is currently active -- the
composing range, if composing, otherwise the full range of the text. The
latter, returns a range from position 0 (inclusive) to `text_.length()`
exclusive.

* Move SetComposingLength to TextRange::set_*

Adds set_base, set_extent, set_start, set_end methods to TextRange.

* [embedder] Platform View owns lifecycle of external view embedder (#21847)

Changing it to shared_ptr and migrating the ownership from surface
to platform view.

* [ios] Refactor IOSSurface factory and unify surface creation (#21877)

* Roll Fuchsia Mac SDK from SFNhlfVb_... to _FaRRt69Z... (#21906)

* Roll Dart SDK from 04cf6ade9fc4 to 80288ca68c49 (6 revisions) (#21909)

* Roll Skia from f1b53836b705 to db0288d747ae (7 revisions) (#21910)

* Forward Error objects to uncaught exception handler if there is one. (#21806)

* Roll Skia from db0288d747ae to 839fb228ac44 (1 revision) (#21911)

* Roll Dart SDK from 80288ca68c49 to e655b9a3839e (1 revision) (#21915)

* Eliminate FLUTTER_NOLINT where possible (#21904)

This removes most of the remaining FLUTTER_NOLINT comments and opts
these files back into linter enforcement.

I've filed https://github.com/flutter/flutter/issues/68273 to require
that all FLUTTER_NOLINT comments be followed by a GitHub issue URL
describing the problem to be fixed.

* Roll Skia from 839fb228ac44 to 418eda2c599a (9 revisions) (#21917)

* Roll Dart SDK from e655b9a3839e to b58cfe5ab24e (1 revision) (#21919)

https://dart.googlesource.com/sdk.git/+log/e655b9a3839e..b58cfe5ab24e

2020-10-16 [email protected] Version 2.11.0-230.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

* Roll Dart SDK from e655b9a3839e to b58cfe5ab24e (1 revision) (#21920)

* Roll Skia from 418eda2c599a to f9c7b2803461 (3 revisions) (#21923)

* Enable loading snapshots with sound null safety enabled. (#21820)

Snapshots compiled with sound null-safety enabled require changes to the way in
which isolates are launched. Specifically, the `Dart_IsolateFlags::null_safety`
field needs to be known upfront. The value of this field can only be determined
once the kernel snapshot is available. This poses a problem in the engine
because the engine used to launch the isolate at shell initialization and only
need the kernel mappings later at isolate launch (when transitioning the root
isolate to the `DartIsolate::Phase::Running` phase). This patch delays launch of
the isolate on the UI task runner till a kernel mapping is available. The side
effects of this delay (callers no longer having access to the non-running
isolate handle) have been addressed in this patch. The DartIsolate API has also
been amended to hide the method that could return a non-running isolate to the
caller.  Instead, it has been replaced with a method that requires a valid
isolate configuration that returns a running root isolate. The isolate will be
launched by asking the isolate configuration for its null-safety
characteristics.

A side effect of enabling null-safety is that Dart APIs that work with legacy
types will now terminate the process if used with an isolate that has sound
null-safety enabled. These APIs may no longer be used in the engine. This
primarily affects the Dart Convertors in Tonic that convert certain C++ objects
into the Dart counterparts. All known Dart Converters have been updated to
convert C++ objects to non-nullable Dart types inferred using type traits of the
corresponding C++ object. The few spots in the engine that used the old Dart
APIs directly have been manually updated. To ensure that no usage of the legacy
APIs remain in the engine (as these would cause runtime process terminations),
the legacy APIs were prefixed with the `DART_LEGACY_API` macro and the macro
defined to `[[deprecated]]` in all engine translation units. While the engine
now primarily works with non-nullable Dart types, callers can still use
`Dart_TypeToNonNullableType` to acquire nullable types for use directly or with
Tonic. One use case that is not addressed with the Tonic Dart Convertors is the
creation of non-nullable lists of nullable types. This hasn’t come up so far in
the engine.

A minor related change is reworking tonic to define a single library target.
This allows the various tonic subsystems to depend on one another. Primarily,
this is used to make the Dart convertors use the logging utilities. This now
allows errors to be more descriptive as the presence of error handles is caught
(and logged) earlier.

Fixes https://github.com/flutter/flutter/issues/59879

* Break the reference cycle between the surface factory and the external view embedder (#21918)

See https://github.com/flutter/flutter/issues/68315

* Revert "[fuchsia] External view embedder will be shared with platform view (#21850)" (#21924)

This reverts commit 1bc025d6cbf1136c2e96c6fb041d24202ea47ff0.

* Add plumbing to grab dart entrypoint args on macOS (#21789)

* Update FLUTTER_NOLINT uses to include issue link (#21921)

In an upcoming patch, we'll enable enforcement that all FLUTTER_NOLINT
comments include an issue link. This migrates the remaining uses to that
format.

Bug: https://github.com/flutter/flutter/issues/68273

* Set strokeCap, strokeJoin, and strokeMiter when resurrecting Paint (#21926)

* Roll Skia from f9c7b2803461 to f60a76e2ac01 (4 revisions) (#21929)

* Eliminate unnecessary linter opt-outs (#21935)

Eliminates FLUTTER_NOLINT where they can be landed without triggering
lint failures.

* Require that FLUTTER_NOLINT include issue link (#21922)

This adds enforcement to the linter that all FLUTTER_NOLINT comments be
of the form:

    // FLUTTER_NOLINT: https://github.com/flutter/flutter/issue/ID

Every linter opt-out should have an associated bug describing what issue
it works around so that others can work on eliminating it, or at least
understanding the rationale and whether it's still relevant.

This also reduces the likelihood of inadvertent copy-pasting into new
files either because the author fails to spot it when copying the
copyright block from another file, or assumes that it's necessary for
some subcomponent of the engine.

Bug: https://github.com/flutter/flutter/issues/68273

* Roll Skia from f60a76e2ac01 to be8004d2fb6c (1 revision) (#21936)

* Roll the process_runner package used by the formatter script (#21937)

* Roll Dart SDK from b58cfe5ab24e to aaab579579be (1 revision) (#21938)

* Add FML_UNREACHABLE to declare points in code that should never be reached. (#21941)

A version of this macro is present in most code-bases. The use of this macro
must satisfy two requirements:

1: If reached, the process must be terminated in all runtime modes and at all
   optimization levels.
2: If the compiler requires a value to be returned from the function,
   encountering this macro should not make the compiler insist on a return value
  (since the process is about to die anyway).

We used to have a version of this macro that wasn't widely used and didn't
satisfy the two requirements. I have removed the same and another unused macro
in fml/logging.h

Fixes https://github.com/flutter/flutter/issues/68164.

* Roll Fuchsia Mac SDK from _FaRRt69Z... to XZSNobQCT... (#21944)

* Collect logs in the background. (#21828)

* Collect logs in the background.

* Use fuchsia_ctl log_file option.

* Delete the correct file.

* Remove commented code.

* Roll Dart SDK from aaab579579be to 42a0bf548ea3 (1 revision) (#21946)

* [web] Implement ClipOp.difference (#21901)

* Roll Dart SDK from 42a0bf548ea3 to 675c7165c071 (1 revision) (#21948)

* Roll Fuchsia Mac SDK from XZSNobQCT... to 9mMCqUXkF... (#21950)

* [null-safety] fix type declaration of Picutre._toImage (#21942)

Fixes flutter/flutter#68377

Should be a nullable string. Looks like --null-assertions does not cover the native binding code.

* Roll Dart SDK from 675c7165c071 to 5c59a47beda7 (1 revision) (#21952)

* Restore missing call to RuntimeDelegate.OnRootIsolateCreated (#21953)

Fixes https://github.com/flutter/flutter/issues/68411

* Roll Fuchsia Mac SDK from 9mMCqUXkF... to MR_bRfe8I... (#21955)

* Roll Skia from be8004d2fb6c to 27f7fe32f49b (1 revision) (#21956)

* Temporarily disabled tests that were using latin and arabic characters (#21971)

while we fix them.

* Specify the Noto Naskh Arabic font to get consistent results in tests using Arabic characters (#21974)

See https://github.com/flutter/flutter/issues/68493

* Added keyEvent support for iOS 13.4+  (#20972)

* Fix the initialization of AndroidSurfaceFactoryImpl (#21977)

Fixes https://github.com/flutter/flutter/issues/68446

* [null-safety] fix types of layer code (#21959)

* FlTextInputPlugin: fix memory leaks (#21879)

This PR fixes a few small memory leaks in FlTextInputPlugin. All three cases
are creating temporary FlValue instances for lookups and comparison without
ever releasing them.

* Add multi-step input method support for Linux (#21897)

This implements the Gtk hooks required to support multi-step input
methods on Linux. This builds on the support for composing regions
(preedit region in Gtk terminology) added to TextInputModel in
https://github.com/flutter/engine/pull/21682.

Specifically, the following changes are included:

1. Add handler for TextInput.setMarkedTextRegion framework messages: On
any change to the EditableText in the framework, this message is sent
which provides an updated rect (in the local co-ordinates of the
EditableText) for the composing region. If not in composing mode, the
cursor rect is sent.

2. Add handler for TextInput.setEditableSizeAndTransform framework messages:
On any change to the RenderObject underlying the EditableText, an
updated size for the full EditableText widget, as well as an affine
transform matrix from local co-ordinates to Flutter root co-ordinates is
sent.

3. On either of the above messages, we use the transformed composing
rect to compute the cursor position in Gtk window co-ordinates and
inform Gtk, so that it can position any system IM composing window
correctly for on-the-spot composing, such as is used when inputting
Japanese text.

4. Adds handlers for preedit-start, preedit-changed, and preedit-end
signals from Gtk. These are passed on to the TextInputModel.

5. Updates the preedit-commit handler to commit the composing region to
the text or, if not composing, insert new text at the cursor.

6. Updates the handler for TextInput.setEditingState framework messages
to extract the composing range base and extent and pass these on to
TextInputModel.

7. Updates update_editing_state function to set composing base and
extent on text input state updates sent to the framework.

* Forward font collection APIs to the SkParagraph font collection (#21734)

* Define SK_VULKAN for clang-tidy runs (#21927)

When linting flutter/vulkan/vulkan_window.cc, the call to
GrDirectContext::MakeVulkan is undefined when SK_VULKAN is not defined,
triggering a lint error.

Bug: https://github.com/flutter/flutter/issues/68331

* Revert "[ios] Refactor IOSSurface factory and unify surface creation (#21877)" (#21970)

* Roll Fuchsia Linux SDK from ZJHmp3INU... to dcMRY8S12... (#21976)

* Roll Dart SDK from 5c59a47beda7 to 902538ea56d5 (2 revisions) (#21978)

* [web] Fix 3d transforms for html backend (#21499)

* Workaround for canvas element lacking support for 3d setTransform

* update golden test

* Add webkit workaround

* Implement DOM rendering for perspective

* cleanup

* update goldens lock

* Add check for shader and filtermask for dom use

* Fix svg viewBox. Move zIndex check to bitmap canvas

* Fix null check warning

* Fix scene_builder zIndex=-1 test to force canvas usage

* Add blendmode handling for DOM mode

* Update maxdiff and golden locks

* Remove unused import

* Add drawcolor/drawpaint test. Fix bounds for drawColor/drawPaint

* update golden locks

* adjust drawColor for dpr

* Update test to use canvas

* Fix toDataUrl NNBD

* Update Picture.toImage to use canvas to obstain image data

* Remove write:true from golden calls

* Add fill-rule for _pathToSvgElement

* Update golden locks

* Fix sceneBuilder pushClip / add missing clipBehaviour

* Fix test now that clipping works correctly

* move overflow handling for tests into DOMClip.addOverflow

* Add clipRect to test to keep render inside bitmap canvas area

* Update compositing test, fix drawColor coordinates

* update golden locks

* Skip test for matchGolden infra fail

* update golden lock

* merge

* update maxdiff for text over canvas

* update golden diff

* update paint spread bounds maxdiff

* update paint spread maxDiff

* Fix native constructor of list of zircon handles and remove unused list factory specializations. (#21980)

* Roll Fuchsia Mac SDK from MR_bRfe8I... to pZ9FgVZTK... (#21982)

* [web] Implement sweep gradient (#21873)

* [web] Fix image gap due to svg element without position attribute (#21939)

* Roll Skia from 27f7fe32f49b to ac1ded033136 (15 revisions) (#21984)

* [null-safety] fix Scene.toImage declaration (#21983)

* Revert "[web] Fix image gap due to svg element without position attribute (#21939)" (#21986)

This reverts commit 79879802e05edb2f8fb871428609f3db5a549273.

* Enable lazy-async-stacks by-default in all modes (Take 4) (#21802)

* Fix linking issue (missing wayland-client library) (#21408)

As fl_renderer_wayland.cc uses directly some of the wayland-client
related functions it should also add this library as a dependency.

* Roll Fuchsia Linux SDK from dcMRY8S12... to lPMs_KwnU... (#21988)

* Roll Skia from ac1ded033136 to a25c0619b5ef (2 revisions) (#21989)

* Roll Skia from a25c0619b5ef to 4964300530d3 (2 revisions) (#21990)

* Roll Skia from 4964300530d3 to 51dc28505fb9 (5 revisions) (#21993)

* Roll Dart SDK from 902538ea56d5 to fc82eeed7df3 (1 revision) (#21981)

* [null-safety] fix soundness of Paragraph._addPlaceholder (#21994)

* Reland: Use dispatchKeyEventPreIme, and handle keys sent to InputConnection.sendKeyEvent on Android (#21979)

This re-lands #21163, which was reverted in #21513

Now that flutter/flutter#67359 has landed, this change will no longer cause spaces (and other shortcuts) to be ignored in text fields if there is no action associated with the intent, even if there is a shortcut key mapping to an intent.

Here's the original PR description:

This switches from using dispatchKeyEvent to using dispatchKeyEventPreIme so that keys can be intercepted before they reach the IME and be handled by the framework.

It also now intercepts key events sent to InputConnection.sendKeyEvent, as some IMEs do (e.g. the Hacker's Keyboard), and sends the to Flutter before sending them to the IME (which it now only does if they are not handled by the framework).

This fixes the problem where pressing TAB on a hardware keyboard sends the tab to both the text field and to the focus traversal system.

Note that we still can't intercept all keystrokes given to a soft keyboard, only those which the soft keyboard decides to send to InputConnection.sendKeyEvent.

* [iOS] Fixes leaks of presses key message (#21987)

Related PR: #20972

* Roll Skia from 51dc28505fb9 to 1c823674d957 (8 revisions) (#21995)

* Revert "Reland: Use dispatchKeyEventPreIme, and handle keys sent to InputConnection.sendKeyEvent on Android (#21979)" (#22004)

This reverts commit 3cd70f2cfb21baf30cc62de29d311118aa757c60 because it causes some failures in web tests.

* Roll Dart SDK from fc82eeed7df3 to 8be6a08153cc (1 revision) (#22002)

https://dart.googlesource.com/sdk.git/+log/fc82eeed7df3..8be6a08153cc

2020-10-20 [email protected] Version 2.11.0-238.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

* Roll Dart SDK from fc82eeed7df3 to 8be6a08153cc (1 revision) (#22005)

* [fuchsia] opt-out null-safety in standalone scripts (#22009)

* [fuchsia] zx::vmar::map migration (#22003)

The new map() method receives its arguments in the same order as the
underlying C system call. This patch should not change any behavior.

* Revert "Define SK_VULKAN for clang-tidy runs (#21927)" (#22012)

This breaks linting on other targets that include skia headers that do
ifdef checks on SK_VULKAN.

This reverts commit 25d8fa5a79cb0228e639601822598ada49695ff6.

* Determine null-safety isolate flags for launches of the service isolate. (#22013)

* Roll Skia from 1c823674d957 to 2d2f82c00aeb (13 revisions) (#22015)

https://skia.googlesource.com/skia.git/+log/1c823674d957..2d2f82c00aeb

2020-10-20 [email protected] Always declare sk_FragColor in GLSL, even if unused
2020-10-20 [email protected] added SkSLNodeArrayWrapper
2020-10-20 [email protected] update dox for drawPaint
2020-10-20 [email protected] Wrap built-in symbol tables during inlining.
2020-10-20 [email protected] Wrap built-in symbol tables when an IRNode is cloned.
2020-10-20 [email protected] Fix typo in class name.
2020-10-20 [email protected] Make GrFillRectOp::onPrePrepareDraws also call base class' version
2020-10-20 [email protected] Reland "Remove GrContext"
2020-10-20 [email protected] Rename some of GrThreadSafeCache's member variables
2020-10-20 [email protected] [fuchsia] Migrate to new zx::vmar::map method
2020-10-20 [email protected] upstream cl/337571894 with tweaks
2020-10-20 [email protected] Pull the triangulating path renderer's shape-space triangulation into a helper method
2020-10-20 [email protected] [svg] Parse text attributes

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

* Roll Dart SDK from 8be6a08153cc to 86242db30c23 (2 revisions) (#22018)

* Roll Dart SDK from 86242db30c23 to 874709e52a99 (1 revision) (#22023)

* Roll Dart SDK from 874709e52a99 to a3d902d8598e (1 revision) (#22026)

https://dart.googlesource.com/sdk.git/+log/874709e52a99..a3d902d8598e

2020-10-21 [email protected] Version 2.11.0-242.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

* Run framework tests in sound null safety mode (#22038)

* Plumb through Dart entrypoint arguments on the Linux embedder (#21933)

* Ensure root isolate create callback is invoked before the isolate is in the running phase. (#22041)

Embedders that have access to the Dart native API (only Fuchsia now) may perform
library setup in the isolate create callback. The engine used to depend on the
fact the root isolate entrypoint is invoked in the next iteration of message
loop (via the `_startIsolate` trampoline in `isolate_patch.dart`) to ensure that
library setup occur before the main entrypoint was invoked. However, due to
differences in the way in which message loops are setup in Fuchsia, this
entrypoint was run before the callback could be executed. Dart code on Fuchsia
also has the ability to access the underlying event loops directly. This patch
moves the invocation of the create callback to before user dart code has a
chance to run. This difference in behavior on Fuchsia became an issue when the
isolate initialization was reworked in https://github.com/flutter/engine/pull/21820
for null-safety.

Another issue was discovered in that the callback was being invoked twice, I
fixed that too and added a test.

Fixes https://github.com/flutter/flutter/issues/68732

* Isolates launched by the engine instance use the settings of that instance. (#22052)

This regression was introduced in https://github.com/flutter/engine/pull/21820
for sound-null safety. The settings used to launch the VM were incorrectly used
to determine the isolate lifecycle callbacks. Since the first shell/engine in
the process also starts the VM, these objects are usually identical. However,
for subsequent engine shell/engine launches, the callbacks attached to the new
settings object would be ignored. The unit-test harness is also structured in
such a way that each test case tears down the VM before the next. So all
existing tests created a bespoke VM for the test run, and, the tests that did
create multiple isolates did not also test attaching callbacks to the settings
object.

Fixes https://github.com/flutter/engine/pull/22041

* Roll Skia from 2d2f82c00aeb to 5c7bb326a7b3 (33 revisions) (#22059)

https://skia.googlesource.com/skia.git/+log/2d2f82c00aeb..5c7bb326a7b3

2020-10-22 [email protected] Reland "Create a basic IRNode pooling system."
2020-10-22 [email protected] Revert "Reland "Create a basic IRNode pooling system.""
2020-10-22 [email protected] Revert "Add pooling support on iOS."
2020-10-22 [email protected] Add much better SkTHashMap visualization to Skia.natvis
2020-10-22 [email protected] [fuzz] Copy crashing outputs before failing
2020-10-22 [email protected] Add pooling support on iOS.
2020-10-22 [email protected] Fix storage class issues for push constant variables.
2020-10-22 [email protected] Roll SwiftShader from 84f5eeb6dd9b to e02d8938821a (3 revisions)
2020-10-22 [email protected] Roll Chromium from 4bdce889ea35 to 502ec4ce30b3 (465 revisions)
2020-10-22 [email protected] Roll ANGLE from e2147a58a233 to d74754378f09 (16 revisions)
2020-10-22 [email protected] Roll Dawn from cca03ca6bfe9 to 22505a5afe1f (9 revisions)
2020-10-22 [email protected] Reland "Create a basic IRNode pooling system."
2020-10-21 [email protected] [svg] Add support for preserveAspectRatio
2020-10-21 [email protected] Pop the symbol table if compilation fails.
2020-10-21 [email protected] [canvaskit] Load resources into wasm gms/unit tests.
2020-10-21 [email protected] In Vk don't set dynamic blend constant on Pipeline if we don't use it.
2020-10-21 [email protected] [svg] Add gradientUnits attribute, value, and parsing
2020-10-21 [email protected] Underline decorations with gaps and no text
2020-10-21 [email protected] Reland "Perform bounding rect-relative calcs in full float in GrRRectBlurEffect"
2020-10-21 [email protected] Add several more visualizations to Skia.natvis
2020-10-21 [email protected] Make small epsilons more rigorous for gpu gaussian blurs
2020-10-21 [email protected] Revert "Create a basic IRNode pooling system."
2020-10-21 [email protected] Revert "Perform bounding rect-relative calcs in full float in GrRRectBlurEffect"
2020-10-21 [email protected] Migrate additional FPs to `return` instead of `sk_OutColor`.
2020-10-21 [email protected] Wrap built-in symbol tables when a switch statement is cloned.
2020-10-21 [email protected] Perform bounding rect-relative calcs in full float in GrRRectBlurEffect
2020-10-21 [email protected] Create a basic IRNode pooling system.
2020-10-21 [email protected] Increase encapsulation of GrThreadSafeCache::Entry
2020-10-21 [email protected] [canvaskit] Fix gm test runner on non-tryjobs
2020-10-21 [email protected] Roll SwiftShader from df17a76102df to 84f5eeb6dd9b (3 revisions)
2020-10-21 [email protected] Roll ANGLE from 2be35682cd67 to e2147a58a233 (40 revisions)
2020-10-21 [email protected] Roll Chromium from 60b90a0bfd24 to 4bdce889ea35 (441 revisions)
2020-10-21 [email protected] Roll Dawn from c4593127cbdd to cca03ca6bfe9 (7 revisions)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

* Roll Fuchsia Linux SDK from lPMs_KwnU... to gqS_DIjN4... (#22057)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-linux-sdk-flutter-engine
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

* Roll Fuchsia Mac SDK from pZ9FgVZTK... to WLxBkBnZa... (#22055)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-mac-sdk-flutter-engine
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Co-authored-by: Jason Simmons <[email protected]>
Co-authored-by: Kaushik Iska <[email protected]>
Co-authored-by: Emmanuel Garcia <[email protected]>
Co-authored-by: skia-flutter-autoroll <[email protected]>
Co-authored-by: Mouad Debbar <[email protected]>
Co-authored-by: Pieter van Loon <[email protected]>
Co-authored-by: Chinmay Garde <[email protected]>
Co-authored-by: Chris Bracken <[email protected]>
Co-authored-by: Dan Field <[email protected]>
Co-authored-by: Jonah Williams <[email protected]>
Co-authored-by: nturgut <[email protected]>
Co-authored-by: Hamdi Kahloun <[email protected]>
Co-authored-by: Dan Field <[email protected]>
Co-authored-by: J-P Nurmi <[email protected]>
Co-authored-by: Ferhat <[email protected]>
Co-authored-by: George Wright <[email protected]>
Co-authored-by: Greg Spencer <[email protected]>
Co-authored-by: Alexander Markov <[email protected]>
Co-authored-by: gaaclarke <[email protected]>
Co-authored-by: LongCatIsLooong <[email protected]>
Co-authored-by: Zachary Anderson <[email protected]>
Co-authored-by: Yuqian Li <[email protected]>
Co-authored-by: Damian Wrobel <[email protected]>
Co-authored-by: Felipe Archondo <[email protected]>
Co-authored-by: egdaniel <[email protected]>
Co-authored-by: Robert Ancell <[email protected]>
Co-authored-by: stuartmorgan <[email protected]>
Co-authored-by: Jenn Magder <[email protected]>
Co-authored-by: Adlai Holler <[email protected]>
Co-authored-by: Harry Terkelsen <[email protected]>
Co-authored-by: Mehmet Fidanboylu <[email protected]>
Co-authored-by: Ren You <[email protected]>
Co-authored-by: godofredoc <[email protected]>
Co-authored-by: puelo <[email protected]>
Co-authored-by: Clement Skau <[email protected]>
Co-authored-by: Wu Zhong <[email protected]>
Co-authored-by: Chase Latta <[email protected]>
Co-authored-by: Adam Barth <[email protected]>
Co-authored-by: Michael Goderbauer <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes perf: speed Performance issues related to (mostly rendering) speed severe: performance Relates to speed or footprint issues.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants