Skip to content

[Impeller] Support Paint.enableDithering. #131450

@matanlurey

Description

@matanlurey

Parent issue: #118073.

Some notes:

Potential task items:

  • Consider making a standalone playground that shows the same dithering issue within Impeller
  • Get dithering working in the standalone playground
  • Get consensus we want this to work as implemented before continuing
  • Test RadialGradient for banding issues
  • Test SweepGradient for banding issues
  • Plumb Paint.enableDithering through to Impeller
  • Create a test that, with the Flutter framework + Impeller, supports dithering Edit: After talking to the engine team, we discovered that the place to do this (https://github.com/flutter/engine/blob/main/testing/dart/canvas_test.dart) relies on software rendering, and Impeller doesn't support it. For now, this will (like most of Impeller) be manual tested.

Note that we also talked about the fact that Paint.enableDithering is an API anti-pattern, i.e. it would better to either (a) dither by default (as loosely proposed in #112498, see also @Hixie's comment on #44134 (comment), and the conversation on flutter/engine#13868), or (b) perhaps better, make it a local flag (i.e. a bool or enum on LinearGradient or similar.

For sake of scope, we'll continue to target the existing Paint.enableDithering in this issue, and explore refactors after.

/cc @jonahwilliams @gaaclarke to keep me honest that the above looks reasonable.

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projecte: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine team

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions