419 Commits

Author SHA1 Message Date
Lyle Dean
bcbd90ac89 Fix Memory Leak in MakeSkSurfaceFromBackingStore (flutter/engine#30735) 2022-01-24 07:55:11 -08:00
George Wright
c225edfb0a Remove extraneous release of the MTLTexture in EmbedderTestBackingstoreProducer (flutter/engine#30955) 2022-01-20 12:35:52 -08:00
Alexander Aprelev
b8a5513fbb Prefix dart:ffi import to prevent name conflicts. (flutter/engine#30950)
https://dart.googlesource.com/sdk/+/85a87ca7ae6c9f028a0cbf6d8de3563b9a19b8e7 introduced Size to dart:ffi which conflicts with the one from dart:ui. See https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8824501487884216129/+/u/build_host_debug/stdout .

This will unblock dart->engine roll with that change.
2022-01-20 10:19:27 -08:00
Matej Knopp
549e82fec6 Enable partial repaint for Android/OpenGL (flutter/engine#29591) 2022-01-20 18:22:18 +01:00
godofredoc
edb4651636 GN targets for generating release artifacts (flutter/engine#30679) 2022-01-05 12:10:02 -08:00
Chinmay Garde
bdd74b092a Make sure the GLFW example compiles. (flutter/engine#30442) 2021-12-21 12:29:09 -08:00
Jim Graham
46a8def326 Opacity peephole optimization (flutter/engine#29775) 2021-12-14 16:19:09 -08:00
Dan Field
b38b90c039 Revert "Fix eglPresentationTimeANDROID is no effective" (flutter/engine#30310)
* Revert "Fix eglPresentationTimeANDROID is no effective (#30182)"

This reverts commit 0d7ba05d3456807e7e24353fe911738952a02888.

* Revert "Use eglPresentationTimeANDROID to avoid bogging down the GPU (#29727)"

This reverts commit edb87942de0404a2802351c050a4f1b6de239bd7.
2021-12-13 20:02:20 -08:00
ColdPaleLight
299cf0138d Migrate sk_cf_obj to sk_cfp (flutter/engine#30029) 2021-12-02 13:29:01 -08:00
ColdPaleLight
742a3dc7d8 Remove the dart entry point args from the Settings struct (flutter/engine#29831) 2021-11-22 18:43:02 -08:00
Tong Mu
0a7630373d [Embedder Keyboard] Fix synthesized events causing crash (flutter/engine#29854) 2021-11-22 15:38:02 -08:00
Dan Field
edb87942de Use eglPresentationTimeANDROID to avoid bogging down the GPU (flutter/engine#29727)
Fixes flutter/flutter#93352

Improves Android benchmarks on both Pixel 4 and a lower end Android Go device for 99th percentile and average raster times.

This works by telling the system compositor what timestamp we intended to show this frame for. This way, if we end up with a frame that gets submitted right at the beginning of a vsync and then a second frame submitted on the same vsync, the compositor will only try to show the second frame on the screen and save the GPU some work.

Without this, a situation like that results in an "avalanche" of calls where the GPU is behind the CPU and keeps delaying CPU work until we finally stop submitting frames. This can be observed as a lengthy dequeuBuffer in a systrace enabled trace, as shown in the linked issue. This avalanche is often triggered by a frame that does a shader compile through a couple vsyncs and then is followed by a bunch of very fast frames that take less than a vsync to render - the first of those fast frames gets delivered before the end of the vsync that the slow frame ended in.

We cannot implement this ourselves because we don't know how long the swap buffers call will take on the system side, and if we try to guess we can very well get it wrong.

I've filed issues to look into adding this for Vulkan and Metal, although we should also first take traces there to make sure it's warranted.

See also: https://android-developers.googleblog.com/2020/04/high-refresh-rate-rendering-on-android.html
2021-11-19 09:29:51 -08:00
Tong Mu
5183c56533 [Embedder] Send key data through message channel (flutter/engine#29795)
This PR changes how embedder API's SendKeyData sends ui.KeyData to the framework. The packets are now sent over the existing platform messenger, reusing the entirety of its code path and functionalities while keeping the embedder API unchanged
2021-11-18 17:53:28 -08:00
Dan Field
0a6301d5ca Listen for display refresh changes and report them correctly (flutter/engine#29800)
This makes sure the frame timings recorder and vsync waiter implementations get
the correct refresh rate if or when it adjusts at runtime. This should be OK
because we'll only query the refresh rate when the display metrics actually
change, which is much less frequent than every frame. I experimented with an NDK
implementation in the previous patch, but that vastly restricts the API levels
we can support, and currently on API 30 and 31 it just calls Java methods
through JNI anyway.

I've refactored the way Display updates are reported so that AndroidDisplay can
just dynamically get the refresh rate correctly. These values are used by a
service protocol extension and by some Stopwatches on the CompositorContext.

See also #29765

Fixes flutter/flutter#93688
Fixes flutter/flutter#93698
2021-11-18 13:09:26 -08:00
Zachary Anderson
78d9e276e2 Fix some clang-tidy lints for Linux host_debug (flutter/engine#29734) 2021-11-18 13:08:01 -08:00
Zachary Anderson
03c0f7e453 Add 'explicit' to header files (flutter/engine#29741) 2021-11-17 12:49:16 -08:00
Brandon DeRosier
4136d0117f Enable Skia's Vulkan backend on all non-mobile platforms, and test SwiftShader Vulkan on all GL unittests platforms (flutter/engine#29520) 2021-11-16 15:27:25 -08:00
Chris Bracken
1e13b1171d Fix UB in semantics updates (flutter/engine#29621)
Several arrays pointers on semantics update objects were being passed as
the address of the 0th element; however, this is UB in the case where
the array length is 0.

We already test for this in embedder_a11y_unittests.cc and the
associated fixture:
78a2941957/shell/platform/embedder/fixtures/main.dart (L182-L184)

We didn't catch this since we don't currently run the embedder tests on
Windows.

Issue: flutter/flutter#93338
2021-11-09 13:03:56 -08:00
Dan Field
afdd0a3603 Re-enable A11yTreeIsConsistent with higher timeout (flutter/engine#29367) 2021-11-04 14:53:02 -07:00
Kaushik Iska
88b7384bee Fix FlutterPresentInfo struct_size doc string (flutter/engine#29524) 2021-11-04 09:18:31 -07:00
Kaushik Iska
6a3b2c0194 Ensure vsync callback completes before resetting the engine. (flutter/engine#29488)
Fixes: https://github.com/flutter/flutter/issues/92934
2021-11-02 15:38:42 -07:00
Matej Knopp
66a708c874 Enable partial repaint for iOS/Metal (flutter/engine#28801) 2021-11-02 07:20:01 -07:00
Kaushik Iska
cafef4382c Embedder VsyncWaiter must schedule a frame for the right time (flutter/engine#29408) 2021-11-01 10:34:41 -07:00
Tong Mu
79249cf134 [macOS] Reset keyboard states on engine restart (flutter/engine#29283)
With this PR, the state of the keyboard system will be reset when the engine is reset (typically during a hot restart.)
2021-10-27 17:03:41 -07:00
gaaclarke
bb884f3cd8 updated the docs for platform_message_callback (flutter/engine#29117) 2021-10-13 10:51:39 -07:00
Tong Mu
8ef081034c [Linux, Embedder] Add engine restart hooks (flutter/engine#28924)
* Restart

* Format

* Doc

* Test

* Format

* Revert keyboard
2021-09-29 10:46:43 -07:00
Jenn Magder
f9f6708037 Set MinimumOSVersion in iOS Info.plist based on buildroot setting (flutter/engine#28743) 2021-09-22 14:38:02 -07:00
Brandon DeRosier
7b6fa075a7 Flip on leak detector and suppress or fix remaining leak traces (flutter/engine#28625)
Patch/suppress the remaining leaks and flip on the leak detector to start catching new leaks in CI.
2021-09-16 12:58:56 -07:00
ColdPaleLight
4a74166097 Started providing the GPU sync switch to Rasterizer.DrawToSurface() (flutter/engine#28383)
Co-authored-by: Aaron Clarke <gaaclarke>
2021-09-01 11:37:22 -07:00
Chris Bracken
c291ec55d6 Eliminate unnecessary null check in fixture (flutter/engine#28281)
The type of `PlatformDispatcher.instance.locales` is `List<Locale>`,
which precludes either null list or a null value in the list, for that
matter.
2021-08-24 12:25:07 -07:00
Brandon DeRosier
54c9c08552 Fix flaky stack-use-after-scope in PushingMutlipleFramesSetsUpNewRecordingCanvasWith*CustomCompositor (flutter/engine#28266) 2021-08-23 23:26:58 -07:00
Matej Knopp
b48f5143ac Enable repeat for desktop embedder tests (flutter/engine#28253) 2021-08-23 09:07:02 -07:00
chunhtai
9761b7371a Issues/86577 reland (flutter/engine#28211) 2021-08-20 12:27:01 -07:00
Zachary Anderson
c4fb8a6051 Revert "Adds semantics tooltip support (#27893)" (flutter/engine#28207)
This reverts commit 366e66802a35abf55bcb649b9bf58921b174b59a.
2021-08-19 14:40:34 -07:00
chunhtai
366e66802a Adds semantics tooltip support (flutter/engine#27893) 2021-08-18 15:37:01 -07:00
Brandon DeRosier
d5eed6ce6e Fix some stack-use-after-scopes found by ASan (flutter/engine#28147)
Fixes for Embedder and RefCounted tests.
2021-08-17 15:23:36 -07:00
Tong Mu
b2924176cc [Keyboard] Send empty key events when no key data should (flutter/engine#27774)
The keyboard system on each platform now sends an empty key data instead of nothing if no key data should be sent.
2021-07-30 13:35:39 -07:00
Siva
ff9b2b6507 Uncomment terminate unit test (Dart side fix has rolled into the engine) (flutter/engine#27649) 2021-07-22 10:25:01 -07:00
Siva
3635ddb39f Comment out terminate unit test until fix lands in Dart. (flutter/engine#27625)
* Comment out terminate unit test until fix lands in Dart.

* Address review comments.
2021-07-21 12:24:16 -07:00
Tong Mu
1a71c70587 Update key mapping to the latest logical key values (flutter/engine#25883)
This PR updates the key mapping tables of every platform according to the change to keycode_gen.
2021-07-21 01:58:09 -07:00
Siva
002299df34 Add embedder unit test that reproduces https://github.com/dart-lang/sdk/issues/46275 (flutter/engine#27392)
* Add embedder unit test that reproduces the problem described in
https://github.com/dart-lang/sdk/issues/46275

* Address code review comments.
2021-07-20 11:14:54 -07:00
Matej Knopp
becc215ba8 Do not resolve external textures unless there is new frame available (flutter/engine#27508) 2021-07-19 12:51:02 -07:00
Matej Knopp
ffa8f3ad2e MacOS: Fix external texture not working in OpenGL mode (flutter/engine#27506) 2021-07-19 12:46:02 -07:00
Greg Spencer
185d8601c5 Hardware Keyboard: iOS (flutter/engine#25961)
Implement new keyboard event system for iOS.
2021-07-07 16:52:04 -07:00
Chinmay Garde
8867a5c405 Temporarily opt out of reduced shaders variants till roll issues are resolved. (flutter/engine#27048) 2021-06-29 15:11:02 -07:00
Chinmay Garde
7cfb375a5e Configure contexts to reduce shader variations. (flutter/engine#27016)
Context creation options for each backend were spread across multiple
translation units. This makes setting options common across all backends hard to
configure. I have moved the creation of such common options into a separate
translation unit.

Fixes https://github.com/flutter/flutter/issues/84213
2021-06-28 15:37:14 -07:00
Ben Hagen
e6966a545d Remove invalid texture error message (flutter/engine#26816)
This unifies the behaviour with other embedders.

Fixes flutter/flutter#84855
2021-06-24 13:08:37 -07:00
Dan Field
e6a9345f19 Remove outdated annotations from fixtures (flutter/engine#26828) 2021-06-19 10:09:02 -07:00
sagallea
5bf41ddae1 Add physical view insets to FlutterWindowMetricsEvent (flutter/engine#26442)
This is needed to propagate inset values through Flutter.

Bug: b/181683254
2021-06-03 14:37:05 -07:00
Tong Mu
00e9f108c1 Hardware Keyboard: Linux (GTK) (flutter/engine#23467)
Linux (GTK) changes for the Hardware Keyboard project.
2021-05-25 18:04:03 -07:00