[web] Fix rendering of gradients in html mode (flutter/engine#40345)

<details>
<summary> Code Example</summary>
```dart
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class DemoGradientTransform implements GradientTransform {
@override
Matrix4? transform(Rect bounds, {TextDirection? textDirection}) {
return Matrix4.identity()
..scale(1.2, 1.7)
..rotateZ(0.25);
}
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
var colors = <Color>[
Colors.red,
Colors.green,
Colors.blue,
Colors.yellow,
];
const stops = <double>[0.0, 0.25, 0.5, 1.0];
return MaterialApp(
debugShowCheckedModeBanner: false,
home: GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: TileMode.values.length,
),
children: <Widget>[
for (final mode in TileMode.values)
DecoratedBox(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: colors,
stops: stops,
tileMode: mode,
transform: DemoGradientTransform(),
),
),
),
for (final mode in TileMode.values)
DecoratedBox(
decoration: BoxDecoration(
gradient: RadialGradient(
center: Alignment.topLeft,
radius: 0.5,
colors: colors,
stops: stops,
tileMode: mode,
transform: DemoGradientTransform(),
),
),
),
for (final mode in TileMode.values)
DecoratedBox(
decoration: BoxDecoration(
gradient: SweepGradient(
center: Alignment.topLeft,
startAngle: 0.0,
endAngle: 3.14,
colors: colors,
stops: stops,
tileMode: mode,
transform: DemoGradientTransform(),
),
),
),
],
),
);
}
}
```
</details>
Fixes: https://github.com/flutter/flutter/issues/84245