88 Commits

Author SHA1 Message Date
Kate Lovett
a04fb324be
Bump Dart to 3.8 and reformat (#171703)
Bumps the Dart version to 3.8 across the repo (excluding
engine/src/flutter/third_party) and applies formatting updates from Dart
3.8.

## 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], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-07-07 17:58:32 +00:00
auto-submit[bot]
bf108a5474
Reverts "[Impeller] defer impeller context initialization onto the raster thread. (#167527)" (#167748)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#167527
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: gmackall
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: failing postsubmit `Linux_mokey
flutter_engine_group_performance`
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: jonahwilliams
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {jason-simmons}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
Attempt to speed up vulkan startup by ensuring vulkan driver
initialization happens on raster thread. Prev. we immediately
initialized the impeller::Context, unfortunately setting up the vulkan
context can take upwards of 100ms. This time is running on the platform
thread and blocking startup.

Instead, I attempt to hide/defer as much as possible what backend is
being used - this requires us to access the impeller context via a
shared_future in some cases instead of immediately knowing it is valid.

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-04-24 19:20:38 +00:00
Jonah Williams
97f358fd0a
[Impeller] defer impeller context initialization onto the raster thread. (#167527)
Attempt to speed up vulkan startup by ensuring vulkan driver
initialization happens on raster thread. Prev. we immediately
initialized the impeller::Context, unfortunately setting up the vulkan
context can take upwards of 100ms. This time is running on the platform
thread and blocking startup.

Instead, I attempt to hide/defer as much as possible what backend is
being used - this requires us to access the impeller context via a
shared_future in some cases instead of immediately knowing it is valid.
2025-04-24 17:35:25 +00:00
Jonah Williams
5f48a17123
[Impeller] Use device property uniform aligment instead of conservative value of 256. (#166884)
Fixes https://github.com/flutter/flutter/issues/132178

Rather than 256, use the device limits which may be substantially less.
Metal uses existing values and GLES still uses 256.
2025-04-10 18:00:17 +00:00
Tong Mu
97b5264fcc
Migrate in-comment links of the flutter/engine repository to the flutter/flutter repository (#166790)
This PR migrates almost all in-comment links that points to the main
branch of flutter/engine repository to the flutter/flutter repository,
ensuring that such links are always up to date.

I've manually verified that all links are valid. There are a few cases
where the migration is not so trivial and I had to look up for the
updated location or line number, but I'm pretty sure the new value is
correct.

The only place that I don't know how to migrate is two links in
[Upgrading-pre-1.12-Android-projects.md](https://github.com/flutter/flutter/blob/master/docs/platforms/android/Upgrading-pre-1.12-Android-projects.md)
pointing to
`https://github.com/flutter/engine/blob/main/shell/platform/android/io/flutter/app/FlutterActivity.java`,
which I guess no longer exists.

There are still many links that point to a specific branch or revision
of the engine repo. I don't think we need to migrate these links, since
they're probably not meant to be kept up to date.

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] 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/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-04-10 15:58:23 +00:00
Jonah Williams
3ef252e5b5
Add runtime flag for enable flutter_gpu, off by default. (#165337)
Flag flutter_gpu off by default.
2025-04-09 23:43:12 +00:00
AthulJoseph
f6b0598945
Added support to set viewport (#162602)
Resolves #157201.
2025-02-06 19:07:01 +00:00
Brandon DeRosier
039d0db698
[Flutter GPU] Breaking: Use exceptions for resource creation errors. (#162104)
Resolves https://github.com/flutter/flutter/issues/143891.

This patch includes breaking changes, but this API is still in preview.
* Breaking: Rename `Texture.GetBaseMipLevelSizeInBytes` to
`Texture.getBaseMipLevelSizeInBytes`.
* Breaking: Make `Texture.overwrite` throw exception instead of
returning false.
* Non-breaking: Make `DeviceBuffer`/`Texture` creation throw exceptions
instead of returning nullables.

We can incrementally add more specific exceptions for resource creation
failure.
2025-02-01 01:46:34 +00:00
Michael Goderbauer
8e0993eda8
Auto-format Dart code in engine (#160576)
This auto-formats all *.dart files in the `engine` subdirectory and
enforces that these files stay formatted with a presubmit check.
2024-12-19 17:13:07 +00:00
gaaclarke
3d8fc3c652 removed c style casts and enabled the lint (flutter/engine#57162)
test exempt: should have no functional change

## 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 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/blob/master/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/engine/blob/main/docs/testing/Testing-the-engine.md
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
2024-12-12 15:33:37 -08:00
Jonah Williams
fda902f593 [Impeller] exploit perfect hash for SamplerDescriptor. (flutter/engine#57036)
There are only 3 or 4 sampler's active at any given time in a flutter app. rather than store them in a hashmap, just use a vector.
2024-12-12 22:00:17 +00:00
Jonah Williams
e263222f14 [Impeller] reland: switch Pipeline to use raw ptr instead of shared ptr for recorded references. (flutter/engine#57086)
Prev: https://github.com/flutter/engine/pull/57015

There is a unit test that is clearing out the pipeline storage, manually null out captured PipelineRef.
2024-12-10 21:18:46 +00:00
gaaclarke
33306239b4 Revert "[Impeller] switch Pipeline to use raw ptr instead of shared ptr for recorded references." (flutter/engine#57079)
Reverts flutter/engine#57015
fixes https://github.com/flutter/flutter/issues/160004
2024-12-09 17:30:26 -08:00
Jonah Williams
81d3d7fbca [Impeller] switch Pipeline to use raw ptr instead of shared ptr for recorded references. (flutter/engine#57015)
Fixes https://github.com/flutter/flutter/issues/159566

We don't need recorded commands to keep pipelines alive as the context does that already.
2024-12-09 20:42:03 +00:00
Michael Goderbauer
75f9549553 Bump Dart SDK to 3.7 (flutter/engine#56989) 2024-12-06 01:41:03 +00:00
Jonah Williams
7b1b6d13f2 [Impeller] store GLES bindings on render pass w/ offsets instead of per-command. (flutter/engine#56910)
To reduce heap fragmentation from tons of little vectors.
2024-12-05 06:13:30 +00:00
Jonah Williams
240ce64b1f [Impeller] avoid heap allocation in RenderTarget object. (flutter/engine#56829)
All render targets created by flutter have a single color attachment. Lets specialize that case in impeller::RenderTarget by creating a field for that attachment description instead of placing it in a hashmap.
2024-12-04 17:28:13 +00:00
Jonah Williams
e8c3eefb21 [Impeller] dont use dynamic shader metadata path for precompiled shaders. (flutter/engine#56827)
Should fix https://github.com/flutter/flutter/issues/159520 ~~but I still need to check locally.~~ Seems to do the trick.

All cmd bindings were copying the shader metadata, which meant allocating/de-allocating a lot of strings per draw.
2024-11-27 17:21:09 +00:00
AthulJoseph
4705535548 [Flutter GPU] Added support to set Scissor. (flutter/engine#56302)
Added support to set scissors. This resolves issue #157199
2024-11-21 05:52:54 +00:00
gaaclarke
f81ed55e63 reland: Allow BufferViews to have non-owning references to DeviceBuffers (flutter/engine#56286)
relands https://github.com/flutter/engine/pull/56224

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-31 23:46:55 +00:00
auto-submit[bot]
528967bfae Reverts "Allow BufferViews to have non-owning references to DeviceBuffers (#56224)" (flutter/engine#56285)
Reverts: flutter/engine#56224
Initiated by: jonahwilliams
Reason for reverting: merge issue.
Original PR Author: gaaclarke

Reviewed By: {jonahwilliams}

This change reverts the following previous change:
issue: https://github.com/flutter/flutter/issues/157538

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-10-31 22:48:46 +00:00
gaaclarke
1d90823917 Allow BufferViews to have non-owning references to DeviceBuffers (flutter/engine#56224)
issue: https://github.com/flutter/flutter/issues/157538

## 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 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
[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
2024-10-31 15:28:10 -07:00
Brandon DeRosier
3fed10bf0d [Flutter GPU] Fix MSAA sample size and HostBuffer alignment. (flutter/engine#56218)
- Align HostBuffer emplacements properly (fix Metal validation failures).
- Correctly set the pipeline sample size.
- Throw an error when attempting to bind `deviceTransient` textures.
2024-10-29 22:52:21 +00:00
Brandon DeRosier
40062dbfe5 [Flutter GPU] Replace HostBuffer with Dart version. (flutter/engine#56054)
Resolves https://github.com/flutter/flutter/issues/157431.
2024-10-28 21:16:17 +00:00
Brandon DeRosier
026062f08b [Flutter GPU] Fix assert failure in createDeviceBufferWithCopy. (flutter/engine#56039)
Resolves https://github.com/flutter/flutter/issues/157336

`DartByteData` gets raw pointers into the Dart heap via `Dart_TypedDataAcquireData`. So it must be destructed before `AssociateWithDartWrapper` is called, which mutates the heap.

Re-enables failing test for Linux unopt.
2024-10-23 05:08:03 +00:00
Brandon DeRosier
3b568c8d68 [Flutter GPU] Fix conditional when checking DeviceBuffer bounds. (flutter/engine#56017)
Resolves https://github.com/flutter/flutter/issues/157324

Fix a silly off-by-one that I didn't catch because none of the tests are using `DeviceBuffer` directly. 🤦
2024-10-22 10:58:38 +00:00
Brandon DeRosier
493177b5ed [Flutter GPU] Add missing MSAA stuff. (flutter/engine#55424)
Resolves https://github.com/flutter/flutter/issues/144264.
2024-10-22 01:16:25 +00:00
Brandon DeRosier
518ada1675 [Flutter GPU] Remove Command/VertexBuffer usage from Flutter GPU. (flutter/engine#55893)
Resolves https://github.com/flutter/flutter/issues/156764.
Resolves https://github.com/flutter/flutter/issues/155335.

- Remove Command/VertexBuffer from Flutter GPU.
- Separate vertex/index count into `impeller::RenderPass::SetElementCount(size_t count)` & accurately document its behavior.
- Make Flutter GPU uniform/texture bindings re-assignable.
- Remove unnecessary templates.
2024-10-17 22:39:19 +00:00
Brandon DeRosier
50b5307332 [Impeller] Allow binding multiple vertex buffer views. (flutter/engine#55856)
Resolves https://github.com/flutter/flutter/issues/116168.
(Continuation of https://github.com/flutter/engine/pull/49670)

Makes it possible for us to use arbitrary vertex layouts, including SoA layouts with attributes stored in different DeviceBuffers. CanRenderPerspectiveCube was converted to an SoA attribute layout with two separate buffers as an example.

Works on all the backends!

OpenGLES:
<img width="1136" alt="image" src="https://github.com/user-attachments/assets/e2398fde-532f-402d-899a-39aaa556f24f">

Vulkan:
<img width="1136" alt="image" src="https://github.com/user-attachments/assets/1c1bf664-bec1-43cb-ab2e-eb2a74718bfd">

Metal:
<img width="1136" alt="image" src="https://github.com/user-attachments/assets/bf59da17-cf52-4913-88e4-ab6f0bd6fc96">
2024-10-15 01:13:52 +00:00
Brandon DeRosier
778e32ec0d [Flutter GPU] Remove unused fixture. (flutter/engine#55869)
I used this fixture data early on to bootstrap testing for Flutter GPU before shader bundles were finished. But today we have the build system compile shader bundles for us, so this is no longer used.
2024-10-15 00:10:21 +00:00
AthulJoseph
3214f65fa3 [Impeller] Added support to set polygon mode in Flutter GPU. (flutter/engine#55804)
Added support to set polygon mode in Flutter GPU. This fixes the issue [#142732](https://github.com/flutter/flutter/issues/142732).
2024-10-12 01:07:36 +00:00
Brandon DeRosier
e118869e40 [Flutter GPU] Get the GLES backend/Windows working. (flutter/engine#55694)
Resolves https://github.com/flutter/flutter/issues/156305.

* Resolve pipelines and submit command buffers on the raster thread.
* Don't use desktop GL shader variation on Windows.
* Fix interpretation of `array_elements`.
* Fix texture binding metadata.

Gets Flutter GPU working on Windows!
![image](https://github.com/user-attachments/assets/9eecb67f-a980-4556-8060-b0c947713534)
![image](https://github.com/user-attachments/assets/c8e2071f-e7c0-411c-8f37-e1f3037916f4)
2024-10-09 00:04:39 +00:00
AthulJoseph
a01daf5555 Added support to set primitive type (flutter/engine#55514)
Added a way to specify the PrimitiveType when encoding commands in the RenderPass.

This partially fixes the issue #142732
2024-10-08 21:57:10 +00:00
Brandon DeRosier
3b3ffcb8cd [Flutter GPU] Add WindingOrder. (flutter/engine#55413)
Resolves https://github.com/flutter/flutter/issues/155636.

(Extends test in https://github.com/flutter/engine/pull/55409)
2024-10-05 02:04:04 +00:00
Brandon DeRosier
31ac0fc004 [Flutter GPU] Use vm.Vector4 for clear color instead of ui.Color. (flutter/engine#55416)
Resolves https://github.com/flutter/flutter/issues/155627.

Allow setting the clear directly as floats without conversion work. vector_math already has convenient `Colors.[color]` factories and such. Also, `ui.Color` has a color space now, which does not apply here.

Adds a simple golden to verify that clear colors work:
![flutter_gpu_test_clear_color](https://github.com/user-attachments/assets/ba7a4e74-aaf2-48d8-ac13-115a86daeb19)
2024-09-25 18:02:05 +00:00
Brandon DeRosier
e496b1ed26 [Flutter GPU] Add CullMode. (flutter/engine#55409)
Part of https://github.com/flutter/flutter/issues/155636.

New golden `flutter_gpu_test_cull_mode` will draw a red triangle if the CullMode isn't working:
![flutter_gpu_test_cull_mode](https://github.com/user-attachments/assets/cbdf804e-1608-4352-9aa1-d5d9223f3c1a)
2024-09-25 00:52:11 +00:00
Brandon DeRosier
c4514370d7 [Flutter GPU] Add pipeline stencil config. (flutter/engine#55272)
Also adds a golden that depends on https://github.com/flutter/engine/pull/55270.
Resolves https://github.com/flutter/flutter/issues/142731.

Allow setting the stencil compare function, pass/fail operations, and read/write masks.

Flutter GPU has light "shader object" style programs, so all of the stencil configuration state can be set on the `RenderPass` at any time.

New simple golden that exercises stencil ops:
![flutter_gpu_test_triangle_stencil](https://github.com/user-attachments/assets/acc98cd9-41fc-4988-97a2-afb898a8fc0c)
2024-09-24 21:26:29 +00:00
Brandon DeRosier
7242297f80 [Flutter GPU] Add setStencilReference to RenderPass. (flutter/engine#55270) 2024-09-24 11:27:25 -07:00
Brandon DeRosier
a2fe41a763 [Flutter GPU] Remove the redundant smoketest. (flutter/engine#55267)
This is placeholder stuff that I added before the rest of the API to prove that we can call the engine symbols.

Today this is totally redundant as Flutter GPU has a bunch of automated tests which exercise every FFI call.
2024-09-17 22:24:07 +00:00
Brandon DeRosier
759d173073 [Flutter GPU] Add DeviceBuffer.flush & GpuContext.getMinimumUniformByteAlignment. (flutter/engine#53620)
Part of https://github.com/flutter/flutter/issues/150953.

Provide a way to get the required minimum uniform byte alignment when referencing uniform blocks in a device buffer. Allow the user to explicitly flush DeviceBuffers (necessary for devices without shared memory).
2024-09-17 20:31:50 +00:00
gaaclarke
df9fc7786b Reland: Framework wide color (#54415) (#54737) (flutter/engine#54905)
[This PR](https://github.com/flutter/engine/pull/54415) was reverted
because it required customer testing updates.

issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

This does the preliminary work for implementing wide gamut colors in the
Flutter framework. Here are the following changes: 1) colors now specify
a colorspace with which they are to be interpreted 1) colors now store
their components as floats to accommodate bit depths more than 8

The storage of this Color class is weird with float/int storage but that
is a temporary solution to support a smooth transition. Here is the plan
for landing this: 1) Land this PR
1) Wait for it to roll into the Framework
1) Land https://github.com/flutter/flutter/pull/153938 which will make
CupertinoDynamicColor implement Color 1) Land another engine PR that
rips out the int storage: https://github.com/flutter/engine/pull/54714

Here are follow up PRs:
1) https://github.com/flutter/engine/pull/54473 - changes DlColor so the
wide gamut colors are rendered 1)
https://github.com/flutter/engine/pull/54567 - Hooks up these changes to
take advantage of wide DlColor 1)
https://github.com/flutter/flutter/pull/153319 - the integration test
for the framework repo

There are some things that have been left as follow up PRs since they
are technically breaking: 1) The math on `lerp` hasn't been updated to
take advantage of the higher bit depth 1) `operator==` hasn't been
updated to take advantage of the higher bit depth 1) `hashCode` hasn't
been updated to take advantage of the higher bit depth 1) `alphaBlend`
hasn't been updated to take advantage of the higher bit depth 1)
`toString` hasn't been updated to take advantage of the higher bit depth

## Reland 2 notes

This was reverted because it changes the math on `_lerpDouble`. While
those changes were mathematcially equivalent, they had different
behaviors when working with non-numbers which created unexpected
changes. The change has been reverted and a test added.

## 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 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
[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
2024-08-30 10:33:07 -07:00
auto-submit[bot]
7b38e8d173 Reverts "Reland: Framework wide color (#54415) (#54737)" (flutter/engine#54885)
Reverts: flutter/engine#54737
Initiated by: chingjun
Reason for reverting: Breaking internal tests. See b/363125155
Original PR Author: gaaclarke

Reviewed By: {matanlurey, jonahwilliams}

This change reverts the following previous change:
[This PR](https://github.com/flutter/engine/pull/54415) was reverted because it requires a manual roll into the framework.

issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

This does the preliminary work for implementing wide gamut colors in the Flutter framework. Here are the following changes: 1) colors now specify a colorspace with which they are to be interpreted 1) colors now store their components as floats to accommodate bit depths more than 8

The storage of this Color class is weird with float/int storage but that is a temporary solution to support a smooth transition. Here is the plan for landing this:
1) Land this PR
1) Wait for it to roll into the Framework
1) Land https://github.com/flutter/flutter/pull/153938 which will make CupertinoDynamicColor implement Color
1) Land another engine PR that rips out the int storage: https://github.com/flutter/engine/pull/54714

Here are follow up PRs:
1) https://github.com/flutter/engine/pull/54473 - changes DlColor so the wide gamut colors are rendered
1) https://github.com/flutter/engine/pull/54567 - Hooks up these changes to take advantage of wide DlColor
1) https://github.com/flutter/flutter/pull/153319 - the integration test for the framework repo

There are some things that have been left as follow up PRs since they are technically breaking:
1) The math on `lerp` hasn't been updated to take advantage of the higher bit depth
1) `operator==` hasn't been updated to take advantage of the higher bit depth
1) `hashCode` hasn't been updated to take advantage of the higher bit depth
1) `alphaBlend` hasn't been updated to take advantage of the higher bit depth
1) `toString` hasn't been updated to take advantage of the higher bit depth
2024-08-30 04:31:26 +00:00
gaaclarke
3b2f540e54 Reland: Framework wide color (#54415) (flutter/engine#54737)
[This PR](https://github.com/flutter/engine/pull/54415) was reverted because it requires a manual roll into the framework.

issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

This does the preliminary work for implementing wide gamut colors in the Flutter framework. Here are the following changes: 1) colors now specify a colorspace with which they are to be interpreted 1) colors now store their components as floats to accommodate bit depths more than 8

The storage of this Color class is weird with float/int storage but that is a temporary solution to support a smooth transition. Here is the plan for landing this:
1) Land this PR
1) Wait for it to roll into the Framework
1) Land https://github.com/flutter/flutter/pull/153938 which will make CupertinoDynamicColor implement Color
1) Land another engine PR that rips out the int storage: https://github.com/flutter/engine/pull/54714

Here are follow up PRs:
1) https://github.com/flutter/engine/pull/54473 - changes DlColor so the wide gamut colors are rendered
1) https://github.com/flutter/engine/pull/54567 - Hooks up these changes to take advantage of wide DlColor
1) https://github.com/flutter/flutter/pull/153319 - the integration test for the framework repo

There are some things that have been left as follow up PRs since they are technically breaking:
1) The math on `lerp` hasn't been updated to take advantage of the higher bit depth
1) `operator==` hasn't been updated to take advantage of the higher bit depth
1) `hashCode` hasn't been updated to take advantage of the higher bit depth
1) `alphaBlend` hasn't been updated to take advantage of the higher bit depth
1) `toString` hasn't been updated to take advantage of the higher bit depth
2024-08-29 19:02:59 +00:00
Jim Graham
2932511ae8 Revert "Framework wide color" (flutter/engine#54728)
Reverts flutter/engine#54415

Reverting for failures in the engine roll: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8738846858081700577/+/u/run_test.dart_for_customer_testing_shard_and_subshard_None/stdout
2024-08-23 08:11:16 +00:00
gaaclarke
6f9776424c Framework wide color (flutter/engine#54415)
issue: https://github.com/flutter/flutter/issues/127855
integration test: https://github.com/flutter/engine/pull/54415

This does the preliminary work for implementing wide gamut colors in the
Flutter framework. Here are the following changes:
1) colors now specify a colorspace with which they are to be interpreted
1) colors now store their components as floats to accommodate bit depths
more than 8

The storage of this Color class is weird with float/int storage but that
is a temporary solution to support a smooth transition. Here is the plan
for landing this:
1) Land this PR
1) Wait for it to roll into the Framework
1) Land https://github.com/flutter/flutter/pull/153938 which will make
CupertinoDynamicColor implement Color
1) Land another engine PR that rips out the int storage:
https://github.com/flutter/engine/pull/54714

Here are follow up PRs:
1) https://github.com/flutter/engine/pull/54473 - changes DlColor so the
wide gamut colors are rendered
1) https://github.com/flutter/engine/pull/54567 - Hooks up these changes
to take advantage of wide DlColor
1) https://github.com/flutter/flutter/pull/153319 - the integration test
for the framework repo

There are some things that have been left as follow up PRs since they
are technically breaking:
1) The math on `lerp` hasn't been updated to take advantage of the
higher bit depth
1) `operator==` hasn't been updated to take advantage of the higher bit
depth
1) `hashCode` hasn't been updated to take advantage of the higher bit
depth
1) `alphaBlend` hasn't been updated to take advantage of the higher bit
depth
1) `toString` hasn't been updated to take advantage of the higher bit
depth

## 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 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
[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
2024-08-22 12:36:28 -07:00
Michael Thomsen
177a661383 Update dartdoc for gpu.dart (flutter/engine#54529)
Update dartdoc for package:flutter_gpu with:
1) details on how to use the sdk dep
2) the current docs link

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-08-13 21:16:15 +00:00
Michael Thomsen
7e52a7c53b Update pubspec.yaml for package:flutter_gpu (flutter/engine#54345)
Update readme for package:flutter_gpu to have an appropriate description
and, fill out the pub [repo
field](https://dart.dev/tools/pub/pubspec#repository).

## 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 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
[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
2024-08-06 12:21:38 +02:00
Brandon DeRosier
f6559124a1 [Flutter GPU] Generate DescriptorSetLayouts for pipelines & export symbols on Android. (flutter/engine#53184)
Part of https://github.com/flutter/flutter/issues/145011.

This gets Flutter GPU working on Android.
2024-06-11 11:25:29 -07:00
Brandon DeRosier
4a98184140 [Flutter GPU] Upload flutter_gpu.zip upon successful completion of ci/android_debug. (flutter/engine#53107)
Part of https://github.com/flutter/flutter/issues/131711.

Also, stops distributing `flutter_gpu` as part of the host artifacts, since it's not target-specific.

This enables us to use the same distribution mechanism as the `sky_engine` package.

Corresponding framework PR: https://github.com/flutter/flutter/pull/149299
2024-05-30 16:08:44 +00:00
auto-submit[bot]
ea811b97ba Reverts "Manual roll of Clang from 725656bdd885 to 145176dc0c93 (#52823)" (flutter/engine#52890)
Reverts: flutter/engine#52823
Initiated by: zanderso
Reason for reverting: Engine crashes on framework CI following this roll https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_android%20flutter_gallery__transition_perf_with_semantics/12126/overview
Original PR Author: jason-simmons

Reviewed By: {zanderso}

This change reverts the following previous change:
See https://github.com/flutter/flutter/issues/143178
2024-05-16 22:01:38 +00:00