Skip to content

[Impeller] canvas.drawPaint does not handle gradients #111314

@dnfield

Description

@dnfield
import 'package:flutter/material.dart';

void main() {
  runApp(CustomPaint(painter: Painter()));
}

class Painter extends CustomPainter {
  @override
  void paint(Canvas canvas, Size size) {
    final Paint paint = Paint();
    paint.shader = const LinearGradient(
      begin: Alignment.centerLeft,
      end: Alignment.centerRight,
      colors: <Color>[Color(0xFF00FF00), Color(0xFF0000FF)],
    ).createShader(const Rect.fromLTRB(0, 0, 200, 200), textDirection: TextDirection.ltr);
    canvas.drawPaint(paint);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}

draws nothing at all.

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