diff --git a/impeller/aiks/aiks_unittests.cc b/impeller/aiks/aiks_unittests.cc index 0851fd7e0de82..ca96b494c4a86 100644 --- a/impeller/aiks/aiks_unittests.cc +++ b/impeller/aiks/aiks_unittests.cc @@ -59,7 +59,7 @@ TEST_F(AiksTest, CanRenderImage) { ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture())); } -TEST_F(AiksTest, DISABLED_CanRenderImageRect) { +TEST_F(AiksTest, CanRenderImageRect) { Canvas canvas; Paint paint; auto image = std::make_shared(CreateTextureForFixture("kalimba.jpg")); diff --git a/impeller/entity/contents.cc b/impeller/entity/contents.cc index 79b943721ff9a..f25a50d98c9b1 100644 --- a/impeller/entity/contents.cc +++ b/impeller/entity/contents.cc @@ -229,11 +229,15 @@ bool TextureContents::Render(const ContentContext& renderer, const auto tess_result = Tessellator{entity.GetPath().GetFillType()}.Tessellate( entity.GetPath().CreatePolyline(), - [&vertex_builder, &coverage_rect](Point vtx) { + [this, &vertex_builder, &coverage_rect, &texture_size](Point vtx) { VS::PerVertexData data; data.vertices = vtx; + auto coverage_coords = + (vtx - coverage_rect->origin) / coverage_rect->size; data.texture_coords = - ((vtx - coverage_rect->origin) / coverage_rect->size); + (source_rect_.origin + + source_rect_.size * coverage_coords) / + texture_size; vertex_builder.AppendVertex(data); }); if (!tess_result) {