-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
flutter/engine
#46431Labels
e: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.
Description
I discovered this while updating the DL rendering tests to render with Impeller. There appears to be a coverage bounds calculation gone awry in this case. My suspicion is this line of code which looks like it is missing a ! on the translation test:
(Patching the missing ! on top of my Impeller test harness update indeed eliminates the problem).
sample code
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'SaveLayer DrawPaint issue'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: SizedBox(
width: 200,
height: 200,
child: CustomPaint(
painter: _MyPainter(),
),
),
),
);
}
}
class _MyPainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
Paint savePaint = Paint()
..imageFilter = ui.ImageFilter.blur(sigmaX: 5, sigmaY: 5);
canvas.saveLayer(null, savePaint);
Paint paint = Paint()
..shader = ui.Gradient.linear(
Offset.zero,
const Offset(2, 2),
<Color>[
Colors.blue,
Colors.green,
],
null,
TileMode.mirror,
);
canvas.drawPaint(paint);
canvas.restore();
}
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}
Metadata
Metadata
Assignees
Labels
e: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.