3107 Commits

Author SHA1 Message Date
LongCatIsLooong
e156901deb Disable text rounding hack by default (flutter/engine#44544)
This depends on https://github.com/flutter/flutter/pull/132094 and customer_testing migration.

I'll announce this change and add a g3 fix after this lands.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-08-10 01:44:23 +00:00
Srujan Gaddam
b76eb03600 Make toJS'd function use JS types (flutter/engine#44469)
JSFunction's should only accept and return JS types.

Allows landing of external restrictions here:
https://dart-review.googlesource.com/c/sdk/+/316867/9
2023-08-09 14:39:12 -07:00
xuty
0c708f040f [web] Fix rendering of gradients in html mode (flutter/engine#40345)
![CleanShot 2023-03-16 at 20 44 01@2x](https://user-images.githubusercontent.com/15033141/225620947-18fe19aa-c5e2-45a5-a0cc-151275844af7.png)

<details>
<summary> Code  Example</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class DemoGradientTransform implements GradientTransform {
  @override
  Matrix4? transform(Rect bounds, {TextDirection? textDirection}) {
    return Matrix4.identity()
      ..scale(1.2, 1.7)
      ..rotateZ(0.25);
  }
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    var colors = <Color>[
      Colors.red,
      Colors.green,
      Colors.blue,
      Colors.yellow,
    ];

    const stops = <double>[0.0, 0.25, 0.5, 1.0];

    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: GridView(
        gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
          crossAxisCount: TileMode.values.length,
        ),
        children: <Widget>[
          for (final mode in TileMode.values)
            DecoratedBox(
              decoration: BoxDecoration(
                gradient: LinearGradient(
                  colors: colors,
                  stops: stops,
                  tileMode: mode,
                  transform: DemoGradientTransform(),
                ),
              ),
            ),
          for (final mode in TileMode.values)
            DecoratedBox(
              decoration: BoxDecoration(
                gradient: RadialGradient(
                  center: Alignment.topLeft,
                  radius: 0.5,
                  colors: colors,
                  stops: stops,
                  tileMode: mode,
                  transform: DemoGradientTransform(),
                ),
              ),
            ),
          for (final mode in TileMode.values)
            DecoratedBox(
              decoration: BoxDecoration(
                gradient: SweepGradient(
                  center: Alignment.topLeft,
                  startAngle: 0.0,
                  endAngle: 3.14,
                  colors: colors,
                  stops: stops,
                  tileMode: mode,
                  transform: DemoGradientTransform(),
                ),
              ),
            ),
        ],
      ),
    );
  }
}
```
</details>

Fixes: https://github.com/flutter/flutter/issues/84245
2023-08-09 21:38:59 +00:00
LongCatIsLooong
bd6dcc68c9 Disable HTML renderer paragraph input width flooring (flutter/engine#44478)
Hopefully the flooring will no longer be needed once the framework stops doing the rounding.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-08-08 21:07:53 +00:00
Jason Simmons
2ae4942db0 Use the Clang unreachable code warning flag in the engine tree (flutter/engine#44458) 2023-08-08 17:40:03 +00:00
Mouad Debbar
2b761a04f7 [web] Expose the benchmark callback through dart:ui_web (flutter/engine#44461)
Required by https://github.com/flutter/flutter/pull/132087
Part of https://github.com/flutter/flutter/issues/130175
Part of https://github.com/flutter/flutter/issues/126831
2023-08-08 16:09:14 +00:00
Jason Simmons
0413e2710d Revert "[Impeller] DlCanvas implementation wrapping Aiks canvas" (flutter/engine#44466)
This reverts commit 1785eb5cb8cba53da249614158065d1d53f8f863.

See https://github.com/flutter/flutter/issues/132071
2023-08-07 23:59:47 +00:00
Mouad Debbar
dc0147d3d3 [web] Silence pub get when it's successful (flutter/engine#44445)
In the spirit of keeping the happy path's output as clean as possible, let's hide the many lines printed by `pub get` even when it's successful.

If `pub get` fails, its output will be printed on the terminal.
2023-08-07 22:38:03 +00:00
Brandon DeRosier
e8e4f8c118 [Impeller] Flutter GPU: Add GpuContext. (flutter/engine#44359)
Move the GpuContext to its new home. I added a `flutter_tester` test that just verifies an exception is gracefully thrown when Impeller isn't available.

In a later patch, I'll land a way to eagerly supply the Impeller context on the cpp side to enable testing through the playground (as mentioned in https://github.com/flutter/flutter/issues/127712).
2023-08-07 19:41:57 +00:00
Yegor
fc753e1355 [web] remove leftover comments from semantics tester (flutter/engine#44350)
Remove commented out debug code from `expectSemanticsTree`.
2023-08-07 18:04:47 +00:00
Dan Field
1785eb5cb8 [Impeller] DlCanvas implementation wrapping Aiks canvas (flutter/engine#44248)
Fixes https://github.com/flutter/flutter/issues/130141

The primary goal of this patch is to move dispatching of `dart:ui` `Canvas` commands to the UI thread.

Before this patch, the architecture is something like:

## UI Thread
- `dart:ui` talks to `DisplayListBuilder`, a `DlCanvas` implementation.
- `DisplayListBuilder` does some clip/bounds tracking and creates a `DisplayList` object that is held by `dart:ui`'s `Picture` objects.
- `DisplayList`s are added to `DisplayListLayer`s in `flow`. 

## Raster Thread
- `flow` flattens the various operations into a single `DisplayList` via another `DisplayListBuilder`.
- A `DlOpReceiver`implementation converts that `DisplayList` into an `Aiks` `Canvas`/`Picture`.

After this patch, the architecture instead looks like:

## UI Thread

- No change for Skia.
- If Impeller, use a new `DlCanvasImplementation` that talks to `Aiks`'s `Canvas`.
- If Impeller, `dart:ui` Picture's now hold an `Aiks` `Picture`, which get shared into `AiksLayer`s in `flow`.

## Raster thread

- No change for Skia, but some light refactoring for places that assumed a `DisplayListBuilder` where they really just needed a `DlCanvas`.
- The `Aiks` `Picture`s are combined using new API on `DlCanvas` and still backed by `Aiks`.

These changes show significant improvement on raster times on Android and only very small regressions on UI times in local testing, see https://gist.github.com/dnfield/26528090194c9f5abdbac13cdcbf4f79 for old gallery transition perf numbers.

Many of the other changes in this patch are related to the following:

- Making `DlRTree` usable for Impeller.
  - It would be nice to have a version of DlRTree that speaks `impeller::Rect`.
- Creating the requisite classes to support `EmbeddedViews` so that Desktop works.

This patch does not remove the `impeller::DlDispatcher`, which now would only be used in tests.
2023-08-04 17:35:14 +00:00
Harry Terkelsen
b65e82c3c5 Reland "[web] Update text editing test skips" (flutter/engine#37655) 2023-08-03 15:25:15 -07:00
Yegor
6dee3dd14e [web] fix clicks on merged semantic nodes (flutter/engine#43620)
This should significantly improve the situation described in https://github.com/flutter/flutter/issues/130162.

When the framework merges semantics trees of multiple widgets into a single node, it can expand the tap area of one of the descendants to the size of the combined node as follows:

<img width="865" alt="Screenshot 2023-07-07 at 4 11 30 PM" src="https://github.com/flutter/flutter/assets/211513/50e4f9f2-d36b-4820-93d2-c53714f33b08">

When a screen reader taps on the combined node, the pointer events and the click all land in the center. This produces a stalemate resulting in the user action never producing a tap/click gesture in the framework:

* The web engine, seeing `pointerdown`/`pointerup`, switches to the gesture mode ignores the `click`, believing that the framework will interpret the pointer events as one.
* The framework, seeing pointer events landing outside the checkbox, never reacts to the pointer events.

This PR mostly solves the issue by delaying event sequences starting with pointerdown for up to 200ms. If within those 200ms a click is observed, `SemanticsAction.tap` is sent to the framework. Otherwise, the pointer events are sent to the framework and the DOM `click` event is dropped. The tradeoff is that even when the drag gesture detector is the only one present, there's a 200ms delay before dragging can start. However, it seems to be a better trade-off than missing clicks entirely.
2023-08-03 21:43:19 +00:00
Brandon DeRosier
07c646b28d [Flutter GPU] Export symbols from engine, stub for testing on CI. (flutter/engine#44280)
Part of https://github.com/flutter/flutter/issues/131346

Stubs a minimal test of the FFI utilities that `dart:ui` uses, but using
public symbols exported from the engine library. If this goes well, I'll
move the stuff from `dart:ui` into here and begin landing parts of the
API with test coverage.
2023-08-03 08:11:57 -07:00
Harry Terkelsen
aed57ec7af [canvaskit] Enable CanvasKit to compute tight SkPicture bounds (flutter/engine#43361) 2023-08-01 16:07:19 -07:00
Yegor
6136444a48 [web:a11y] add platform view role (flutter/engine#44188)
Add `PlatformViewRoleManager`, the primary role manager for platform views. Currently, all it does is manager the `aria-owns` attribute that determines the screen reader traversal order of the platform view w.r.t. surrounding content.

This is a partial fix for https://github.com/flutter/flutter/issues/124765. While it does not address literally using the TAB key as a means for traversing widgets, it does address traversal via screen reader shortcuts.
2023-08-01 22:25:07 +00:00
Srujan Gaddam
8491586ef9 Remove extends JSTypedArray from JSUint8Array1 (flutter/engine#44175)
Any user @staticInterop types should only subtype the dart:js_interop
types JSObject and or JSAny as user @staticInterop types erase to
JSObject.

In the future, the other JS types will be added as extension types,
allowing users to implement them with their own extension types.

Allows https://dart-review.googlesource.com/c/sdk/+/316865/1 to be
landed.

## 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.
- [ ] 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].
- [ ] All existing and new tests are passing.
2023-08-01 12:39:27 -07:00
Ian Hickson
ddb2a2b8b3 Mention the point of BlendMode.plus and advise on using it. (flutter/engine#44189) 2023-07-31 22:32:17 +00:00
Tong Mu
585acdf97b Remove a temporary lint ignore (flutter/engine#44091)
[The issue](https://github.com/dart-lang/linter/issues/4562) has been resolved.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-07-28 19:48:11 +00:00
Jackson Gardner
12c34f4b33 Roll Chrome to 115 (flutter/engine#44076)
Update the version of Chrome we use for unit tests to 115.
2023-07-28 15:03:05 +00:00
Qun Cheng
58c5cbd17f Add Expanded/Collapsed state for SubmenuButton (flutter/engine#43983)
This PR is to add support for the expanded/collapsed-state semantics flag to the engine. After adding another PR to Flutter, we will be able to support the expanded/collapsed state in semantics for submenu buttons.

Related to [#127617](https://github.com/flutter/flutter/issues/127617) in flutter
2023-07-28 00:49:12 +00:00
Mouad Debbar
b542cbb21c [web] Provide convenient default factories for platform views (flutter/engine#43828)
Convenient default factories for creating DOM element from a given tag name.

Required by https://github.com/flutter/flutter/pull/130513

Part of https://github.com/flutter/flutter/issues/127030
2023-07-26 15:15:55 +00:00
David Iglesias
1d2593d09f [web] Preserve canvaskit variant during tests. (flutter/engine#43868)
A ~~simpler~~ very similar version of https://github.com/flutter/engine/pull/43854

* Makes it harder for users to accidentally remove default configuration values, while still allowing them to do so if needed (configuration is now overridden with a subset of values, rather than passing a full configuration object).
  * Moves `merge` from the configuration object and into the override method.
* Removes a test-only configuration option:
  * `window._flutter_canvaskit_variant_for_test_only`

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-07-26 05:04:16 +00:00
Jackson Gardner
8b46c33ac4 Roll fallback fonts. (flutter/engine#44000)
Update our fallback fonts data along with the CIPD package
2023-07-26 01:07:02 +00:00
Paul Berry
db661a120d Prepare flutter engine for enabling private final field promotion. (flutter/engine#43959)
Some parts of the flutter engine are built using the latest version of the Dart SDK, ignoring SDK constraints in `pubspec.yaml` files. Therefore, before the Dart SDK can switch on the "private field promotion" feature (https://github.com/dart-lang/language/issues/2020), these parts of the flutter engine need to be modified so that they won't have any "unnecessary `!`" warnings after field private field promotion is enabled. This PR makes the necessary changes.

This PR doesn't introduce any functional change. In principle it might improve performance slightly (by avoiding redundant memory accesses), but in practice the difference is unlikely to rise out of the measurement noise.

Issue fixed by this PR: https://github.com/flutter/flutter/issues/131198

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-07-26 01:04:09 +00:00
Kevin Lubick
778cc2a363 Reland "Remove more calls to SkCanvas::flush() and SkSurface::flush()" (flutter/engine#43965)
Relanding https://github.com/flutter/engine/pull/43902 without the
copy-pasta return statements which did not seem to cause a compile
issue, but caused Fuchsia tests to hang.

## 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].
- [ ] 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 `///`).
- [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
2023-07-25 14:05:44 -04:00
Ian Hickson
8125aa1d19 add ColorFilter.toString to web_ui (flutter/engine#43874) 2023-07-24 19:21:13 +00:00
Zachary Anderson
ef7a6e324b Revert "Remove more calls to SkCanvas::flush() and SkSurface::flush()" (flutter/engine#43957)
Reverts flutter/engine#43902

Speculative revert for Fuchsia tests that began failing/timing-out on
this commit:
https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20Fuchsia%20FEMU/16871/overview
2023-07-24 09:09:51 -07:00
Kevin Lubick
ec84f26d46 Remove more calls to SkCanvas::flush() and SkSurface::flush() (flutter/engine#43902)
Skia has removed flushing from both
[SkCanvas](https://skia-review.googlesource.com/c/skia/+/716476) and
[SkSurface](https://skia-review.googlesource.com/c/skia/+/698237). This
migrates the calls to use GrDirectContext directly (or removing no-op
flushes for Raster canvases/surfaces).

## 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].
- [ ] 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.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] 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-07-24 08:54:25 -04:00
Brandon DeRosier
61b006d0ed [Impeller] Add a way to query the gfx backend type. (flutter/engine#43837)
I've been trying to avoid this, but since the context type may vary
through runtime decisions, we just need something like this to select
which shader data to pull from the Dart GPU bundle at runtime. One
alternative would be to add a special omni shader concept to the HAL,
but that seems worse than just letting renderers key with a backend enum
sometimes.

Cautioned against using it for cap checks in the doc string.
2023-07-21 13:11:32 -07:00
Chris Yang
eacae26086 Refactor: fix typo "setup" -> "set up" (flutter/engine#43824)
There are several places in the engine using the word "setup" incorrectly. I have changed them to "set up"

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-07-21 17:06:34 +00:00
Mouad Debbar
a9896d3b98 Add url to get GoogleFonts API key (flutter/engine#43857) 2023-07-20 18:34:06 +00:00
Mouad Debbar
d205cf6af6 [web] Preserve correct CanvasKit Variant during test initialization (flutter/engine#43854)
At some point, we started setting `useColorEmoji` to true in our tests, but we were doing it in a way that resets all other configurations to their defaults. This caused the `canvasKitVariant` config to be lost and always set to the default `auto`.

This PR fixes the issue and adds tests to:

1. Make sure that the CanvasKit suite always runs with a specific variant (not `auto`).
2. Make sure the given CanvasKit variant makes it all the way through to the tests.

The test harness uses a backdoor (a global JS property on `window`) to communicate which canvaskit variant it's using. The test then compares that with `configuration.canvasKitVariant` to make sure they match. If they don't match, then the configuration was lost somewhere on the way.

Fixes https://github.com/flutter/flutter/issues/130993
2023-07-20 18:06:24 +00:00
Mouad Debbar
6d0be04af3 [web] sync => isSync , scuba => golden (flutter/engine#43699)
This PR addresses some of the items in https://github.com/flutter/flutter/issues/100394
2023-07-18 18:28:13 +00:00
Brian Osman
b8a91e96a8 Fix drawVertices documentation (flutter/engine#43747)
Update the blend mode section of the documentation to specify the correct blend modes.

Fixes https://github.com/flutter/flutter/issues/130747
2023-07-17 22:48:14 +00:00
Michael Goderbauer
40c304099d Move ViewConfiguration ownership to FlutterView (flutter/engine#43701)
This makes the FlutterView object a little bit less brittle by not depending on the PlatformDispatcher so much.
2023-07-15 01:21:09 +00:00
Yegor
7413bfb203 [web] always add secondary role managers (flutter/engine#43663)
Always add secondary role managers irrespective of the initial state of the semantic node, and have role manager decide whether it applies to the node or not.

Fixes https://github.com/flutter/flutter/issues/130546
2023-07-14 23:59:04 +00:00
Kevin Lubick
bdc24b3d18 Remove calls to SkCanvas::flush() (flutter/engine#43684)
In https://skia-review.googlesource.com/c/skia/+/716476, Skia removed
calls to SkCanvas::flush(). This replaces those calls that Flutter was
making with what had been going on - calling GrDirectContext::flush() if
the canvas was backed by a Ganesh backend. Raster-backed canvases did
not need flushing.

## 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].
- [ ] 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.
- [ ] 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
2023-07-14 16:34:22 -04:00
Martin Kustermann
0e369e0e4e Use utf8.encode() instead of longer const Utf8Encoder.convert() (flutter/engine#43675)
The change in [0] has propagated now everywhere, so we can use 
`utf8.encode()` instead of the longer `const Utf8Encoder.convert()`.

Also it cleans up code like

```
  Uint8List bytes;
  bytes.buffer.asByteData();
```

as that is not guaranteed to be correct, the correct version would be

```
  Uint8List bytes;
  bytes.buffer.asByteData(bytes.offsetInBytes, bytes.length);
```

a shorter hand for that is:

```
  Uint8List bytes;
  ByteData.sublistView(bytes);
```

[0] https://github.com/dart-lang/sdk/issues/52801
2023-07-14 13:44:54 +02:00
Ian Hickson
34c0f686c5 Add more points to [MediaQuery]. (flutter/engine#43649)
See https://github.com/flutter/flutter/issues/11697
2023-07-14 00:34:14 +00:00
Ian Hickson
1ca3a2c32a Remove unimplemented API call saveCompilationTrace (flutter/engine#43656)
Fixes https://github.com/flutter/flutter/issues/59205
2023-07-14 00:34:12 +00:00
LongCatIsLooong
b7472f9a45 Reland #43118 "Add a flag to ParagraphBuilder for rounding hack migration" (flutter/engine#43647)
real diff: aedc37a3e0

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-07-13 22:30:32 +00:00
LongCatIsLooong
64c139e98a Revert "Add a flag to ParagraphBuilder for rounding hack migration" (flutter/engine#43642)
Reverts flutter/engine#43118

The incorrect default value (`true` instead of  `false`) was used in the PR and that caused internal test failures. I'll add a test before trying to reland.
2023-07-13 17:54:33 +00:00
chunhtai
8f5fb30a7f [web] TextField a11y focus should call didGain/didLose a11y focus action (flutter/engine#43279)
fixes https://github.com/flutter/flutter/issues/128709

requires https://github.com/flutter/flutter/pull/129652

The issue is that when textfield focus in framework and web engine a11y are out of sync, the framework keep sending update with textfield focus = true and causes web engine to keep refocusing the textfield.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-07-13 17:43:53 +00:00
Jason Simmons
49813d1e77 Apply the transform of an image filter layer to paint bounds in the CanvasKit backend (flutter/engine#43353)
Fixes https://github.com/flutter/flutter/issues/128788
2023-07-13 14:26:04 +00:00
Ian Hickson
eaca35dd7c Document (and assert) that channel names can't contains nulls (flutter/engine#43593)
Fixes https://github.com/flutter/flutter/issues/116652
2023-07-12 21:44:31 +00:00
Srujan Gaddam
49e8ec8b0b Reland "Refactor JSNumber.toDart and Object.toJS" (flutter/engine#43363)
This reverts commit dce75ab4cf647eec6699f8a30ba2289a3738b307.

This also makes some small changes to make onBenchmark a
JSExportedDartFunction instead of a JSBoxedDartObject. This is for
changes in https://github.com/flutter/flutter/pull/129436 and to account
for the fact that flutter/packages provides an `allowInterop`'d
function. Benchmarks tests pass with this CL.

## 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.
- [ ] 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].
- [ ] All existing and new tests are passing.
2023-07-12 14:27:16 -07:00
LongCatIsLooong
3b27aa3e95 Add a flag to ParagraphBuilder for rounding hack migration (flutter/engine#43118)
The goal is to remove the rounding applied in skparagraph and in the framework: https://github.com/flutter/flutter/issues/31707

The plumbing is done via a new static variable `ParagraphBuilder.shouldDisableRoundingHack` that toggles the rounding behavior in skparagraph and the flag is read by framework code. Application code and test code can either use `ParagraphBuilder.setDisableRoundingHack` or `--dart-define="SKPARAGRAPH_REMOVE_ROUNDING_HACK=1"` to opt-in. 
Once the internal migration is finished the default value of the flag will be set to true.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-07-12 20:36:45 +00:00
Jim Graham
870fc78163 header file cleanup focusing on removing unnecessary SkPicture includes (flutter/engine#43589)
Most of the #include directives for SkPicture are removed except where they are still functional. Many comments rewritten to no longer be SkPicture-centric.

- DL unit tests still use it for consistency testing
- rasterizer/engine still use it for screen shot support
- Fuchsia still uses it extensively
2023-07-12 08:17:06 +00:00
Jim Graham
77514c4f43 Use full 4x4 matrix transforms in TransformLayer (flutter/engine#43536)
Fixes: https://github.com/flutter/flutter/issues/82961
Fixes: https://github.com/flutter/flutter/issues/113346

The fix was a simple fallout from the previous work to add support for SkM44 throughout the DL and Diff mechanisms (see https://github.com/flutter/flutter/issues/82955, https://github.com/flutter/flutter/issues/116198, https://github.com/flutter/engine/pull/37394)

Tested with its own existing and new unit tests as well as the test case from https://github.com/flutter/flutter/issues/113346
2023-07-11 01:55:07 +00:00