1234 Commits

Author SHA1 Message Date
Chris Yang
e2bc37bba7 Reland "Reverts "[ios] Fix app extension not able to find assets from… (flutter/engine#46329)
Relands https://github.com/flutter/engine/pull/46283

The original PR had a bug where the relative assets path is reset after not being found in the `bundle`. It should not be reset unless it was not found inside the info.plist in `bundle`

Fixes https://github.com/flutter/flutter/issues/124292

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-28 00:02:04 +00:00
auto-submit[bot]
8a97e55da3 Reverts "[ios] Fix app extension not able to find assets from unloaded bundle" (flutter/engine#46328)
Reverts flutter/engine#46283
Initiated by: CaseyHillers
This change reverts the following previous change:
Directly use "flutter_assets" as the default path to find the asset path, this works for app extension when the bundle is unloaded.

This PR also adds integration tests for app extensions, which also tests the asset path. 

Fixes https://github.com/flutter/flutter/issues/124292

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-27 17:57:18 +00:00
Kevin Lubick
8656e6b1d4 Update to use GrDirectContexts::MakeGL (flutter/engine#46308)
This was added in https://skia-review.googlesource.com/c/skia/+/760017
and the old versions were deprecated.

## 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 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
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[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-09-27 10:17:05 -04:00
Chris Yang
043c5a377a [ios] Fix app extension not able to find assets from unloaded bundle (flutter/engine#46283)
Directly use "flutter_assets" as the default path to find the asset path, this works for app extension when the bundle is unloaded.

This PR also adds integration tests for app extensions, which also tests the asset path. 

Fixes https://github.com/flutter/flutter/issues/124292

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-26 21:47:13 +00:00
Zachary Anderson
594738f2d5 In run_tests.py, separate Dart package unit tests from other tests (flutter/engine#46232)
This PR creates a new test type for `run_tests.py` called `dart-host`.
The tests remaining under the `dart` type are tests that run in
`flutter_tester`. The `dart-host` tests run in the Dart CLI. This allows
`run_tests.py` to be simplified a bit, and while doing this I spotted a
couple of mistakes that were causing some tests not to run.

This PR also makes a couple of small style fixes to the build config
json files, converting tabs to spaces, and moving some "script" fields
before the "parameters" fields.
2023-09-24 18:22:27 -07:00
Jonah Williams
7cd7603dfa [Impeller] Reland: construct text frames on UI thread. (flutter/engine#46115)
Due to https://github.com/flutter/flutter/issues/127500 , we can get in a state where enable-impeller is true but we're using Skia. We need to either fall back completely to Skia, make this configuration fatal, or remote the check

----------------

Conversion of SkTextBlobs to impeller::TextFrame objects is one of the most expensive operations in display list dispatching. While the rest of the engine and framework makes a reasonable attempt to cache the SkTextBlobs generated during paragraph construction, the design of the dl dispatcher means that these the Impeller backend will always reconstruct all text frames on each frame - even if the display list/picture that contained those text frames was unchanged.

Removing this overhead is one of the goals of https://github.com/flutter/engine/pull/45386 , however this patch is also fairly risky and will be difficult to land. As a more incremental solution, we can instead construct the impeller::TextFrame objects when performing paragraph painting and record them in the display list. This both moves the text frame construction to the UI thread and allows the framework/engine to cache unchanged text frames.

This also does not conflict with the dl_aiks_canvas patch directly, and is fine to land before or after it does. (though I'd argue we should land this first).

To compare the current performance levels, I ran the complex_layout_scroll perf test, since this is fairly text filled. On a Pixel 6 pro. Across several runs this is a fairly consistent ~1ms raster time improvement.

Fixes https://github.com/flutter/flutter/issues/133204
2023-09-22 17:46:32 +00:00
Matan Lurey
3cea82e53b More Clang Tidy --fix[es] to header files (flutter/engine#46151)
More work towards https://github.com/flutter/flutter/issues/134969.

I decided not to touch the `LOG_X` variables since they are just used in macro expansion.
2023-09-21 21:16:16 +00:00
Tong Mu
38b8ce1c29 Reland: Enforce the rule of calling FlutterView.Render (#45300) (flutter/engine#45555)
This PR relands #45300 which was reverted in https://github.com/flutter/engine/pull/45525 due to hanging on a windows startup test. The culprit test still calls `FlutterView.render` in the illegal way, which is ignored, causing no frame being ever produced. This has been fixed in https://github.com/flutter/flutter/pull/134245. I've also searched through the framework repo for `render(` to ensure there are no other cases.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-21 21:11:03 +00:00
Matan Lurey
3d3a76280d Move git_repo_tools and process_fakes outside of clang_tidy. (flutter/engine#46017)
Closes https://github.com/flutter/flutter/issues/134988.
2023-09-21 12:16:42 -07:00
Matan Lurey
2681bee9ca Clang tidy-ify DlColor and friends. (flutter/engine#46122)
Closes https://github.com/flutter/flutter/issues/135057.

This is a fair bit more involved than previous changes, just due to the sheer number of implicit conversions.

Highlights:

- Made `public uint32_t argb` `private uint32_t argb_`, and added `argb()` instead.
- Added `ToSk(DlColor)` instead of using implicit conversions.

There were a bunch of places where I had to make a judgement call (particularly in tests) to keep the code a bit "messy", i.e. `DlColor(SK_RED)`, just to make the diff as small as possible and to prevent silly copy and paste bugs. I'd be open to filing a follow-up issue to reduce unnecessary wrapping.
2023-09-20 22:08:07 +00:00
Chris Yang
2b2092a781 [ios] scenario test make parent view controller hide status bar (flutter/engine#46065)
The parent view controller of FlutterViewController in `non_full_screen_flutter_view_platform_view` does not explicitly set the status bar hidden. iOS 17 will show the status bar causing the golden to be no deterministic. 

Part of https://github.com/flutter/flutter/issues/133207

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-19 21:23:16 +00:00
Michael Goderbauer
f98560e895 Enable strict-inference (flutter/engine#46062)
Avoids that dynamic accidentally sneaks in, see https://dart.dev/tools/analysis#enabling-additional-type-checks
2023-09-19 21:17:16 +00:00
Chris Yang
4260e227dc [ios]Adjust golden test threshold for TwoPlatformViewsWithOtherBackDropFilterTests based on current macOS version (flutter/engine#45891)
TwoPlatformViewsWithOtherBackDropFilterTests is failing on macOS 13 with the same simulator version used in macOS 12. The image diff looks identical and slightly above the threshold. This PR adjusts the threshold for this test temporarily so our CI can run on both macOS 13 and 12. This change can be reverted when we move all our CI to macOS 13

Fixes https://github.com/flutter/flutter/issues/134740

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-19 19:54:00 +00:00
Matan Lurey
5e0a53255f Add a single MacOS+Vulkan+SwiftShader CI test (flutter/engine#45918)
Closes https://github.com/flutter/flutter/issues/133708.

Will track why it's (a) blank and (b) times out in async presentation in https://github.com/flutter/flutter/issues/134852.
2023-09-16 03:55:06 +00:00
Jonah Williams
83f48da122 Revert "[Impeller] construct text frames on UI thread." (flutter/engine#45910)
Reverts flutter/engine#45418

Some google3 tests are hitting the CHECK I added in the DlSkCanvasDispatcher::drawTextFrame, which indicates that the SkParagraph code likely thinks impeller is enabled, whereas other code might be running with Skia.

Perhaps this could happen if its software rendering? It should be a fatal error on startup so we can track this down.
2023-09-16 01:22:13 +00:00
Zachary Anderson
191e0417ef Adds a --quiet flag to run_tests.py (flutter/engine#45880)
This PR changes run_tests.py to use the python logging library to report
results instead of direct prints or writes to stdout/stderr. This change
simplifies adding a `--quiet` flag that causes the script to only
generate output if a log is emitted at WARNING or above.

Overall this is a bit of progress toward landing something like
https://github.com/flutter/engine/pull/45595
2023-09-15 09:31:55 -07:00
Reid Baker
a43cae2515 Update AGP and Kotlin for scenario app (flutter/engine#45549)
flutter/flutter/#134220

Command required to update lock files required not using the custom task and required matching the version of gradle in ci and passing a custom version of java. 
`~/.gradle/wrapper/dists/gradle-7.5.1-bin/7jzzequgds1hbszbhq3npc5ng/gradle-7.5.1/bin/gradle -D=org.gradle.java.home=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home  app:dependencies --write-locks` for app:dependencies and dependencies.
2023-09-15 15:54:04 +00:00
Kevin Lubick
7da278b05b Migrate GrMipmapped->skgpu::Mipmapped (flutter/engine#45881)
Skia's Graphite and Ganesh backend coalesced two enums regarding mipmaps
into one and deprecated the public Ganesh version. This migrates Flutter
to use the preferred type.

No functional changes expected. See also
https://skia-review.googlesource.com/c/skia/+/753567

## 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 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
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[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-09-15 11:48:20 -04:00
Michael Goderbauer
efc22ee283 Enable private field promotion (flutter/engine#45722)
New feature in upcoming Dart 3.2. See https://github.com/dart-lang/language/issues/2020. Feature is enabled by bumping the min SDK version to 3.2.

Part of https://github.com/flutter/flutter/issues/134476.
2023-09-14 21:02:03 +00:00
Jonah Williams
62031173dd [Impeller] construct text frames on UI thread. (flutter/engine#45418)
Conversion of SkTextBlobs to impeller::TextFrame objects is one of the most expensive operations in display list dispatching. While the rest of the engine and framework makes a reasonable attempt to cache the SkTextBlobs generated during paragraph construction, the design of the dl dispatcher means that these the Impeller backend will always reconstruct all text frames on each frame - even if the display list/picture that contained those text frames was unchanged.

Removing this overhead is one of the goals of https://github.com/flutter/engine/pull/45386 , however this patch is also fairly risky and will be difficult to land. As a more incremental solution, we can instead construct the impeller::TextFrame objects when performing paragraph painting and record them in the display list. This both moves the text frame construction to the UI thread and allows the framework/engine to cache unchanged text frames.

This also does not conflict with the dl_aiks_canvas patch directly, and is fine to land before or after it does. (though I'd argue we should land this first).

To compare the current performance levels, I ran the complex_layout_scroll perf test, since this is fairly text filled. On a Pixel 6 pro.   Across several runs this is a fairly consistent ~1ms raster time improvement.

### Skia
```
  "average_frame_build_time_millis": 1.497333333333333,
  "90th_percentile_frame_build_time_millis": 2.038,
  "99th_percentile_frame_build_time_millis": 17.686,
  "worst_frame_build_time_millis": 23.095,
  "missed_frame_build_budget_count": 3,
  "average_frame_rasterizer_time_millis": 5.5078589743589745,
  "stddev_frame_rasterizer_time_millis": 2.226343414420338,
  "90th_percentile_frame_rasterizer_time_millis": 7.481,
  "99th_percentile_frame_rasterizer_time_millis": 19.11,
  "worst_frame_rasterizer_time_millis": 79.799,
  "missed_frame_rasterizer_budget_count": 7,
  "frame_count": 234,
  "frame_rasterizer_count": 234,
  "new_gen_gc_count": 10,
  "old_gen_gc_count": 2,
 ```
 
 ### Impeller (ToT)
 
 ```
   "average_frame_build_time_millis": 1.431575000000001,
  "90th_percentile_frame_build_time_millis": 2.196,
  "99th_percentile_frame_build_time_millis": 14.486,
  "worst_frame_build_time_millis": 23.728,
  "missed_frame_build_budget_count": 2,
  "average_frame_rasterizer_time_millis": 6.536087499999999,
  "stddev_frame_rasterizer_time_millis": 1.9902712500000004,
  "90th_percentile_frame_rasterizer_time_millis": 9.705,
  "99th_percentile_frame_rasterizer_time_millis": 14.727,
  "worst_frame_rasterizer_time_millis": 17.838,
  "missed_frame_rasterizer_budget_count": 1,
  "frame_count": 240,
  "frame_rasterizer_count": 240,
  "new_gen_gc_count": 10,
  "old_gen_gc_count": 2,
  ```
  
  ### Impeller (Patched)
  
  ```
    "average_frame_build_time_millis": 1.4500167364016743,
  "90th_percentile_frame_build_time_millis": 2.478,
  "99th_percentile_frame_build_time_millis": 14.883,
  "worst_frame_build_time_millis": 18.782,
  "missed_frame_build_budget_count": 1,
  "average_frame_rasterizer_time_millis": 5.023033333333336,
  "stddev_frame_rasterizer_time_millis": 1.6445388888888894,
  "90th_percentile_frame_rasterizer_time_millis": 7.814,
  "99th_percentile_frame_rasterizer_time_millis": 13.497,
  "worst_frame_rasterizer_time_millis": 15.008,
  "missed_frame_rasterizer_budget_count": 0,
  "frame_count": 239,
  "frame_rasterizer_count": 240,
  "new_gen_gc_count": 8,
  "old_gen_gc_count": 0,
  ```
2023-09-06 00:50:48 +00:00
Chris Yang
a101546179 [iOS ] Fix errors in unittest and scenario tests running against iOS 17 simulators (details in the description) (flutter/engine#45391)
1. New Mac version seems to have updated the locale data, to match the mac change, we can dynamically read the data when testing instead of hard coding.

2. "we are sending a UIImage type as parameter to `XCTAttachment attachmentWithScreenshot:`, which takes a `XCUIScreenshot` as parameter, this is not supposed to pass in old iOS versions." In this PR we updated the parameter to use the `XCUIScreenshot` type.

Fixes https://github.com/flutter/flutter/issues/133783

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-09-05 22:45:22 +00:00
Zachary Anderson
81534e8ace Adds a Dart library for loading and parsing build configs (flutter/engine#45390)
Also adds a test that the build configs in the repo are valid json that
matches the spec.

Fleshed out @christopherfujino's code from here
https://github.com/christopherfujino/flutter-engine-runner/blob/main/main.dart
2023-09-05 10:00:44 -07:00
Matan Lurey
a330c4ff97 Update (flipping the default from false -> true) and deprecate Paint.enableDithering. (flutter/engine#44705)
Update: Blocked on https://github.com/flutter/engine/pull/44912 landing,
and merging into google3.

---

Partial work towards https://github.com/flutter/flutter/issues/112498.

_**tl;dr**: In Impeller's backend we intend to _always_ dither
gradients, and never allow any changes long-term (i.e., write your own
shader if you want different behavior) with the assumption that dithered
gradients look better most of the time, and don't typically hurt
elsewhere._

Note that, at the time of this writing, I couldn't find a single case of
this being set explicitly to `true` inside Google, and there are between
[100 and 200 publicly accessible on
GitHub](https://github.com/search?q=%22Paint.enableDithering%22+language%3ADart&type=code&l=Dart),
of which virtually all are setting it explicitly to `true`.

There are some (valid) concerns this would cause a lot of golden-file
image diffs, so I'm going to seek explicit approval from the Google
testing team as well as someone from the framework team before landing
this commit.
2023-09-01 10:19:59 -07:00
Brian Osman
c11672e29a Migrate VK calls of GrBackend* (flutter/engine#45325)
In https://skia-review.googlesource.com/c/skia/+/742797 Skia refactored
GrBackend* to not require #ifdefs. This changes
callsites in Flutter to use static functions instead of methods that
were conditionally compiled on those classes.

There should be no functional change.
2023-08-31 14:15:17 -04:00
Zachary Anderson
aad0b0f680 Revert dl split (flutter/engine#45326)
Reverting for https://github.com/flutter/flutter/issues/133525
fixes: https://github.com/flutter/engine/pull/45326
2023-08-31 17:46:12 +00:00
Dan Field
ffa16ec08f [Impeller] Reland DlAiksCanvas (flutter/engine#45232)
Relands https://github.com/flutter/engine/pull/45131

Fixes https://github.com/flutter/flutter/issues/132416

Differences from last time:

- Some minor merge conflict fixes
- Use the RTree to get the bounds instead of recalculating the bounds
- Make the iOS platform view controller implementation use the impeller-aware slices instead of the display list ones. This has been fixed for Android and the desktop embedding, but I missed iOS. The unit tests weren't actually running before I branched for my PR, @zanderso fixed them up separately and this resulted in catching the failures on post submit last time.
2023-08-31 00:29:23 +00:00
Matan Lurey
293bca4e65 Add a build_bucket_golden_scraper tool. (flutter/engine#45243)
As discussed offline, this is best deleted when Skia-gold is used for
all of our engine tests.

However, this will be useful for unblocking some PRs until then :)

See README.md for details!
2023-08-30 17:26:01 -07:00
Matan Lurey
b3bb59e4b5 Refactor Stopwatch into StopwatchVisualizer and SkStopwatchVisualizer (flutter/engine#45200)
Partial work towards https://github.com/flutter/flutter/issues/126009.

Still working as before:
<img width="1210" alt="Screenshot 2023-08-28 at 6 32 45 PM"
src="https://github.com/flutter/engine/assets/168174/38728015-d0d4-4933-bd31-d2326c76aeee">

(There are some `PerformanceOverlayLayerDefault.*` tests that don't run
locally, so I guess I'll let CI run those)
2023-08-29 16:04:22 -07:00
Matan Lurey
b5eb6ab69a A minimal engine_tools_lib to use for local-repo Dart tooling (flutter/engine#45154)
Partial work towards re-landing #44936.

Both the `clang_tidy` and `githooks` passage could benefit from being
able to automatically find the latest `compile_commands.json` output,
which means that some common code should exist in the `tools/`
directory.

This is a very minimal (but tested) library for doing exactly that.
2023-08-28 19:25:56 -07:00
Jonah Williams
a04635d9e6 Revert "[Impeller] DlAiksCanvas as a DlCanvas wrapper for impeller::Canvas" (flutter/engine#45149)
Reverts flutter/engine#45131

This is failing the Impeller variants of the unobstructed platform views tests:

https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20Production%20Engine%20Drone/132249/overview

```
Failing tests:
	-[UnobstructedPlatformViewTests testPlatformViewsMaxOverlays]
	-[UnobstructedPlatformViewTests testOneOverlay]
	-[UnobstructedPlatformViewTests testOneOverlayPartialIntersection]
	-[UnobstructedPlatformViewTests testTwoIntersectingOverlays]
	-[UnobstructedPlatformViewTests testOneOverlayAndTwoIntersectingOverlays]

** TEST FAILED **
```

We've retried it a few times so I suspect this isn't a flake.
2023-08-26 19:31:39 +00:00
Dan Field
e9b2008748 [Impeller] DlAiksCanvas as a DlCanvas wrapper for impeller::Canvas (flutter/engine#45131)
This is a reland of https://github.com/flutter/engine/pull/44248

Fixes https://github.com/flutter/flutter/issues/132416

Changes from last time:

- The `drawPoints` benchmark was failing to render anything meaningful because of an error in `AiksLayer` that resulted in an infinitely sized bounding rectangle poisoning the bounds with `NaN` (this happens, for example, with a `drawPaint` call, which that benchmark happens to use). Added a test covering this and filed https://github.com/flutter/flutter/issues/132770 to explore ways to avoid this in the future.
- There was a bug in `DlAiksCanvas::SaveLayer` where a `nullptr` `paint` but non-`nullptr` `backdrop` was failing to actually save the layer. This resulted in incorrect rendering.
- There was a bug in `impeller::Canvas::DrawPicture` that resulted in incorrect stencil depth counting. That was fixed separately by @bdero, but was the cause of incorrect rendering in some Wonderous screens.
- I've added a simple implementation for `AiksLayer::IsReplacing`. It does not currently compare as deeply as the `DisplayListLayer` version potentially does, but it is good enough to avoid the regression noted in https://github.com/flutter/flutter/issues/132071. That regression was on a benchmark that greatly benefits from partial repaint. With the new implementation, it still gains partial repaint where it previously did not. There is more work that can be done here, filed https://github.com/flutter/flutter/issues/133361 to track that work.

I merged but did not fully integrate the `DisplayListBuilder`/`CanvasToReceiver` work that @flar has done. I have a local experiment with that, but would prefer to see this land and run through the device lab so we get some better comparison numbers for which one performs better.
2023-08-26 05:37:28 +00:00
Zachary Anderson
d72727e744 Remove --enable-software-rendering from iOS scenario tests (flutter/engine#45093) 2023-08-25 20:29:05 +00:00
Ian Hickson
f9a5c26a42 FontVariation.lerp, custom FontVariation constructors, and more documentation (flutter/engine#45030)
This should aid with implementing the framework side of https://github.com/flutter/flutter/issues/105120.
This should also address https://github.com/flutter/flutter/issues/28543.

Original commit in https://github.com/flutter/engine/pull/43750 was reverted in https://github.com/flutter/engine/pull/44993.
Second attempt in https://github.com/flutter/engine/pull/44996 was reverted in https://github.com/flutter/engine/pull/45023.
2023-08-25 05:54:08 +00:00
Jim Graham
5a9d0ee712 Reland "Split DisplayListBuilder into DlCanvas optimizer and DlOp recorder classes #44718" (flutter/engine#45085)
Fixes: https://github.com/flutter/flutter/issues/133200
2023-08-25 00:22:14 +00:00
Zachary Anderson
ad1a04dea2 Revert "FontVariation.lerp, custom FontVariation constructors, and more documentation" (flutter/engine#45023)
Reverts flutter/engine#44996

Analysis failures on rolling to the framework
https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20analyze/62884/overview
2023-08-23 14:36:08 -07:00
Michael Ludwig
9cec508891 Use decal TileMode in blur image_filter_test.dart (flutter/engine#45004)
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
2023-08-23 14:32:50 -04:00
Ian Hickson
190343a2bb FontVariation.lerp, custom FontVariation constructors, and more documentation (flutter/engine#44996)
This should aid with implementing the framework side of https://github.com/flutter/flutter/issues/105120.
This should also address https://github.com/flutter/flutter/issues/28543.

This is a reland of https://github.com/flutter/engine/pull/43750 with two changes, one to fix a typo mentioned in https://github.com/flutter/engine/pull/43750#issuecomment-1689299114, and one to fix the analysis error found when rolling this to the framework (https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20analyze/62845/overview). The latter change is temporary and can be relaxed when FontVariations is reexported from dart:ui. I plan to do that when fixing https://github.com/flutter/flutter/issues/105120.
2023-08-23 18:05:53 +00:00
Zachary Anderson
c187b9fcfd Revert "FontVariation.lerp, custom FontVariation constructors, and more documentation" (flutter/engine#44993)
Reverts flutter/engine#43750

Looks like this is having trouble rolling into the framework: https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20analyze/62845/overview
2023-08-23 05:55:13 +00:00
Ian Hickson
2a18cbd604 FontVariation.lerp, custom FontVariation constructors, and more documentation (flutter/engine#43750)
This should aid with implementing the framework side of https://github.com/flutter/flutter/issues/105120 This should also address https://github.com/flutter/flutter/issues/28543.
2023-08-23 03:35:20 +00:00
Jim Graham
5fa5cb698e Revert "Split DisplayListBuilder into DlCanvas optimizer and DlOp recorder classes" (flutter/engine#44968)
Reverts flutter/engine#44718

A rendering issue was discovered in internal testing (b/296975714)
2023-08-22 19:14:48 +00:00
LongCatIsLooong
649a1e181c Reland "Implementing TextScaler for nonlinear text scaling (#42062)" (flutter/engine#44907)
The original PR crashes because of a JNI signature mismatch (`(FJ)F` -> `(FI)F`). Update the signature in a415da5619

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-08-21 23:16:10 +00:00
Brian Osman
41be06b59f Include GrVkTypes where necessary (flutter/engine#44916)
IWYU fix to be able to use GrVkImageInfo. An incoming Skia change will otherwise fail to compile here.
2023-08-21 19:50:04 +00:00
Jim Graham
5774ccf84f Split DisplayListBuilder into DlCanvas optimizer and DlOp recorder classes (flutter/engine#44718)
DisplayListBuilder grew over time from a class that implemented a developer-unfriendly stateful API into one that implemented both the developer-friendly DlCanvas API as well as its original stateful API. Over time, the stateful API was buried under a "testing only" facade.

In the meantime, the optimization features that it applies to the DlCanvas calls before it records the operations in a DlOp store are useful without the recording process and so I've been wanting to break those into 2 parts for a while with the goal of removing all stateful APIs from DisplayListBuilder (see https://github.com/flutter/flutter/issues/108303).

This PR takes a major step along that direction by splitting DisplayListBuilder into essentially a convenience class that marries 2 new classes together to achieve its old functionality:
- `DlCanvasToReceiver` - a class that implements DlCanvas, optimizes common situations, and then sends commands to any object that implements `DlOpReceiver`
- `DlOpRecorder` - an implementation of DlOpReceiver that records the operations in a buffer from which to create a `DisplayList` object
- `DisplayListBuilder` now inherits from DlCanvasToReceiver to get the optimizations and provides it with an instance of `DlOpRecorder` as the receiver that it will send its results to
- Similarly, a `DlCanvasToReceiver` instance could be directed to an `impeller:DlDispatcher` to achieve a more straight-through path from the DlCanvas interface to impeller Pictures.
2023-08-21 07:17:19 +00:00
Jonah Williams
6f3b341232 Revert "Implementing TextScaler for nonlinear text scaling" (flutter/engine#44882)
Reverts flutter/engine#42062

Failing due to:

>>>>>>>> 08-18 15:59:41.350 3439 3484 E flutter :
[ERROR:flutter/shell/platform/android/platform_view_android_jni_impl.cc(902)]
Could not locate FlutterJNI#getScaledFontSize method
>>>>>>>> 08-18 15:59:41.350 3439 3484 F flutter :
[FATAL:flutter/shell/platform/android/library_loader.cc(26)] Check
failed: result.
2023-08-20 14:10:13 -07:00
LongCatIsLooong
7d07749fdd Implementing TextScaler for nonlinear text scaling (flutter/engine#42062)
`platformTextScaler` doesn't need to be per window, assuming the SP -> DiP mapping is always the same on the same device (unless the user changes the preference), and does not depend on the display device's pixel density (it's confirmed).

Design doc: https://docs.google.com/document/d/1-DlElw3zWRDlqoc9z4YfkU9PbBwRTnc7NhLM97ljGwk/edit#

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-08-18 22:22:16 +00:00
Dan Field
0d8aebd040 Revert "Make run_tests.py assert that the ios test dylib is at least as new as libFlutter.dylib" (flutter/engine#44690)
Reverts flutter/engine#41720

Fixes https://github.com/flutter/flutter/issues/131899
2023-08-14 18:36:02 +00:00
LongCatIsLooong
eb3946ff27 allow ParagraphBuilder.shouldDisableRoundingHack to actually be set to false in tests (flutter/engine#44647)
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-08-11 23:04:57 +00:00
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
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
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