Reverts flutter/engine#45029
It appears this is causing a regression in the length of time some of our integration tests are taking, causing them to take twice as long, which is causing timeouts in CI. We should revert while we investigate.
This flag removes some code from CanvasKit to reduce size by a little bit. I went ahead and did a run of the benchmarks (https://github.com/flutter/flutter/pull/133208) to see if it negatively affected anything, and there was no difference beyond noise between the current benchmark numbers and the benchmarks with this flag enabled.
The size differences are as follows:
Before the change:
```
total 30616
drwxr-xr-x 11 jacksongardner primarygroup 352 Aug 23 14:33 .
drwxr-xr-x 7 jacksongardner primarygroup 224 Aug 10 18:14 ..
-rw-r--r--@ 1 jacksongardner primarygroup 6148 May 12 17:41 .DS_Store
-rw-r--r-- 2 jacksongardner primarygroup 94899 Aug 23 14:23 canvaskit.js
-rwxr-xr-x 2 jacksongardner primarygroup 6631693 Aug 23 14:23 canvaskit.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 2102151 Aug 23 14:23 canvaskit.wasm.br
drwxr-xr-x 5 jacksongardner primarygroup 160 Aug 23 14:33 chromium
-rw-r--r-- 2 jacksongardner primarygroup 161478 Aug 23 14:28 skwasm.js
-rwxr-xr-x 2 jacksongardner primarygroup 3296038 Aug 23 14:28 skwasm.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 1101502 Aug 23 14:28 skwasm.wasm.br
-rw-r--r-- 2 jacksongardner primarygroup 3095 Aug 23 14:28 skwasm.worker.js
./chromium:
total 15520
drwxr-xr-x 5 jacksongardner primarygroup 160 Aug 23 14:33 .
drwxr-xr-x 11 jacksongardner primarygroup 352 Aug 23 14:33 ..
-rw-r--r-- 2 jacksongardner primarygroup 94545 Aug 23 14:25 canvaskit.js
-rwxr-xr-x 2 jacksongardner primarygroup 5223378 Aug 23 14:25 canvaskit.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 1492433 Aug 23 14:25 canvaskit.wasm.br
```
After the change:
```
total 28568
drwxr-xr-x 11 jacksongardner primarygroup 352 Aug 23 14:42 .
drwxr-xr-x 7 jacksongardner primarygroup 224 Aug 10 18:14 ..
-rw-r--r--@ 1 jacksongardner primarygroup 6148 May 12 17:41 .DS_Store
-rw-r--r-- 2 jacksongardner primarygroup 94899 Aug 23 14:37 canvaskit.js
-rwxr-xr-x 2 jacksongardner primarygroup 6401703 Aug 23 14:37 canvaskit.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 2038390 Aug 23 14:37 canvaskit.wasm.br
drwxr-xr-x 5 jacksongardner primarygroup 160 Aug 23 14:42 chromium
-rw-r--r-- 2 jacksongardner primarygroup 161478 Aug 23 14:41 skwasm.js
-rwxr-xr-x 2 jacksongardner primarygroup 3143431 Aug 23 14:41 skwasm.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 1050854 Aug 23 14:41 skwasm.wasm.br
-rw-r--r-- 2 jacksongardner primarygroup 3095 Aug 23 14:41 skwasm.worker.js
./chromium:
total 15392
drwxr-xr-x 5 jacksongardner primarygroup 160 Aug 23 14:42 .
drwxr-xr-x 11 jacksongardner primarygroup 352 Aug 23 14:42 ..
-rw-r--r-- 2 jacksongardner primarygroup 94545 Aug 23 14:39 canvaskit.js
-rwxr-xr-x 2 jacksongardner primarygroup 4993586 Aug 23 14:39 canvaskit.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 1427979 Aug 23 14:39 canvaskit.wasm.br
```
The brotli-compressed wasm modules save about 50-70kb each with this flag.
The metal backend is the only backend that doesn't treat binding the vertex buffer specially. For the GLES and Vulkan backend, we can instead pull it out of the cmd map entirely.
This will make it easier to partially inline the map into the bindings object.
https://github.com/flutter/flutter/issues/133199
â¦r creation. (#44837)"
This reverts commit 539e3833d2a2b9d89ba813c97f2951c07fc84275.
*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*
*List which issues are fixed by this PR. You must list at least one issue.*
These trace events aren't super useful, since we've tracked down the issues as either 1) phone is overloaded due to image decoding at large size or 2) https://github.com/flutter/flutter/issues/133198
Weekend project! Press `C` to capture in the Aiks playground.
Decided to finally give this a go and attempt to relieve some of the print debugging/mindfuck around investigation of coverage-related issues lately. :)
Captures:
* Capture documents from anywhere in Impeller.
* Easily implement inspectors for those documents.
* Replay documents with live editing.
* No overhead when capturing is build time disabled (that's the idea, anyway).
* Low overhead when capturing is runtime disabled.
Aiks inspector:
* Outline passes and rendered entities.
* Identify collapsed passes.
* Visibly highlight coverage.
* Live edit scene properties.
Possible future work:
* Filters!
* Blend mode property.
* Pointer + release proc property.
* Support captures in the DL playground.
* Text atlas visualization.
* Multi-frame capture and scrubbing.
* Menus instead of key bindings?
https://github.com/flutter/engine/assets/919017/a7a63e24-f72f-4140-a21e-6ca02a05fc20
In the change here b653a2823f, an intentional ABI breaking change was introduced to the clang runtime library for macOS and iOS. That change caused a symbol requiring dynamic linkage to be exposed that triggers iOS App Store checks for usage of private API.
This PR resolves that issue by rolling clang forward and introducing a definition of `_availability_version_check`. The declaration with weak linkage in the clang runtime library [here](b653a2823f/compiler-rt/lib/builtins/os_version_check.c (L89)) will then be resolved against the definition introduced in this PR. Since the declaration in the clang runtime library will now be resolved by static linking, the Flutter dylib will no longer require it to be dynamically linked, and will therefore not trigger the App Store check for using private API.
The definition of `_availability_version_check` is implemented using the `dlsym` strategy used by the old version of clang [here](f9ac557567/compiler-rt/lib/builtins/os_version_check.c (L97)).
Fixes https://github.com/flutter/flutter/issues/132130
Follow up from https://github.com/flutter/engine/pull/44990
We're spending a ton of time deallocating mostly empty maps, by reducing the number of maps we reduce the amount of memory used, and reduce map lookups.
Set gradle to treat warnings as errors and suppress or fix all warnings in engine android tests.
Fixes flutter/flutter/133070
After doing this work I was disappointed to realized that the only lint turned on was deprecration but this is still a step in the right direction.
- Remove usages of deprecated junit.framework and replace with org.junit in KeyboardManagerTest, PlatformViewsControllerTest and SinglePresentationViewTest
- Annotate deprecated usages of Registrar
- Suppress warnings for getSystemWindowInsets and ensure roboletric config consistant with targetApi lint annotation, bump itDescribesTextFieldsWithTextAndHint to 28 because test actually fails on api 26
- Suppress warnings for DartExecutor.send
- Suppress warnings for ClipboardManager.set/hasText
- Suppress warnings for getWindowSystemUiVisibility, setMessageHandler, DartExecutor.send, InputMethodSubtype, and proof of concept migration from Roboletric.setupActivity
- Suppress deprecation warnings, set minsdk on tests that were checking for sdk version
- Suppress deprecation warnings in SpellCheckPluginTest
- Suppress deprecation warnings in MouseCursorPluginTest, set minsdk config to match target api
- Stop calling RuntimeEnvrionment.application and insted a call ApplicationProvider.getApplicationContext() in SingleViewPresentationTest
- Start calling FlutterView(Context, FlutterSurfaceView)
- Suppress deprecation warnings in PlatformPluginTest, getText, Robolectric.setup/buildActivity, system ui flags
- Suppress deprecation warnings in PlayStoreDeferredComponentManagerTest
- Suppress deprecation warnings in KeyboardChannelTest
- Suppress deprecation warnings in SettingsChannelTest
- Suppress deprecation warnings in ApplicationInfoLoaderTest
- Stop calling RuntimeEnvrionment.application and insted a call ApplicationProvider.getApplicationContext() in FlutterEngineGroupCacheTest
- Suppress deprecation warnings in FlutterAndroidComponentTest
- Suppress deprecation warnings in FlutterFragmentTest, more robolectric setup activity calls
- Suppress deprecation warnings in FlutterActivityAndFragmentDelegateTest
- Shadow.directlyOn is incompatible with java 17+, refactor to use reflectors and direct following https://github.com/robolectric/robolectric/pull/6598/files as an example Unsure if SplashShadowResources is used anywhere
- Enable warnings as errors
- Formatting
The expected color values appear to match the output of Skia's raster
backend's blur. Historically, that doesn't support any tile mode other
than decal, so while the `makeBlur()` function defaulted to clamp
tiling, the output was decal and thus showed the blur fading to
transparent.
The test draws a 1x1 green rectangle in the center of a 3x3 image. Clamp
tiling would actually cause the output of the blur to just copy the
central green color to the remaining 8 pixels. This is the output of
Skia's GPU blur. I am working to land changes in Skia that make the
raster backend handle all tile modes, which then has it match the
existing GPU blur's behavior of a constant output for clamp tiling in
this test (so it then fails).
Decal tiling appears to be more useful for this test case anyways
because it creates per-pixel variations that can be validated against.
This is needed to land Skia-side fixes for skbug.com/40039877 and
skbug.com/40039025
## 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 `///`).
- [x] 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
Simplify command encoding and reduce binding size by placing all texture/sampler data in a single map instead of 3. We don't currently (nor do we plan to) support separate textures and samplers.
The vulkan backend is particularly bad, because there are 3 map lookups to pull all of the texture and sampler data out of the bindings.
Also see [go/impeller-vulkan-cmd-recording-performance](http://goto.google.com/impeller-vulkan-cmd-recording-performance)
Resolves https://github.com/flutter/flutter/issues/132516.
Add `impeller::HostBuffer` wrapper to Flutter GPU.
* Allows for lazy batch uploads of sparse host data to the GPU.
* Handles platform alignment requirements.
* API returns buffer view handles that will be fed to commands.