[Impeller] Fix the issue that 'coverage_coords' is incorrectly calculated in 'FillPathGeometry::GetPositionUVBuffer' (flutter/engine#42155)
fix https://github.com/flutter/flutter/issues/127183 ## without patch  ## whti patch 
This commit is contained in:
@@ -172,6 +172,13 @@ void CanRenderTiledTexture(AiksTest* aiks_test, Entity::TileMode tile_mode) {
|
||||
canvas.DrawRect({0, 0, 600, 600}, paint);
|
||||
}
|
||||
|
||||
// Should not change the image.
|
||||
PathBuilder path_builder;
|
||||
path_builder.AddCircle({150, 150}, 150);
|
||||
path_builder.AddRoundedRect(Rect::MakeLTRB(300, 300, 600, 600), 10);
|
||||
paint.style = Paint::Style::kFill;
|
||||
canvas.DrawPath(path_builder.TakePath(), paint);
|
||||
|
||||
ASSERT_TRUE(aiks_test->OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -207,8 +207,7 @@ GeometryResult FillPathGeometry::GetPositionUVBuffer(
|
||||
VS::PerVertexData data;
|
||||
data.position = points[i];
|
||||
auto coverage_coords =
|
||||
((points[i] - texture_coverage.origin) / texture_coverage.size) /
|
||||
texture_coverage.size;
|
||||
(points[i] - texture_coverage.origin) / texture_coverage.size;
|
||||
data.texture_coords = effect_transform * coverage_coords;
|
||||
vertex_builder.AppendVertex(data);
|
||||
}
|
||||
@@ -238,8 +237,7 @@ GeometryResult FillPathGeometry::GetPositionUVBuffer(
|
||||
Point vtx = {vertices[i], vertices[i + 1]};
|
||||
data.position = vtx;
|
||||
auto coverage_coords =
|
||||
((vtx - texture_coverage.origin) / texture_coverage.size) /
|
||||
texture_coverage.size;
|
||||
(vtx - texture_coverage.origin) / texture_coverage.size;
|
||||
data.texture_coords = effect_transform * coverage_coords;
|
||||
vertex_builder.AppendVertex(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user