Skip to content

[Impeller] mask blur with gradient doesn't render correctly for inner/outer blur styles #144449

@gaaclarke

Description

@gaaclarke

reproduction

TEST_P(AiksTest, GaussianBlurStyleInnerGradient) {
  Canvas canvas;
  canvas.Scale(GetContentScale());

  canvas.DrawPaint({.color = Color(0.1, 0.1, 0.1, 1.0)});

  Paint paint;
  paint.color = Color::Green();
  paint.mask_blur_descriptor = Paint::MaskBlurDescriptor{
      .style = FilterContents::BlurStyle::kInner,
      .sigma = Sigma(30),
  };

  std::vector<Color> colors = {Color{0.0, 0.7, 0.8, 1.0},
                               Color{0.0, 0.8, 0.7, 1.0}};
  std::vector<Scalar> stops = {0.0, 1.0};

  paint.color_source =
      ColorSource::MakeLinearGradient({0, 0}, {200, 200}, std::move(colors),
                                      std::move(stops), Entity::TileMode::kRepeat, {});

  canvas.DrawPath(PathBuilder()
                      .MoveTo({200, 200})
                      .LineTo({300, 400})
                      .LineTo({100, 400})
                      .Close()
                      .TakePath(),
                  paint);

  // Draw another thing to make sure the clip area is reset.
  Paint red;
  red.color = Color::Red();
  canvas.DrawRect(Rect::MakeXYWH(0, 0, 200, 200), red);

  ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}

observed output

Screenshot 2024-02-29 at 5 42 23 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work liste: impellerImpeller rendering backend issues and features requeststeam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions