Kostia Sokolovskyi a7c0621241
[web] Add Paint dithering. (#170362)
Fixes https://github.com/flutter/flutter/issues/168798
Closes https://github.com/flutter/flutter/issues/134250

### Description
- Adds `Paint` dithering for gradient shaders in `canvaskit`
- Adds `Paint` dithering for gradient shaders in `skwasm`

### CanvasKit
| Before | After |
| - | - |
| <img width="739" alt="canvaskit_bug"
src="https://github.com/user-attachments/assets/cf15e6ff-e0ab-4bce-9db1-653271f5adc8"
/> | <img width="739" alt="canvaskit_fix"
src="https://github.com/user-attachments/assets/3aba09a5-f27a-4c17-a596-44b53961373e"
/> |

### SkWASM
| Before | After |
| - | - |
| <img width="739" alt="skwasm_bug"
src="https://github.com/user-attachments/assets/fe882450-f656-4a1b-9811-fdded5e4a737"
/> | <img width="739" alt="skwasm_fix"
src="https://github.com/user-attachments/assets/86bf2cf9-d743-453b-9d7a-600e293bf8f1"
/> |

<details>
<summary>Sample Source Code</summary>

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

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

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

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 400,
      height: 400,
      decoration: BoxDecoration(
        gradient: LinearGradient(
          colors: const [Color(0xff324958), Color(0xff26323a)],
          begin: Alignment.bottomLeft,
          end: Alignment.topRight,
        ),
      ),
    );
  }
}

```

</details>

## 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].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] 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-06-13 06:40:34 +00:00
..
2025-06-13 06:40:34 +00:00

Flutter Engine

Setting up the Engine development environment

See here

gclient bootstrap

Flutter engine uses gclient to manage dependencies.

If you've already cloned the flutter repository:

  1. Copy one of the engine/scripts/*.gclient to the root folder as .gclient:
    1. Googlers: copy rbe.gclient to enable faster builds with RBE
    2. Everyone else: copy standard.gclient
  2. run gclient sync from the root folder