148 Commits

Author SHA1 Message Date
liyuqian
7bffe3c0a8 SkSL precompile (flutter/engine#12412)
For https://github.com/flutter/flutter/issues/40686

Unit tests added:
- CacheSkSLWorks
- VisitFilesCanBeCalledTwice
- CanListFilesRecursively
2019-10-08 11:51:28 -07:00
liyuqian
ffca51fcdd Reland "Smooth out iOS irregular input events delivery (#12280)" (flutter/engine#12385)
This reverts commit 56bb40c0179628e37ba3614534552441642c0492.

Additionally, we fix https://github.com/flutter/flutter/issues/40863 by adding a secondary VSYNC callback.

Unit tests are updated to provide VSYNC mocking and check the fix of https://github.com/flutter/flutter/issues/40863.

The root cause of having https://github.com/flutter/flutter/issues/40863 is the false assumption that each input event must trigger a new frame. That was true in the framework PR https://github.com/flutter/flutter/pull/36616 because the input events there are all scrolling move events. When the PR was ported to the engine, we can no longer distinguish different types of events, and tap events may no longer trigger a new frame.

Therefore, this PR directly hooks into the `VsyncWaiter` and uses its (newly added) secondary callback to dispatch the pending input event.
2019-09-30 11:25:50 -07:00
Jonah Williams
c341326d6a Add support for JIT release mode (flutter/engine#12446) 2019-09-27 11:20:54 -07:00
chunhtai
051ed653cc Add system font change listener for windows (flutter/engine#12276)
* Add windows font change logic

* update

* fix comment
2019-09-23 13:23:46 -07:00
liyuqian
56bb40c017 Revert "Reland "Smooth out iOS irregular input events delivery (#11817)" (#12280)" (flutter/engine#12364)
This reverts commit dedf24e797d6257f9bb776cdf0d7525a16610321.

Reason: flutter/flutter#40863

TBR: chinmaygarde, iskakaushik
2019-09-19 19:39:36 -07:00
liyuqian
8bb2b639df Add "type" to getDisplayRefreshRate protocol (flutter/engine#12319)
Per kenzieschmoll's request.

Will update https://github.com/flutter/flutter/wiki/Engine-specific-Service-Protocol-extensions once this is merged.
2019-09-17 11:35:01 -07:00
gaaclarke
68c0c11bad Made flutter startup faster by allowing initialization to be parallelized (flutter/engine#10182)
Made flutter startup faster by allowing initialization to be parallelized.  This resulting in a 15% decrease in startup time (~0.05ms)
2019-09-16 15:04:51 -07:00
liyuqian
dedf24e797 Reland "Smooth out iOS irregular input events delivery (#11817)" (flutter/engine#12280)
Additionally, we now use the engine directly as a delegate instead of storing potentially dead runtime_controller.

Unit tests have been updated to include an engine restart check which would fail before the fix.

This fixes https://github.com/flutter/flutter/issues/40303
2019-09-16 10:42:44 -07:00
Michael Klimushyn
862f40c774 Revert "Smooth out iOS irregular input events delivery (#11817)" (flutter/engine#12251)
This reverts commit 6b742994a371f5edded8925708d101186c950ada.
2019-09-12 11:23:05 -07:00
liyuqian
6b742994a3 Smooth out iOS irregular input events delivery (flutter/engine#11817)
Fixes https://github.com/flutter/flutter/issues/31086

This patch is a lower level implementation of
https://github.com/flutter/flutter/pull/36616 that would only impact iOS
engine, and host unittests.
2019-09-10 11:18:01 -07:00
Dan Field
db921356f8 Return a JSON value for the Skia channel (flutter/engine#11717) 2019-08-29 14:03:55 -07:00
Dan Field
114337a53c Make Skia cache size channel respond with a value (flutter/engine#11550) 2019-08-27 17:52:35 -07:00
liyuqian
f8f285edcc Support non-60 refresh rate on PerformanceOverlay (flutter/engine#11419)
So we can get the correct graph on 90fps/120fps devices :)

See https://github.com/flutter/flutter/issues/37888
2019-08-24 15:22:52 -07:00
Dan Field
06e7030b0f Reland Skia Caching improvements (flutter/engine#10434) 2019-08-02 19:31:57 -07:00
Dan Field
cd18c5ef0b Remove get engine (flutter/engine#9747) 2019-07-30 17:11:04 -07:00
gaaclarke
fd3dac0f58 Made Picture::toImage happen on the IO thread with no need for an onscreen surface. (flutter/engine#9813)
Made Picture::toImage happen on the IO thread with no need for a surface.
2019-07-15 17:16:20 -07:00
gaaclarke
6acae05b3c Synchronize main thread and gpu thread for first render frame (flutter/engine#9506)
Got rid of the black frame by synchronizing the main thread with the
gpu thread to make sure a frame is rendered before presenting the
view.
2019-07-10 13:14:07 -07:00
Chinmay Garde
3d231d854c Use libc++ variant of string view and remove the FML variant. (flutter/engine#9737) 2019-07-10 12:11:39 -07:00
Dan Field
792d6a27f8 Revert "Improve caching limits for Skia (#9503)" (flutter/engine#9740)
This reverts commit d075f5f97f97b339783e7915f92165aedcad5ed6.
2019-07-10 12:09:42 -07:00
Dan Field
d075f5f97f Improve caching limits for Skia (flutter/engine#9503) 2019-06-26 16:21:46 -07:00
Dan Field
9b08763a75 Purge caches on low memory on iOS (flutter/engine#9491) 2019-06-25 20:47:55 -07:00
liyuqian
8bd7715e9c Send timings of the first frame without batching (flutter/engine#9424)
For https://github.com/flutter/flutter/issues/34867

Test added:
* ReportTimingsIsCalledImmediatelyAfterTheFirstFrame
2019-06-24 12:40:38 -07:00
liyuqian
7606eb25fb Generate weak pointers only in the platform thread (flutter/engine#9431) 2019-06-24 10:33:34 -07:00
Zachary Anderson
35107c4dca Revert tracing changes (flutter/engine#9296)
* Revert "[fuchsia] Fix alignment of Fuchsia/non-Fuchsia tracing (#9289)"

This reverts commit e7d406fe36790b1a8161d4687a6a4a144ba44254.

* Revert "Align fuchsia and non-fuchsia tracing (#9199)"

This reverts commit 1ccb372e5f8ceaaf90f5b43b42df617d7f18d955.
2019-06-12 10:25:49 -07:00
liyuqian
fe0db192d9 Report timings faster (100ms) in profile/debug (flutter/engine#9287)
This should satisfy the low-latency need of DevTools.

Test added:
* ReportTimingsIsCalledSoonerInNonReleaseMode
* ReportTimingsIsCalledLaterInReleaseMode
2019-06-11 16:51:20 -07:00
liyuqian
fb0ea0ef4c Add onReportTimings and FrameRasterizedCallback API (flutter/engine#8983)
Using it, a Flutter app can monitor missing frames in the release mode, and a custom Flutter runner (e.g., Fuchsia) can add a custom FrameRasterizedCallback.

Related issues:
https://github.com/flutter/flutter/issues/26154
https://github.com/flutter/flutter/issues/31444
https://github.com/flutter/flutter/issues/32447

Need review as soon as possible so we can merge this before the end of May to catch the milestone.

Tests added:
* NoNeedToReportTimingsByDefault
* NeedsReportTimingsIsSetWithCallback
* ReportTimingsIsCalled
* FrameRasterizedCallbackIsCalled
* FrameTimingSetsAndGetsProperly
* onReportTimings preserves callback zone
* FrameTiming.toString has the correct format

This will need a manual engine roll as the TestWindow defined in the framework needs to implement onReportTimings.
2019-06-06 10:42:48 -07:00
Dan Field
1ccb372e5f Align fuchsia and non-fuchsia tracing (flutter/engine#9199) 2019-06-05 15:14:27 -07:00
Chris Bracken
21fd6fb32a Correct typos, adopt US spellings (flutter/engine#9081)
Corects a bnuch of typeos throughout teh engien codebsae. Also makes
a couple minor Commonwealth -> US spelling adjustments for consistency
with the rest of Flutter's codebase.

Made use of `misspell` tool:
https://github.com/client9/misspell
2019-05-25 13:14:46 -07:00
liyuqian
358e88cabf Revert "Only allow mappings for ICU initialization. (#8656)" (flutter/engine#8682)
This reverts commit dfaa1c9292238e73c56d36f7264adc63ea53745c.

Reverts flutter/engine#8656

Reason:  https://github.com/flutter/engine/pull/8656 seems to break the framework windows tests and the engine roll (see https://cirrus-ci.com/task/4704667236827136 and https://github.com/flutter/flutter/pull/31330). The failure has been consistent for 7 consecutive engine-to-framework auto-rolls.

TBR: @chinmaygarde
2019-04-22 10:28:54 -07:00
Chinmay Garde
dfaa1c9292 Only allow mappings for ICU initialization. (flutter/engine#8656)
If the mapping callback is not set or it the callback returns invalid data, ICU initialization will be embedder responsibility.

This affects all embedders and the following have been audited:
* Android: Via a symbol mapping.
* iOS: Via a file mapping.
* Embedder: Via a file mapping.
* Fuchsia: Via a VMO mapping
* Test shells and Flutter tester: Via file mapping with ICU data needing to be next to the executable.
2019-04-19 15:01:40 -07:00
liyuqian
27e4dac06b Rename flow namespace to flutter (flutter/engine#8615)
This follows our namespace change from shell to flutter: https://github.com/flutter/engine/pull/8520.
2019-04-17 14:38:45 -07:00
Chinmay Garde
72111314cb Remove redundant specification of the |flutter| namespace in the engine. (flutter/engine#8523) 2019-04-09 17:50:06 -07:00
Chinmay Garde
4dd267959f Rename the shell namespace to flutter. (flutter/engine#8520) 2019-04-09 17:10:46 -07:00
Chinmay Garde
1fd28a143a Rename the blink namespace to flutter. (flutter/engine#8517)
Some components in the Flutter engine were derived from the forked blink codebase. While the forked components have either been removed or rewritten, the use of the blink namespace has mostly (and inconsistently) remained. This renames the blink namesapce to flutter for consistency. There are no functional changes in this patch.
2019-04-09 12:44:42 -07:00
Chinmay Garde
736277e9c7 Revert "Revert "Separate the data required to bootstrap the VM into its own class. (#8397)" (#8406)" (flutter/engine#8414)
This reverts commit 8a0076fdddc96b4ec2fb67f45051aa490827fc02.
2019-04-03 13:38:12 -07:00
Zachary Anderson
8a0076fddd Revert "Separate the data required to bootstrap the VM into its own class. (#8397)" (flutter/engine#8406)
This reverts commit 38f5fc418a08ed43945ad21d19494d6b352e1443.
2019-04-02 09:12:56 -07:00
Chinmay Garde
38f5fc418a Separate the data required to bootstrap the VM into its own class. (flutter/engine#8397)
When attempting to shutdown and subsequently restart the VM, having the
VM own this data introduces lifecycle issues due to circular references.
2019-04-01 14:58:05 -07:00
Chinmay Garde
f3080acb10 Reset min log levels on each engine launch. (flutter/engine#8343) 2019-03-28 11:21:25 -07:00
Amir Hardon
c1c7b0a82d Merge only gpu and platform threads for platform views, fix deadlock. (flutter/engine#8045)
The reason we didn't merge just the gpu and platform threads from the get go was a deadlock in Shell:OnPlatformViewCreated and Shell:OnPlatformViewDestroyed.

The deadlock was caused by the platform thread starting a thread-hopping flow that ends ends up with the gpu thread releasing a latch that the platform thread is waiting on just after starting the cross-thread dance.
If the platform and gpu threads are the same, that last task that is posted to the gpu thread will never get executed as the gpu/platform thread is blocked on a latch.

This works around the deadlock by having a special case in the code for the scenario where the gpu and platform threads are the same.

Fixes: flutter/flutter#23974
2019-03-18 14:13:30 -07:00
liyuqian
c267787209 Add dump-shader-skp switch to help ShaderWarmUp (flutter/engine#8148)
Allow Flutter to automatically dump the skp that triggers new shader compilations. This is useful for writing custom ShaderWarmUp to reduce jank. By default, it's not enabled to reduce the overhead. This is only available in profile or debug build.

Later, we can add service protocol support to pull the skp from the client to the host. Currently, it works fine for Android-based devices (including our urgent internal clients) where we can `adb shell` into the cache directory.
2019-03-14 12:58:09 -07:00
Chinmay Garde
93fda103c5 Fix weak pointer use violations in shell and platform view. (flutter/engine#8046) 2019-03-05 15:21:06 -08:00
Mehmet Fidanboylu
191884bbc1 New setting to decide whether we want the engine to load ICU mapping. (flutter/engine#7928) 2019-02-22 14:49:15 -08:00
Dan Field
4206f443f7 Revert "Shut down and restart the Dart VM as needed. (#7832)" (flutter/engine#7877)
This reverts commit 75a66f31dc2a02ccb54f10fb4477233086f4906b.
2019-02-19 16:14:18 -08:00
Chinmay Garde
75a66f31dc Shut down and restart the Dart VM as needed. (flutter/engine#7832)
The shell was already designed to cleanly shut down the VM but it couldnt
earlier as |Dart_Initialize| could never be called after a |Dart_Cleanup|. This
meant that shutting down an engine instance could not shut down the VM to save
memory because newly created engines in the process after that point couldn't
restart the VM. There can only be one VM running in a process at a time.

This patch separate the previous DartVM object into one that references a
running instance of the DartVM and a set of immutable dependencies that
components can reference even as the VM is shutting down.

Unit tests have been added to assert that non-overlapping engine launches use
difference VM instances.
2019-02-15 14:16:17 -08:00
nathanrogersgoogle
7517ae90c3 Add flow events connecting pointer events to frames (flutter/engine#7807) 2019-02-13 22:27:12 -08:00
Jason Simmons
8a941d7b3c Embed ICU data inside libflutter.so on Android (flutter/engine#7588)
Prior to this the Android embedder code would extract the icudtl.dat asset out
of the APK and write it to local disk during the first startup of the app.

This change will make that work unnecessary and eliminate the risk of ICU
failures due to errors in the extraction process.
2019-01-30 11:56:17 -08:00
Dan Field
e53df3e546 Ensure the ResourceContext is not ripped out from under dart (flutter/engine#7528)
* Ensure the ResourceContext is not ripped out from under dart
2019-01-17 13:55:44 -08:00
Dan Field
a9728ab07a Make IOManager own resource context (flutter/engine#7272)
* Make IOManager own resource context
2019-01-14 13:46:38 -08:00
Jason Simmons
2e112a7904 Add a system message channel for controlling the Skia resource cache size (flutter/engine#7257)
See https://github.com/flutter/flutter/issues/25244
2018-12-19 17:40:16 -08:00
liyuqian
efc116e72c Support querying display refresh rate in engine (flutter/engine#7002)
The current implementation only deals with Android devices and we'll add iOS devices support soon.
2018-12-12 10:28:44 -08:00