Skip to content

[Impeller] Matrix image filter is not working as expected on master channel #111737

@ColdPaleLight

Description

@ColdPaleLight

code

import 'dart:ui' as ui;

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

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(
    MaterialApp(
      home: Container(
        color: Colors.blue,
        child: CustomPaint(
          painter: MyPaint(),
        ),
      ),
    ),
  );
}

class MyPaint extends CustomPainter {
  @override
  void paint(ui.Canvas canvas, ui.Size size) {
    ui.Paint paint = Paint();
    paint.color = Colors.red;
    paint.imageFilter = ui.ImageFilter.matrix(Float64List.fromList([
      1, 0, 0, 0, //
      0, 1, 0, 0, //
      0, 0, 1, 0, //
      100, 100, 0, 1, //
    ]));
    Rect rect = Rect.fromLTWH(0, 0, 100, 100);
    canvas.drawRect(rect, paint);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
    return true;
  }
}

expected results

Screenshot_2022-09-16-17-10-20-447_com yourcompany complexLayout

actual results

Screenshot_2022-09-16-17-10-01-569_com yourcompany complexLayout

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work liste: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions