Skip to content

[Impeller] Color::Blend appears to have bugs and only be used in tests #128606

@dnfield

Description

@dnfield

@jonahwilliams @bdero fyi

We should remove this if it's really test-only.

If it's not test-only, we should fix it. Comparing, for example, the kOverlay implementation to skia:

Impeller:

      return apply_rgb_srcover_alpha([&](auto s, auto d) {
        if (d * 2 < dst.alpha) {
          return 2 * s * d;
        }
        return src.alpha * dst.alpha - 2 * (dst.alpha - s) * (src.alpha - d);
      });

Skia:

                return apply_rgb_srcover_a([&](auto s, auto d) {
                    return mma(s, 1-dst.a, d, 1-src.a) +
                           select(two(d) <= dst.a,
                                  two(s * d),
                                  src.a * dst.a - two((dst.a - d) * (src.a - s)));
                });

Skia has dst.a - d where we have dst.alpha - s (and a similar swap in the next one). Skia also has if 2 * d <= dst.a where we have if 2 * d < dst.alpha (so we're missing the equals part of less than or equals).

Metadata

Metadata

Assignees

Labels

P1High-priority issues 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