Repository: flutter
Issue: [web on iOS] ShaderMask not working on iOS devices when using HTML renderer
Labels: c: new feature,platform-ios,engine,a: fidelity,platform-web,e: web_html,has reproducible steps,P3,found in release: 2.2,found in release: 2.3,team-engine,triaged-engine

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

On the flutter project template, replace main.dart with the following: 

<details> 
<summary>minimal code sample</summary> 

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Yo Mama',
      theme: ThemeData(platform: TargetPlatform.iOS),
      home: Scaffold(
        body: HomePage(),
      ),
    );
  }
}

class GradientText extends StatelessWidget {
  GradientText(
    this.text, {
    required this.gradient,
  });

  final String text;
  final Gradient gradient;

  @override
  Widget build(BuildContext context) {
    return ShaderMask(
      shaderCallback: (bounds) => gradient.createShader(
        Rect.fromLTWH(0, 0, bounds.width, bounds.height),
      ),
      child: Text(
        text,
        textScaleFactor: 10,
        style: TextStyle(
          color: Colors.white,
        ),
      ),
    );
  }
}

class HomePage extends StatefulWidget {
  HomePage({Key? key}) : super(key: key);

  @override
  State<StatefulWidget> createState() {
    return HomePageState();
  }
}

class HomePageState extends State<HomePage> {
  final Widget shadedText = Padding(
    padding: EdgeInsets.all(30.0),
    child: GradientText(
      "Shaded",
      gradient: LinearGradient(
        colors: [
          Colors.red,
          Colors.orange,
          Colors.yellow,
          Colors.green,
          Colors.blue,
          Colors.indigo,
          Colors.purple
        ],
      ),
    ),
  );

  @override
  Widget build(BuildContext context) {
    return Center(
      child: shadedText,
    );
  }
}
``` 

</details>

Then you'll have to deploy it (in my case, it's on firebase hosting). 
Commands used for deploying: 

`flutter build web`

`firebase deploy`

The web public folder is build/web

The issue does **not** show up if you perform flutter run -d chrome and use dev tools to switch to an iPhone style layout. 

The issue does **not** show up if you launch this as an app on an android emulator with `TargetPlatform.iOS` in the ThemeData

It only shows up when the project is actually hosted on firebase and visited from an iPhone. 

**Expected results:**
I expect the page to display this: (this is a screenshot from an android device)
| Preview | 
| --------------- | 
<img src="https://user-images.githubusercontent.com/24973509/123137421-9324fd80-d471-11eb-963a-50bdf08bcdd4.jpg" height="450" />	|


**Actual results:** <!-- what did you see? -->

What actually shows up is 

|**This is a screenshot from an iPhone X** | **This is a screenshot from an iPhone 6s Plus** |
| --------------- | --------------- |
<img src="https://user-images.githubusercontent.com/24973509/123137491-a506a080-d471-11eb-8b81-20183bbd0fbe.png" height="450" /> | <img src="https://user-images.githubusercontent.com/24973509/123139940-5e667580-d474-11eb-8553-7fdf86b8c681.png" height="450" /> |





<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

<details> 
<summary>logs</summary> 
	
```console
PS C:\Users\zacha\Desktop\FlutterProjects\www> flutter run -d chrome
Launching lib\main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...             15.2s
Debug service listening on ws://127.0.0.1:57502/-OXHGhuyHLE=/ws

 Running with sound null safety 

  To hot restart changes while running, press "r" or "R".
For a more detailed help message, press "h". To quit, press "q".

Application finished.
PS C:\Users\zacha\Desktop\FlutterProjects\www> flutter run -d chrome --verbose
[  +62 ms] executing: [C:\flutter\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +184 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +2 ms] d79295af24c3ed621c33713ecda14ad196fd9c31
[        ] executing: [C:\flutter\flutter/] git tag --points-at d79295af24c3ed621c33713ecda14ad196fd9c31
[  +54 ms] Exit code 0 from: git tag --points-at d79295af24c3ed621c33713ecda14ad196fd9c31
[        ] 2.2.2
[   +5 ms] executing: [C:\flutter\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +29 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [C:\flutter\flutter/] git ls-remote --get-url origin
[  +27 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +98 ms] executing: [C:\flutter\flutter/] git rev-parse --abbrev-ref HEAD
[  +29 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[  +80 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +57 ms] executing: C:\Users\zacha\AppData\Local\Android\Sdk\platform-tools\adb.exe devices -l
[  +36 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +56 ms] executing: C:\Users\zacha\AppData\Local\Android\Sdk\platform-tools\adb.exe devices -l
[  +11 ms] Skipping pub get: version match.
[  +95 ms] Generating
C:\Users\zacha\Desktop\FlutterProjects\www\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[  +72 ms] List of devices attached
[  +38 ms] Launching lib\main.dart on Chrome in debug mode...
[   +8 ms] List of devices attached
[  +99 ms] Updating assets
[  +61 ms] Waiting for connection from debug service on Chrome...
[  +95 ms] <- reset
[   +4 ms] C:\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev
C:\flutter\flutter\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root
C:\flutter\flutter\bin\cache\flutter_web_sdk/ --incremental --target=dartdevc --debugger-module-names --experimental-emit-debug-metadata   
-DFLUTTER_WEB_AUTO_DETECT=true --output-dill C:\Users\zacha\AppData\Local\Temp\flutter_tools.4a3843e2\flutter_tool.d6b3d0c5\app.dill       
--libraries-spec file:///C:/flutter/flutter/bin/cache/flutter_web_sdk/libraries.json --packages
C:\Users\zacha\Desktop\FlutterProjects\www\.dart_tool\package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts 
--track-widget-creation --filesystem-root C:\Users\zacha\AppData\Local\Temp\flutter_tools.4a3843e2\flutter_tools.839bb719
--filesystem-scheme org-dartlang-app --initialize-from-dill build\b1b715402d823b7fd5c2b68d2edcb2ce.cache.dill.track.dill --platform        
file:///C:/flutter/flutter/bin/cache/flutter_web_sdk/kernel/flutter_ddc_sdk_sound.dill --sound-null-safety
[   +9 ms] <- compile org-dartlang-app:/web_entrypoint.dart
[+13962 ms] Waiting for connection from debug service on Chrome... (completed in 14.1s)
[   +1 ms] Synced 28.2MB.
[        ] <- accept
[        ] Caching compiled dill
[+3339 ms] [CHROME]:
[   +1 ms] [CHROME]:DevTools listening on ws://127.0.0.1:63342/devtools/browser/65a8da9b-77bc-4438-b480-172c6bd02d61
[ +274 ms] DwdsInjector: Received request for entrypoint at http://localhost:64596/main_module.bootstrap.js
[   +9 ms] MetadataProvider: Loading debug metadata...
[  +14 ms] MetadataProvider: Loaded debug metadata (sound null safety)
[   +5 ms] DwdsInjector: Injected debugging metadata for entrypoint at http://localhost:64596/main_module.bootstrap.js
[+1305 ms] ChromeProxyService: Initializing expression compiler for main_module.bootstrap.js with sound null safety: true
[  +57 ms] DevHandler: Debug service listening on ws://127.0.0.1:49203/NMBFQsABLNo=/ws

[  +22 ms] This app is linked to the debug service: ws://127.0.0.1:49203/NMBFQsABLNo=/ws
[  +13 ms] Debug service listening on ws://127.0.0.1:49203/NMBFQsABLNo=/ws
[   +1 ms]  Running with sound null safety
[   +6 ms]   To hot restart changes while running, press "r" or "R".
[   +3 ms] For a more detailed help message, press "h". To quit, press "q".
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
PS C:\Users\zacha\Desktop\FlutterProjects\www> flutter analyze
Analyzing www...
No issues found! (ran in 1.6s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
PS C:\Users\zacha\Desktop\FlutterProjects\www> flutter doctor -v
[√] Flutter (Channel stable, 2.2.2, on Microsoft Windows [Version 10.0.19042.1052], locale en-IN)
    • Flutter version 2.2.2 at C:\flutter\flutter
    • Framework revision d79295af24 (12 days ago), 2021-06-11 08:56:01 -0700
    • Engine revision 91c9fc8fe0
    • Dart version 2.13.3

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\Users\zacha\AppData\Local\Android\Sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = C:\Users\zacha\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.8.2)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.8.30717.126
    • Windows 10 SDK version 10.0.18362.0

[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.57.1)
    • VS Code at C:\Users\zacha\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.23.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19042.1052]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 91.0.4472.114
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 91.0.864.54
```

</details>