Skip to content

[Impeller] Image drawn with MatrixImageFilter draws nothing at particular coordinates. #135916

@gaaclarke

Description

@gaaclarke

description

I noticed this bug when trying to reproduce #126583, it may be the same issue.

reproduction code

TEST_P(AiksTest, MatrixImageFilterMagnifyPan) {
  static uint64_t count = 0;

  auto callback = [&](AiksContext& renderer) -> std::optional<Picture> {
    Canvas canvas;
    canvas.Scale(GetContentScale());
    auto image = std::make_shared<Image>(CreateTextureForFixture("airplane.jpg"));
    Scalar x = 600 * sin(0.5 * 2.0 * 3.1415 * count / 60.0);
    Scalar y = 200 * sin(0.1 * 2.0 * 3.1415 * count++ / 60.0);
    canvas.Translate({x, y});
    canvas.SaveLayer({
        .image_filter = std::make_shared<MatrixImageFilter>(
            Matrix{
                2, 0, 0, 0,  //
                0, 2, 0, 0,  //
                0, 0, 2, 0,  //
                0, 0, 0, 1   //
            },
            SamplerDescriptor{}),
    });
    canvas.DrawImage(image, {0, 0}, Paint{.color = Color(1.0, 1.0, 1.0, 0.5)});
    canvas.Restore();
    return canvas.EndRecordingAsPicture();
  };

  ASSERT_TRUE(OpenPlaygroundHere(callback));
}

results

Notice that the plane image disappears when it gets to around x = -600.

disappear

cc @bdero

Metadata

Metadata

Assignees

No one assigned

    Labels

    e: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.team-engineOwned by Engine team

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions