-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work liste: 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.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
It can reproduce on master channel.
Reproduce code
Code
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(
MaterialApp(
home: Container(
color: Colors.blue,
child: CustomPaint(
painter: MyPaint(),
),
),
),
);
}
const ColorFilter colorFilter = ColorFilter.matrix([
1.0, 0.0, 0.0, 0.0, 0.0, //
0.0, 1.0, 0.0, 0.0, 0.0, //
0.0, 0.0, 1.0, 0.0, 0.0, //
0.0, 0.0, 0.0, 2.0, 0.0, //
]);
class MyPaint extends CustomPainter {
@override
void paint(ui.Canvas canvas, ui.Size size) {
Rect rect = Rect.fromLTWH(0, 0, 100, 100);
ui.Paint paint1 = Paint();
paint1.color = Colors.white.withOpacity(0.5);
paint1.imageFilter = colorFilter;
canvas.saveLayer(null, paint1);
canvas.translate(100, 100);
canvas.drawRect(rect, Paint()..color = const Color(0xFFFF0000));
canvas.restore();
ui.Paint paint2 = Paint();
paint2.color = Colors.white.withOpacity(0.5);
paint2.colorFilter = colorFilter;
canvas.saveLayer(null, paint2);
canvas.translate(100, 300);
canvas.drawRect(rect, Paint()..color = const Color(0xFFFF0000));
canvas.restore();
}
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) {
return true;
}
}
Expected result
Actual result
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work liste: 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.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version

