This optimization avoids recording unnecessary render operations that will not affect the output and also eliminates the need for "draw detection" mechanisms like `DlOpSpy` and `CanvasSpy` by remembering if any non-transparent operations were included. The `DlOpSpy` unit tests were updated to check if the results from that object match the new `DisplayList::affects_transparent_surface()` method.
Fixes https://github.com/flutter/flutter/issues/125338
In addition, this change will unblock some other Issues:
- https://github.com/flutter/flutter/issues/125318
- https://github.com/flutter/flutter/issues/125403
Fixes https://github.com/flutter/flutter/issues/126510.
`GetMaxBasisLength()` includes the Z basis vector, which happens to not
be getting scaled down along with the X and Y for this reproduction
case. And so given the 2D nature of text and the intent of this scale
parameter, it's returning a value that's too large here.
Using ansi colors in LUCI results in output that looks like:
```
00:00 [32m+0[0m: [1m[90mloading flutter_tester_emulation_golden_test.dart[0m[0m
00:01 [32m+0[0m: [1m[90mloading flutter_tester_emulation_golden_test.dart[0m[0m
00:02 [32m+0[0m: [1m[90mloading flutter_tester_emulation_golden_test.dart[0m[0m
```
This PR disables colors on LUCI so that we get clean output that's easily scannable and searchable.
## Description
This PR fixes Meta keys throwing exception on Chrome Linux.
The assertions throws because the DOM event sent when Meta keys is pressed is not coherent when Meta is the only pressed key.
## Related Issue
Fixes https://github.com/flutter/flutter/issues/125672
## Tests
Adds 1 test.
`Chrome < v87` have the `v8BreakIterator` API but don't have `Intl.Segmenter`. This caused crashes for some apps (see b/281377168).
This PR enhances our feature detection to take into account this API mismatch.
The mac clang tidy build has been running successfully on staging for several days. This is also moving the ios and host legacy clang tidy builds to staging.
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Noticed this while working on https://github.com/flutter/flutter/issues/124181
In Impeller right now, Android creates a context for each surface - but in Skia, Android creates one context and shares it across surfaces. For the multiple-engine scenario this matters. This also makes it possible for Android to provide the impeller::Context independently of surface creation.
Makes the index buffer optional. For calls that were just filling the index buffer with e.g. `std::iota`, it was wasteful. @jonahwilliams has also found cases where the index buffer will run out of room for drawPoints with lots of points.
Fixes https://github.com/flutter/flutter/issues/126572
allows to supply gn args that do not have their cli switches (yet), like this:
```sh
python3 ./tools/gn --gn-args 'use_default_linux_sysroot=false'
```
*List which issues are fixed by this PR. You must list at least one issue.*
https://github.com/flutter/flutter/issues/126197
*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
See skbug.com/12083, skbug.com/12303.
SkCanvas::saveLayer() calls with an SkColorFilter that affects transparent black will now fill out to the bounds of the clip before the layer, which prevents leaking internal layer allocation decisions in the final rendering.
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Part of an ongoing set of efforts to address https://github.com/flutter/flutter/issues/106448
MockTexture now executes a call on the supplied DlCanvas object rather than creating its own list of MockCanvas-style draw calls. The TextureLayer tests now no longer use MockCanvas.
## Description
In https://github.com/flutter/engine/pull/41702, the default state of the focus bit is "false", assuming that Android will send an `onWindowFocusChanged(true)` when the window is first focused, but there appear to be some cases where that doesn't happen.
This change puts the initial state back to what it used to be: in the absence of focus change events, entering the "onResume" Android state will report the `resumed` state in Flutter. Before this PR, and after https://github.com/flutter/engine/pull/41702, if no focus events were received, it would default to `inactive`.
## Tests
- Updated tests to match.
@staticInterop members will start disallowing tear-offs, so this member should turn into a closure.
The static check wasn't added in time, so this is modifying the source code again.
ee3ce32c7c was the original change, but the static error didn't make it into the Dart SDK, so this is fixing another tear-off.
- [] 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.
1. Expose `PlatformLocation` and its subclass `BrowserPlatformLocation` through the new `ui_web`.
2. Expose `HashUrlStrategy` too. It's useful for users who want to extend and customize it instead of building their own from scratch.
3. `ui_web/url_strategy.dart` => `ui_web/navigation/url_strategy.dart`.
These tests are flaky. Until they've been deflaked, disable the
following two tests:
* FlutterEngineTest.BackgroundIsBlack
* FlutterEngineTest.CanOverrideBackgroundColor
Issue: https://github.com/flutter/flutter/issues/124677
Introduce 2 new classes for a11y focus management:
* `AccessibilityFocusManager`: a generic class that attaches "focus" and "blur" event handlers, and forwards the events to the framework as `SemanticsAction.didGainAccessibilityFocus` and `SemanticsAction.didLoseAccessibilityFocus` respectively. Provides the `changeFocus` method for the framework to move a11y focus to the target element.
* `Focusable`: a role manager that provides generic focus management functionality to `SemanticsObject`s that don't need anything special.
Rewrites focus management using the above two classes as follows:
* All focusable nodes except text fields and incrementables get the `Focusable` role (all custom focus stuff in `Tappable` was removed and delegated to `Focusable`).
* `Incrementable` uses a custom `<input>` internally and so it cannot use the `Focusable` role. Instead, it uses `AccessibilityFocusManager` to manage the focus on the `<input>` element.
Behavioral changes:
* Fixes https://github.com/flutter/flutter/issues/118737, but more generally fixes all nodes that use the `isFocusable` and `hasFocus` bits.
* `Tappable` only partially implemented focusability (e.g. it didn't generate the respective `SemanticsAction` events). Now by delegating to `Focusable`, it will inherit all the functionality.
* `Incrementable` and `Checkable` (checkboxes, radios, switches) get focus management features for the first time.
* Elements that are not inherently focusable (text, images) can now be focused if semantics requires them to be.
* `TextField` is left alone for now as focus and on-screen keyboard interact with each other in non-obvious ways.
The original code creates an internal `class` which is alarming:
`NSClassFromString(@"_UIVisualEffectBackdropView")`
This PR removes such usage.
*List which issues are fixed by this PR. You must list at least one issue.*
Fixes https://github.com/flutter/flutter/issues/124008
*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Part of an ongoing set of efforts to address https://github.com/flutter/flutter/issues/106448
The layer unittests have been using a MockCanvas class to record the painting of trees of layers and then testing for the expected output.
A while back a similar mechanism was created to compare DisplayList output and to print out a human-friendly version of the differences found, but it was only used in a few tests written at the time it was created and a few since then.
This is the first in a series of PRs that will move all the rest of the unit tests onto the new DL comparison mechanism, starting with the layer types that just do basic drawing. Some of the remaining layers will require creating new hooks in, for instance, the Texture registry, the performance overlay TextBlob generation, etc.
The convex path tessellator is more general purpose than the RRect and shouldn't be any slower. BY removing this class, we make it easier to switch to GPU polyline generation and tessellation for convex shapes.