24958 Commits

Author SHA1 Message Date
Jonah Williams
02ba2b7ff2 [Impeller] use spec constant for decal support in morph filter. (flutter/engine#48288)
Don't branch on uniform for decal support in GLES backend.
2023-11-27 03:03:15 +00:00
Jonah Williams
0ba4edc764 [Impeller] OES extension does not apply to regular textures for decal support (flutter/engine#48388)
This extension only implies decal support for OES textures. Remove it from the check for generic decal support.

In practice i think it would be unlikely that a driver supports this and not regular decal, but that would only make the bugs this may cause even harder to track down.
2023-11-27 03:03:13 +00:00
skia-flutter-autoroll
ddef9843d6 Roll Skia from b18b594b230d to 0eea0b277d7d (7 revisions) (flutter/engine#48387)
https://skia.googlesource.com/skia.git/+log/b18b594b230d..0eea0b277d7d

2023-11-26 johnstiles@google.com Use SkToInt to avoid warning in Flutter roll.
2023-11-26 skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com Update SKP version
2023-11-26 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 2e96f5c2b566 to 860dca03b6e7 (1 revision)
2023-11-26 bungeman@google.com IWYU for modules/skshaper
2023-11-25 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 95073d786075 to 2e96f5c2b566 (1 revision)
2023-11-24 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 2ddf0aa40843 to 95073d786075 (2 revisions)
2023-11-24 johnstiles@google.com Avoid combining extremely large meshes.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jcgregorio@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-26 18:19:02 +00:00
skia-flutter-autoroll
377e5f358e Roll Fuchsia Linux SDK from P3HXI8K3eIeoBYhdX... to zHKuNuXtMPLbovc0j... (flutter/engine#48376)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-linux-sdk-flutter-engine
Please CC jacksongardner@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-25 22:38:37 +00:00
Brandon DeRosier
05f43a96aa [Flutter GPU] Raster encoding. First triangle! (flutter/engine#48314)
First triangle, in the framework! 🎉 

Adds shader libraries, pipelines, command buffers, render passes, etc.

* Light pipelines/shader objects. No optimization yet, pipeline warming
to come.
* "Dynamic" command style. Don't re-send bindings if you don't need to.
Essentially: https://github.com/flutter/flutter/issues/133179
* No need to explicitly encode passes.
* Minimal descriptor usage.
* Nothing is async, except for the optional command buffer completion
callback.

It took a bunch of experimenting to get here, but I think things are
starting to look pretty neat. :)

Todo:
* Land the shader bundle format/remove the testing hacks & fixtures that
piggyback off of the runtime effect system.
* Add remaining calls for blend config, clearing bindings, etc.
* Inconsistent error handling patterns that need cleanup.
* Maybe: Surface exceptions for validation errors.
* Handle the texture usage bitmask more elegantly.
2023-11-24 19:02:58 -08:00
skia-flutter-autoroll
1a0a4caee0 Roll Fuchsia Linux SDK from 4CZFCL5oL042nQihC... to P3HXI8K3eIeoBYhdX... (flutter/engine#48365)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-linux-sdk-flutter-engine
Please CC jacksongardner@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-24 21:43:23 +00:00
skia-flutter-autoroll
3901005fa0 Roll Skia from 094c3d963ba0 to 2c89bb28860b (1 revision) (flutter/engine#48341)
https://skia.googlesource.com/skia.git/+log/094c3d963ba0..2c89bb28860b

2023-11-23 skia-autoroll@skia-public.iam.gserviceaccount.com Roll skcms from 55204b9355dc to 3020b5f04bb1 (1 revision)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jamesgk@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-23 20:41:28 +00:00
skia-flutter-autoroll
fcd2169740 Roll Skia from fc9c5337e568 to 094c3d963ba0 (6 revisions) (flutter/engine#48340)
https://skia.googlesource.com/skia.git/+log/fc9c5337e568..094c3d963ba0

2023-11-23 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 05e2e582257c to f0dc22ba8111 (1 revision)
2023-11-23 michaelludwig@google.com [skif] Adjust blur engine tile mode support API
2023-11-23 skia-autoroll@skia-public.iam.gserviceaccount.com Roll ANGLE from 20eff9db7dc8 to fba482b7107c (3 revisions)
2023-11-23 skia-autoroll@skia-public.iam.gserviceaccount.com Roll SK Tool from b9831128db04 to 045bb58be5e6
2023-11-23 skia-autoroll@skia-public.iam.gserviceaccount.com Roll skcms from 111d4246b357 to 55204b9355dc (5 revisions)
2023-11-23 skia-autoroll@skia-public.iam.gserviceaccount.com Roll Dawn from bd6600c1bba7 to 1862fc490314 (21 revisions)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jamesgk@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-23 19:45:04 +00:00
skia-flutter-autoroll
294b3a70c1 Roll Fuchsia Linux SDK from IK4xyRtZkDwqT6pXA... to 4CZFCL5oL042nQihC... (flutter/engine#48338)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-linux-sdk-flutter-engine
Please CC jacksongardner@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-23 18:13:36 +00:00
林洵锋
23ed0d9d6a Fix not being able to hide iOS status bar via setEnabledSystemUIMode (flutter/engine#48271)
Fix https://github.com/flutter/flutter/issues/138604 and https://github.com/flutter/flutter/issues/138671

Related PR https://github.com/flutter/engine/pull/45351

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-11-23 00:49:13 +00:00
Mouad Debbar
4c20a233a8 [web] Hook the new JS API to the FlutterViewManager (flutter/engine#48283)
- Auto-generate view IDs.
- Views don't auto-register/auto-unregister anymore.
- Remove `EnginePlatformDispatcher.registerView/unregisterView` methods.
- Add `FlutterViewManager.createAndRegisterView/disposeAndUnregisterView/dispose` methods.
- Hook the `addView`/`removeView` JS APIs to `FlutterViewManager`.
2023-11-22 21:27:56 +00:00
skia-flutter-autoroll
c1ccce2457 Roll Skia from 3a79d7a618aa to 5606ef899116 (1 revision) (flutter/engine#48331)
https://skia.googlesource.com/skia.git/+log/3a79d7a618aa..5606ef899116

2023-11-22 jvanverth@google.com Reland "[graphite] Use colorspace matrix to handle RGB swizzle."

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jamesgk@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-22 21:27:53 +00:00
LouiseHsu
faa3e610ac Fix Share Screen Crash on iPad (flutter/engine#48220)
Fixes https://github.com/flutter/flutter/issues/138550

![Simulator Screenshot - iPad Air (5th generation) - 2023-11-21 at 03 33 37](https://github.com/flutter/engine/assets/36148254/15e10e43-816b-43b1-a5ab-75c8add90899)
2023-11-22 20:49:58 +00:00
Dan Field
28fbba2098 Delete unused/test only code from FML (flutter/engine#48327)
This is more-or-less a revert of https://github.com/flutter/engine/pull/14011

This code never ended up being used outside of tests, and it's not how we handle asset loading at this point anyway.

I was hopeful we could kill off all runtime dependencies on Dart in `FML` when looking at this, but it looks like trace_event.h still wants to import dart_api_tools.h for some Dart enum types. This may or may not matter if we ever want to build FML for web/wasm. /cc @eyebrowsoffire. If we really need to do that, we can refactor the trace event stuff so that it has a web and Dart implementation that's selected at build time.
2023-11-22 20:49:56 +00:00
skia-flutter-autoroll
5bf972b2c7 Roll Skia from 30ecaac60b47 to 3a79d7a618aa (1 revision) (flutter/engine#48328)
https://skia.googlesource.com/skia.git/+log/30ecaac60b47..3a79d7a618aa

2023-11-22 johnstiles@google.com Replace STArray with trivial hand-written stack.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jamesgk@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-22 20:39:26 +00:00
auto-submit[bot]
4f2aeb7e76 Reverts "[Impeller] pass const ref to binding helpers." (flutter/engine#48330)
Reverts flutter/engine#48318
Initiated by: jonahwilliams
This change reverts the following previous change:
Original Description:
No point in passing by value and moving, just pass a const ref through. Trivial performance improvement.

# Before
```cpp
  /// Bind uniform buffer for resource named FragInfo.
  static bool BindFragInfo(ResourceBinder& command, BufferView view) {
    return command.BindResource(ShaderStage::kFragment, kResourceFragInfo, kMetadataFragInfo, std::move(view));
  }

  /// Bind combined image sampler for resource named texture_sampler.
  static bool BindTextureSampler(ResourceBinder& command, std::shared_ptr<const Texture> texture, std::shared_ptr<const Sampler> sampler) {
    return command.BindResource(ShaderStage::kFragment, kResourceTextureSampler, kMetadataTextureSampler, std::move(texture), std::move(sampler));
  }
  ```

# After
```cpp
  /// Bind uniform buffer for resource named FragInfo.
  static bool BindFragInfo(ResourceBinder& command, const BufferView& view) {
    return command.BindResource(ShaderStage::kFragment, kResourceFragInfo, kMetadataFragInfo, view);
  }

  /// Bind combined image sampler for resource named texture_sampler.
  static bool BindTextureSampler(ResourceBinder& command, const std::shared_ptr<const Texture>& texture, const std::shared_ptr<const Sampler>& sampler) {
    return command.BindResource(ShaderStage::kFragment, kResourceTextureSampler, kMetadataTextureSampler, texture, sampler);
  }
  ```
2023-11-22 20:09:17 +00:00
Jackson Gardner
7aba08366e Revert "Manual roll Dart SDK from f1fd14505782 to df958dc1ca7b (6 revisions)" (flutter/engine#48325)
Reverts flutter/engine#48316

3.3.0-158 breaks customer testing because of https://dart-review.googlesource.com/c/sdk/+/336244
2023-11-22 19:27:17 +00:00
Jonah Williams
c453bac49b [Impeller] cache render target properties on Render Pass. (flutter/engine#48323)
Otherwise we do three hashmap lookups everything we call OptionsFromPass(AndEntity) in a contents.

## Before
16 / 392 = 4%

![image](https://github.com/flutter/engine/assets/8975114/cf02778c-22da-4849-a98a-75bac7536284)

## After
6/ 458 = 1.3%

![image](https://github.com/flutter/engine/assets/8975114/13b58267-a25a-483d-a632-55f505070996)
2023-11-22 19:16:11 +00:00
Jonah Williams
2faace2ef2 [Impeller] pass const ref to binding helpers. (flutter/engine#48318)
No point in passing by value and moving, just pass a const ref through. Trivial performance improvement.

# Before
```cpp
  /// Bind uniform buffer for resource named FragInfo.
  static bool BindFragInfo(ResourceBinder& command, BufferView view) {
    return command.BindResource(ShaderStage::kFragment, kResourceFragInfo, kMetadataFragInfo, std::move(view));
  }

  /// Bind combined image sampler for resource named texture_sampler.
  static bool BindTextureSampler(ResourceBinder& command, std::shared_ptr<const Texture> texture, std::shared_ptr<const Sampler> sampler) {
    return command.BindResource(ShaderStage::kFragment, kResourceTextureSampler, kMetadataTextureSampler, std::move(texture), std::move(sampler));
  }
  ```

# After
```cpp
  /// Bind uniform buffer for resource named FragInfo.
  static bool BindFragInfo(ResourceBinder& command, const BufferView& view) {
    return command.BindResource(ShaderStage::kFragment, kResourceFragInfo, kMetadataFragInfo, view);
  }

  /// Bind combined image sampler for resource named texture_sampler.
  static bool BindTextureSampler(ResourceBinder& command, const std::shared_ptr<const Texture>& texture, const std::shared_ptr<const Sampler>& sampler) {
    return command.BindResource(ShaderStage::kFragment, kResourceTextureSampler, kMetadataTextureSampler, texture, sampler);
  }
  ```
2023-11-22 19:14:15 +00:00
LongCatIsLooong
59a5579465 Expose a few more glyph apis from ui.Paragraph (flutter/engine#47698)
Add 2 methods for querying glyph-related metrics

```dart
  GlyphInfo? getClosestGlyphInfoForOffset(Offset offset); 
  GlyphInfo? getGlyphInfoAt(int codeUnitOffset);
```

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-11-22 18:04:13 +00:00
skia-flutter-autoroll
c39c4f24d8 Roll Skia from efdec1f459ce to 9086788fc341 (2 revisions) (flutter/engine#48317)
https://skia.googlesource.com/skia.git/+log/efdec1f459ce..9086788fc341

2023-11-22 jvanverth@google.com Use sk_ieee_float_divide in SkMatrix::setRectToRect.
2023-11-22 kjlubick@google.com Reland "Reland "Remove other uses of SkFontMgr::RefDefault""

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jamesgk@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-22 17:29:09 +00:00
skia-flutter-autoroll
925d1e8cb4 Manual roll Dart SDK from f1fd14505782 to df958dc1ca7b (6 revisions) (flutter/engine#48316)
Manual roll requested by jacksongardner@google.com

https://dart.googlesource.com/sdk.git/+log/f1fd14505782..df958dc1ca7b

2023-11-22 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-158.0.dev
2023-11-21 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-157.0.dev
2023-11-21 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-156.0.dev
2023-11-21 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-155.0.dev
2023-11-21 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-154.0.dev
2023-11-21 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-153.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jacksongardner@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-22 17:03:14 +00:00
skia-flutter-autoroll
f44004197c Roll Skia from 2c68a803f497 to efdec1f459ce (2 revisions) (flutter/engine#48315)
https://skia.googlesource.com/skia.git/+log/2c68a803f497..efdec1f459ce

2023-11-22 jvanverth@google.com [graphite] Multiply by inverse texture size to normalize image localCoords
2023-11-22 nicolettep@google.com Revert "[graphite] Implement AHardwareBuffer BackendTexture creation for Vulkan"

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jamesgk@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-22 16:31:05 +00:00
skia-flutter-autoroll
e663563c6e Roll Skia from 23b9316efd20 to cebd44423589 (1 revision) (flutter/engine#48304)
https://skia.googlesource.com/skia.git/+log/23b9316efd20..cebd44423589

2023-11-22 skia-autoroll@skia-public.iam.gserviceaccount.com Roll skcms from c0be9bb8bc17 to 111d4246b357 (1 revision)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jamesgk@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-22 03:42:23 +00:00
Jonah Williams
811d365669 [Impeller] make host buffer state internally ref counted. (flutter/engine#48303)
std::shared_from_this is actually incredibly slow, and dominates the cost of host buffer allocation at 20x more expensive than the memcpy. We can remove the usage of shared_from_this by making an internal class hold the actual allocation/buffer state instead.

### Before

![image](https://github.com/flutter/engine/assets/8975114/d6cd69c7-de1d-4b05-bd76-1d9a3353e350)

146 ms / 647ms = ~20%
### After

33 ms / 540 ms = ~6%

![image](https://github.com/flutter/engine/assets/8975114/e624dd94-9718-404a-a0f8-b359df9f0109)
2023-11-22 03:24:18 +00:00
skia-flutter-autoroll
651c54111c Roll Skia from cac28f3634a3 to b6f33389cefa (1 revision) (flutter/engine#48299)
https://skia.googlesource.com/skia.git/+log/cac28f3634a3..b6f33389cefa

2023-11-22 johnstiles@google.com Revert "Reland "Remove other uses of SkFontMgr::RefDefault""

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jamesgk@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-22 01:00:05 +00:00
Jonah Williams
330c06a4f2 [Impeller] Dont copy the paint until we're sure that the RRect blur optimization will apply. (flutter/engine#48298)
Extremely minor micro optimization. Dont copy the paint too early.

Before

![image](https://github.com/flutter/engine/assets/8975114/b5884e02-25ed-4e53-a6e0-d8d5a6a9a79a)

13/269 = ~5%

After:

![image](https://github.com/flutter/engine/assets/8975114/ac5981bb-40c6-4a38-b24c-46b7ad5399a4)

3/262 = ~1%
2023-11-22 00:24:06 +00:00
Matan Lurey
d5b171165f Finish making shell/platform/linux/... compatible with .clang-tidy. (flutter/engine#48297) 2023-11-21 15:35:36 -08:00
Matan Lurey
aa6fdad4cd Finish making shell/platform/android/... compatible with .clang-tidy. (flutter/engine#48296) 2023-11-21 15:34:06 -08:00
Matan Lurey
b6f162e8b3 Finish making shell/common/... compatible with .clang-tidy. (flutter/engine#48295) 2023-11-21 15:33:43 -08:00
skia-flutter-autoroll
29e3f2edc7 Roll Fuchsia Linux SDK from Q3HcTitDF90ZOPWDa... to IK4xyRtZkDwqT6pXA... (flutter/engine#48294)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-linux-sdk-flutter-engine
Please CC jacksongardner@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-21 23:12:38 +00:00
skia-flutter-autoroll
f1f8c59fdf Roll Skia from c6d971f87d12 to cac28f3634a3 (12 revisions) (flutter/engine#48293)
https://skia.googlesource.com/skia.git/+log/c6d971f87d12..cac28f3634a3

2023-11-21 jvanverth@google.com Revert "[graphite] Use colorspace matrix to handle RGB swizzle."
2023-11-21 jvanverth@google.com [graphite] Use colorspace matrix to handle RGB swizzle.
2023-11-21 nicolettep@google.com [graphite] Implement AHardwareBuffer BackendTexture creation for Vulkan
2023-11-21 nicolettep@google.com [graphite] Add public Recorder method to create a BackendTexture from an AHardwareBuffer
2023-11-21 johnstiles@google.com Revert "[graphite] Add no-yield option to ContextOptions."
2023-11-21 kjlubick@google.com Remove MutableTextureStateRef and sketch out Vulkan-specific functions
2023-11-21 kjlubick@google.com Reland "Remove other uses of SkFontMgr::RefDefault"
2023-11-21 kjlubick@google.com Assert if null fallbackMgr used in FontMgrRunIterator
2023-11-21 johnstiles@google.com Enable individual feature flags in skcms with clang-cl.
2023-11-21 jvanverth@google.com [graphite] Remove RRRR swizzle.
2023-11-21 briansalomon@gmail.com [graphite] Add no-yield option to ContextOptions.
2023-11-21 skia-autoroll@skia-public.iam.gserviceaccount.com Roll skcms from 02a8c0638601 to c0be9bb8bc17 (2 revisions)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jamesgk@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-21 22:57:05 +00:00
gaaclarke
e80ecd9194 [Impeller] Switched to static linked libc++ in vulkan validation layers. (flutter/engine#48290)
fixes https://github.com/flutter/flutter/issues/138535
test coverage: existing integration tests in flutter repo which look for validation layers

I also verified locally that the `libc++.so` is no longer present and that it runs correctly.

```
$ find lib/arm64-v8a/
lib/arm64-v8a/
lib/arm64-v8a//libflutter.so
lib/arm64-v8a//libVkLayer_khronos_validation.so
```

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-11-21 22:06:05 +00:00
Matan Lurey
0b7f44c8c4 Yet more compliance with .clang_tidy, stragglers edition. (flutter/engine#48291)
Based off the
[failures](https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8763786250936903249/+/u/test:_test:_lint_host_debug/stdout)
in https://github.com/flutter/engine/pull/48145.

Nothing particularly interesting.
2023-11-21 13:39:18 -08:00
Jackson Gardner
4dacd0341d Update skia build file to account for new skcms changes. (flutter/engine#48286)
This should address https://github.com/flutter/flutter/issues/138838 which is blocking the skia roll.

This basically ports over the build rule changes from https://skia-review.googlesource.com/c/skia/+/777538
2023-11-21 21:12:05 +00:00
Matan Lurey
edb665c82d Make {shell|lib/ui}/... compatible with .clang_tidy. (flutter/engine#48242)
This is mostly just rename `ThreadHost::Type::{IDENTIFIER}` to
`kIdentifier`.

I also ignored some enum violations that are in public APIs.
2023-11-21 12:29:14 -08:00
Jonah Williams
753e9e6ac7 [Impeller] Ensure that overlay surfaces are constructed with wide gamut settings. (flutter/engine#48190)
Fixes https://github.com/flutter/flutter/issues/138373

When constructing overlay layers when there are platform views, make sure the same pixel format and color space as the main view is used.

Add validation to impeller HAL about blitting different pixel formats.
2023-11-21 20:29:05 +00:00
Matan Lurey
b1a29657a9 Make {flow|fml|impeller}/... compatible with .clang_tidy. (flutter/engine#48241)
Another few stragglers.
2023-11-21 18:53:06 +00:00
Jonah Williams
260ec88f60 [Impeller] preallocate command buffer to next power of two of entity list. (flutter/engine#48185)
Commands are massive 500 byte objects, re-allocating this vector while recording them can actually add a substantial amount of overhead to applications with lots of drawing commands. Sizing to npot so that underestimating by a few commands doesn't force us to immediately copy all command objects.

This is still a herustic driven approach. An alternative exact approach would have entities/contents describe how many commands they would add. This may be more important for stencil then cover (depending on how we do it) since some contents would need to create two commands.
2023-11-21 18:12:20 +00:00
gaaclarke
e18e1d286c [Impeller] implements gaussian "blur halo" (flutter/engine#48149)
This makes the blurred item have a halo effect that is rendered outside of the bounds of the original thing that was rendered.

issue: https://github.com/flutter/flutter/issues/131580

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-11-21 16:47:24 +00:00
Zachary Anderson
e42d4109db Revert Dart SDK to 3.3.0-152.0.dev (flutter/engine#48272)
Revert for https://github.com/flutter/flutter/issues/138813
2023-11-21 08:07:11 -08:00
David Iglesias
b6a14724a8 [web] Add add/removeView JS methods. (flutter/engine#48106)
This PR adds:

* JS-interop types to expose addView/removeView from the running FlutterApp object on JavaScript.
  * Also, the options object that can be passed to `addView`.

### Issues:

* Fixes: https://github.com/flutter/flutter/issues/137377

### Info

Most interesting files:

* `app_bootstrap.dart` -> Adds the implementation for JS add/remove view.
* `js_app.dart` -> Adds the js-interop layer for the FlutterApp object, and the configuration type. (Two options: `hostElement` and `initialData`).
* `flutter_view_manager.dart` -> An abstraction over the `viewData` map that keeps related things together: viewData, js configuration options, register/unregister methods and a Stream<void> of modification events.

The rest of the changes were ""required"" to have a small demo that does anything (currently it lets me "register" views from javascript). I didn't add much in there, because probably it's already being worked on by @mdebbar; just fiddled with the constructor of the EngineFlutterView to create views from JS Config, and added a wrapper around the `viewData` map (`FlutterViewManager`) to prevent direct access to the Map.

## Usage

This is how I'm currently initializing my Flutter App, so I can "leak" the `flutterApp` to window and do things asynchronously after flutter loads:

```html
<script>
  window.addEventListener('load', async function(ev) {
    _flutter.loader.loadEntrypoint({
      onEntrypointLoaded: function(engineInitializer) {
        engineInitializer.initializeEngine({
          multiViewEnabled: true,
        }).then(function(appRunner) {
          return appRunner.runApp();
        }).then(onAppRunning);
      }
    });
    // Leak flutterApp to window so we can do async things...
    function onAppRunning(flutterApp) {
      console.log('Running app', flutterApp);
      window.flutterApp = flutterApp;
    }
  });
</script>
```

This to test:

 * Go on your JS console and use `flutterApp.addView({})` and see how that returns a Promise for the viewId it just added,
 * Now do `flutterApp.removeView(0)` (removes the implicitView), and see how everything starts crashing! (as expected) 
   * Get out of this weird state with a hot reload 🥳

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2023-11-21 15:30:07 +00:00
skia-flutter-autoroll
1a7fb0fac9 Roll Skia from c244996e79d6 to c6d971f87d12 (1 revision) (flutter/engine#48268)
https://skia.googlesource.com/skia.git/+log/c244996e79d6..c6d971f87d12

2023-11-21 briansalomon@gmail.com Fix Graphite-Dawn wasm build

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jamesgk@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-21 14:53:29 +00:00
skia-flutter-autoroll
418ffafcaa Roll Skia from 516357c42907 to c244996e79d6 (1 revision) (flutter/engine#48266)
https://skia.googlesource.com/skia.git/+log/516357c42907..c244996e79d6

2023-11-21 kjlubick@google.com Revert "Remove other uses of SkFontMgr::RefDefault"

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jamesgk@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-21 14:00:18 +00:00
skia-flutter-autoroll
3d2401779a Roll Dart SDK from f1fd14505782 to 64cbfa6c51e6 (1 revision) (flutter/engine#48257)
https://dart.googlesource.com/sdk.git/+log/f1fd14505782..64cbfa6c51e6

2023-11-21 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-153.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jonahwilliams@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-21 05:46:23 +00:00
YaTang
950ec4aed6 [PlatformView][Android]VirtualDisplay resize on Android31 and above (flutter/engine#47946)
Resolves: https://github.com/flutter/flutter/issues/128920
2023-11-20 19:16:02 -08:00
Matan Lurey
f0ccf7a9a3 [Impeller] Try replacing *desc with value/is_valid checks. (flutter/engine#48194)
Some discussion here:
https://discord.com/channels/608014603317936148/1175215129135153202.

In short, `*<std::optional>` is [undefined
behavior](https://en.cppreference.com/w/cpp/utility/optional/operator*).
After talking to @bdero we are considering that this should never
happen.

I thought of a few different approaches here, none of them are great.
However given that this class is used quite minimally, this seems to
jive with similar patterns we're using in scene/scene_context.

---

Feel free to push back or suggest alternatives, mostly proposing this to
get brain juices flowing.
2023-11-20 16:43:28 -08:00
skia-flutter-autoroll
c8d8eaf0f4 Roll Skia from 3876e576a38e to f8daeeb7f092 (1 revision) (flutter/engine#48249)
https://skia.googlesource.com/skia.git/+log/3876e576a38e..f8daeeb7f092

2023-11-20 briansalomon@gmail.com [graphite] Expose Dawn async buffer mapping through Buffer class

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jamesgk@google.com,jonahwilliams@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-21 00:03:24 +00:00
skia-flutter-autoroll
4cd10d0a1b Roll Skia from c9943f14039f to 3876e576a38e (3 revisions) (flutter/engine#48246)
https://skia.googlesource.com/skia.git/+log/c9943f14039f..3876e576a38e

2023-11-20 kjlubick@google.com Pass TestFontMgr in when deserializing skps in dm
2023-11-20 kjlubick@google.com Remove other uses of SkFontMgr::RefDefault
2023-11-20 johnstiles@google.com Replace -march= with -mfeature toggles.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jamesgk@google.com,jonahwilliams@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2023-11-20 22:50:21 +00:00
Matan Lurey
f9adfbc62c Make runtime/... and shell/common/... compatible with .clang-tidy. (flutter/engine#48158) 2023-11-20 14:31:49 -08:00