4992 Commits

Author SHA1 Message Date
Robert Ancell
2ff5380c01 Change back to using the memory address of a texture as its ID. (flutter/engine#40899)
Change back to using the memory address of a texture as its ID.
2023-04-04 00:43:49 +00:00
Dan Field
668566b8fa [Impeller] Respect enable-impeller command line setting over info.plist setting (flutter/engine#40902)
[Impeller] Respect enable-impeller command line setting over info.plist setting
2023-04-04 00:34:58 +00:00
Jonah Williams
f82dc83970 Disable partial repaint on Android (flutter/engine#40898)
Disable partial repaint on Android
2023-04-03 23:36:58 +00:00
yaakovschectman
a3fec2cae5 Re-introduce WM_CLOSE listener, new quit protocol posts a second message to next handler (flutter/engine#40802)
With this approach, when the last window of an app is closed, the engine
sends a message to the framework to check if it is allowed to exit. If
it may, the windows lifecycle manager synthesizes a second `WM_CLOSE`
message that it will ignore, and so the next registered top level window
proc delegate, if any, will be able to process the message. If none do
so, the message will be handled by the default window proc, so the app
will be able to close.

I was not able to get a full system tray example application running to
test this, but I could get an application that stays open when its
window is closed and can be seen as a system tray icon as long as it is
running, albeit the icon was non-functional. As this repro app still
exhibited this behavior when using this engine build, I am reasonably
confident in concluding that applications that want to be able to run
headless when their windows close will function properly.

Addresses https://github.com/flutter/flutter/issues/123654.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or Hixie said the PR is test-exempt. See [testing the engine]
for instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I signed the [CLA].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat

---------

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>
2023-04-03 14:32:02 -04:00
Kingtous
bcaa44592e [Linux] fix: make textures thread-safe on linux (flutter/engine#40478)
Make textures GHashTable thread-safe
2023-04-03 11:30:04 +12:00
Zachary Anderson
284b13faae Revert "[macOS] Change view ID to signed" (flutter/engine#40829)
Reverts flutter/engine#39958

Failing the roll to the framework starting with
https://github.com/flutter/flutter/pull/123893

One example:
https://ci.chromium.org/ui/p/flutter/builders/try/Mac%20dart_plugin_registry_test/21819/overview
2023-03-31 13:52:57 -07:00
Tong Mu
d3bbe5cb8a [macOS] Change view ID to signed (flutter/engine#39958)
This PR makes view ID signed from unsigned int64.

Initially, I made view IDs unsigned because they were opaque anyway. As
I'm working deeper into multiview, I found some issues that made me
think signed is better:

* Unsigned integers are worse
  * Sometimes you want negative values to represent special values.
* Unsigned integers are dangerous (if compared with signed ones by
mistake.)
* Unsigned integers are not needed
  * We're very unlikely to reach that big anyway.
  * Almost all other languages support only signed integers.
  * Also JavaScript only supports up to 51 bits of integer.

Therefore I think it's better to change them to signed int64, especially
before these APIs are widely used by developers.

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I added new tests to check the change I am making or feature I am
adding, or Hixie said the PR is test-exempt. See [testing the engine]
for instructions on writing and running engine tests.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I signed the [CLA].
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2023-03-31 12:11:49 -07:00
Loïc Sharma
f4f8988c2a Complete the update semantics embedder API migration (flutter/engine#40773)
Complete the update semantics embedder API migration
2023-03-31 18:40:42 +00:00
Zachary Anderson
db6bf07686 Revert "[Impeller] Use Vulkan by default (#40809)" (flutter/engine#40820)
This reverts commit 35efb76a0606844593208ce0c6722aeb9c6b89cf.

Reverting for https://github.com/flutter/flutter/issues/123859
2023-03-31 08:05:36 -07:00
Dan Field
35efb76a06 [Impeller] Use Vulkan by default (flutter/engine#40809)
[Impeller] Use Vulkan by default
2023-03-31 05:05:56 +00:00
Kevin Lubick
f944e918a1 Use new SkImages namespace instead of legacy SkImage static functions (flutter/engine#40761)
Use new SkImages namespace instead of legacy SkImage static functions
2023-03-30 20:22:09 +00:00
Thomas Gales
7f5afc5533 [fuchsia] Feedback filing migration (flutter/engine#40736)
[fuchsia] Feedback filing migration
2023-03-30 20:09:50 +00:00
Chinmay Garde
8116ea14c7 [Impeller] Enable vulkan validations via a flag on Android. (flutter/engine#40792)
[Impeller] Enable vulkan validations via a flag on Android.
2023-03-30 20:07:51 +00:00
luckysmg
de2ccc20e3 Revert "[iOS] Send connectionClosed message when resignFirstResponder to ensure framework focus state is correct. (#40703)" (flutter/engine#40777)
Revert "[iOS] Send connectionClosed message when resignFirstResponder to ensure framework focus state is correct."
2023-03-30 08:11:57 +00:00
luckysmg
9b3ea55c61 [iOS] Send connectionClosed message when resignFirstResponder to ensure framework focus state is correct. (flutter/engine#40703)
[iOS] Send connectionClosed message when resignFirstResponder to ensure framework focus state is correct.
2023-03-30 05:30:17 +00:00
hangyu
f53c064783 [macOS]Support SemanticsService.announce (flutter/engine#40585)
[macOS]Support SemanticsService.announce
2023-03-30 01:37:05 +00:00
Reid Baker
48259c2b4d Supress warning for missing super call onBackPressed cl/516851539 (flutter/engine#40757)
Suppress warning for missing super call onBackPressed cl/516851539
2023-03-29 19:20:28 +00:00
Chris Bracken
0bb0c9686f Revert "Listen to WM_CLOSE message on Windows to allow framework to cancel exit (#40493)" (flutter/engine#40739)
This caused regressions for two internal customers.

Issue: https://github.com/flutter/flutter/issues/123654
Internal issue: b/275565297.

This reverts commit d7059df4ebe468913480f84d9d88832e89fc87d2.
2023-03-29 09:50:37 -07:00
Loïc Sharma
2686501928 [macOS] Use the new update semantics embedder API (flutter/engine#40584)
[macOS] Use the new update semantics embedder API
2023-03-28 20:18:50 +00:00
Chris Bracken
787ed3f63c [macOS] Eliminate explicit main window init() (flutter/engine#40695)
[macOS] Eliminate explicit main window init()
2023-03-28 01:31:20 +00:00
Brandon DeRosier
5b4b920911 [Impeller] Fix Impeller Metal wide gamut (flutter/engine#40671) 2023-03-27 13:26:34 -07:00
Filip Filmar
c68289bb76 Remove timezone from flutter (flutter/engine#40588)
Remove timezone from flutter
2023-03-27 17:08:05 +00:00
Chinmay Garde
753e03413a [Impeller] More sundry fixes to the Vulkan backend. (flutter/engine#40603)
* Fix mip-map generation in unit-tests where the command buffer was not
  submitted.
* Cleanup descriptor counts being always 1 in Vulkan code-gen.
* Reworked capabilities. Platforms can add to the base capability set.
* Vulkan backend picks between more available color and stencil formats.
* Descriptor pools are dynamically sized.
* Layout transitions are more explicit. Both allocated and swapchain images
  track their own layouts and redundant transitions are avoided.
* Objects active in a pending command buffer are collected but the waits happen
  on a separate fence waiter. Thread is named
  "io.flutter.impeller.fence_waiter".
* Added queue and command buffer instant markers for better traces.
* Command pools and their buffers are now thread local. Fixes sync validation
  failure.
* Debug reports are now more readable and command buffer and queue breadcrumbs
  will be displayed on a validation report.
* Staging buffers are back.
* Pipeline caches have been wired up. After 50 frames, the current Vulkan
  pipeline cache will be written out to disk for subsequent launches. Writes
  will happen on a background worker.
* Runtime stages have been wired up. But the build rules to provide the right
  stages are still remaining.

Fixes https://github.com/flutter/flutter/issues/121536
Fixes https://github.com/flutter/flutter/issues/121627
Fixes https://github.com/flutter/flutter/issues/121632
Fixes https://github.com/flutter/flutter/issues/120499
2023-03-25 13:40:19 -07:00
Dan Field
96773d7c04 Avoid implicit conversions to floats in dart:ui (flutter/engine#40098)
Avoid implicit conversions to floats in dart:ui
2023-03-24 21:36:41 +00:00
yaakovschectman
c5156e2370 Revert "Unregister the FlutterWindowsView on its destruction (#39824)" (flutter/engine#40607)
Revert "Unregister the FlutterWindowsView on its destruction"
2023-03-24 19:26:34 +00:00
Loïc Sharma
cbee4256c0 [Windows] Use the new update semantics embedder API (flutter/engine#40072)
[Windows] Use the new update semantics embedder API
2023-03-24 18:29:26 +00:00
yaakovschectman
d7059df4eb Listen to WM_CLOSE message on Windows to allow framework to cancel exit (flutter/engine#40493)
* Intercept WM_CLOSE

* Messy but framework is in place

* Test exit and cancel

* Try to test for windows

* Check for parent HWND

* Move string to PlatformHandler class

* Rename lifecycle manageR

* Change condition for headless

* Move window proc to lambda

* Formatting and licenses

* Encode JSON dart values

* Clean up lifecycle

* PR feedback

* Update shell/platform/windows/platform_handler.h

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Update shell/platform/windows/windows_lifecycle_manager.cc

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Update shell/platform/windows/windows_lifecycle_manager.cc

Co-authored-by: Chris Bracken <chris@bracken.jp>

* Static cast enum to int

* Formatting

* Update shell/platform/windows/testing/engine_modifier.h

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>

* Update shell/platform/windows/windows_lifecycle_manager.cc

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>

* Update shell/platform/windows/platform_handler.cc

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>

* Update unit tests

* PR Feedback

* PR Feedback

* Constexpr

* Formatting

* Wparam

---------

Co-authored-by: Chris Bracken <chris@bracken.jp>
Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>
2023-03-24 12:44:42 -04:00
Zachary Anderson
d9cec91611 Read the FLTEnableImpeller flag from the right bundle (flutter/engine#40535) 2023-03-22 15:42:26 -07:00
Loïc Sharma
3ab31ad593 [Embedder API] Introduce new update semantics callback (flutter/engine#39807)
[Embedder API] Introduce new update semantics callback
2023-03-22 00:07:21 +00:00
yaakovschectman
6e01d06951 Add Windows exit requests and responses (flutter/engine#40400)
* Communicate exit request

* Unit test exit message

* Comments

* Formatting

* Move exit code

* Formatting
2023-03-21 08:48:05 -04:00
Jim Graham
37317c5984 restructure DL sources into sub-directories and new file naming conventions (flutter/engine#40157)
restructure DL sources into sub-directories and new file naming conventions
2023-03-21 02:34:48 +00:00
Greg Spencer
28a810a5b2 Rename setters for lifecycle state (flutter/engine#40462)
Rename setters for lifecycle state
2023-03-20 21:16:21 +00:00
Alexander Aprelev
6a2019ca61 Roll dart to 01350005aab7a7bfe2dc98066cb7acc95a811f7a (flutter/engine#40455)
Roll dart to 01350005aab7a7bfe2dc98066cb7acc95a811f7a
2023-03-20 19:57:15 +00:00
Chris Yang
63569eee26 Revert "Revert "[ios_platform_view] MaskView pool to reuse maskViews." (#39608)" (flutter/engine#40456)
Reland "[ios_platform_view] MaskView pool to reuse maskViews" (#39608)"
2023-03-20 19:51:17 +00:00
Michael Goderbauer
9258a58a33 add final class modifiers to fix dart roll (flutter/engine#40434) 2023-03-20 10:10:55 -07:00
Jim Graham
f9918c006e Reland "Sequester all Skia<->DL interactions into the skia sub-module" (flutter/engine#40435)
Reland "Sequester all Skia<->DL interactions into the skia sub-module"
2023-03-19 22:59:17 +00:00
Chinmay Garde
5efbf9ae44 [Impeller] Remove work queues. (flutter/engine#40429)
[Impeller] Remove work queues.
2023-03-18 23:42:34 +00:00
Zachary Anderson
6abd95a53b Provisional iOS impeller flag flip (flutter/engine#40405) 2023-03-17 20:35:36 -07:00
Loïc Sharma
3e5a3fa15e [macOS] Remove a single accessibility root assumption (flutter/engine#40316)
[macOS] Remove a single accessibility root assumption
2023-03-17 20:53:39 +00:00
Chris Bracken
1404722d05 Add doc comment to Pipeline (flutter/engine#40388)
Add doc comment to Pipeline
2023-03-17 20:38:55 +00:00
Jason Simmons
7598fa32e5 Wrap the iOS platform message handler in an autorelease pool block (flutter/engine#40373)
Wrap the iOS platform message handler in an autorelease pool block
2023-03-17 19:15:47 +00:00
Zachary Anderson
d39891c432 Un-bitrot impeller_unittests; disable failing tests; disable non-metal backends (flutter/engine#40339) 2023-03-16 19:34:57 -07:00
Loïc Sharma
25727539bb [Windows] Fix crash if clipboard is set to null (flutter/engine#40238)
Currently, the framework allows setting the clipboard to `null`. [Platforms handle this case inconsistently](https://github.com/flutter/flutter/issues/121976#issuecomment-1464721716), and we will update the framework to disallow setting the clipboard's data to `null`.

In the meantime, this change makes the Windows embedder resilient to unexpected clipboard messages. If your clipboard data's text is unexpected, you will now get an error instead of crashing your app.

Part of https://github.com/flutter/flutter/issues/121976
2023-03-16 16:52:27 -07:00
Greg Spencer
0efa11abc1 Handle error more gracefully, add test for same (flutter/engine#40361)
Handle error more gracefully, add test for same
2023-03-16 21:38:47 +00:00
Robert Ancell
84c69f7df9 Fix incorrect usage of fl_method_error_response_new in documentation example (flutter/engine#40288) 2023-03-17 10:23:24 +13:00
Chris Bracken
753bf93b11 [macOS] Eliminate unnecessary dynamic declaration (flutter/engine#40327)
Since `view` is a property of `NSViewController`, it's unnecessary for
us to declare `@dynamic view` in `FlutterViewController`'s
implementation.
2023-03-16 13:19:42 -07:00
Jim Graham
eb3a75ef78 Revert "Reland "Sequester all Skia<->DL interactions into the skia sub-module" (#40319)" (flutter/engine#40357)
Revert "Reland "Sequester all Skia<->DL interactions into the skia sub-module""
2023-03-16 19:55:51 +00:00
yaakovschectman
c1df0b8413 Pass parameters by value to StreamHandlerError (flutter/engine#40311)
* Pass by value/rvalue

* Test pass by value

* Formatting

* Test nullptr

* Formatting
2023-03-16 14:00:30 -04:00
Michael Goderbauer
dcc4b1b535 Reland: Bump lower Dart SDK constraints to 3.0 (flutter/engine#40318)
* WIP

Bump to 3.0.0-0

* fix lints

* drop web_ui

* opt pointer_converter.dart out of dart 3

* Revert "drop web_ui"

This reverts commit b97a015d5cd0d7e0380a4231be4c31aad36671f1.
2023-03-16 08:07:39 -07:00
Chris Bracken
ec1d7bae5d [macOS,Windows] Use static casts where possible (flutter/engine#40334)
[macOS,Windows] Use static casts where possible
2023-03-16 01:25:08 +00:00