diff --git a/impeller/display_list/display_list_unittests.cc b/impeller/display_list/display_list_unittests.cc index 3ce405483022a..df45f0c9f4256 100644 --- a/impeller/display_list/display_list_unittests.cc +++ b/impeller/display_list/display_list_unittests.cc @@ -1056,9 +1056,11 @@ TEST_P(DisplayListTest, MaskBlursApplyCorrectlyToColorSources) { } TEST_P(DisplayListTest, DrawVerticesSolidColorTrianglesWithoutIndices) { - std::vector positions = {SkPoint::Make(100, 300), - SkPoint::Make(200, 100), - SkPoint::Make(300, 300)}; + // Use negative coordinates and then scale the transform by -1, -1 to make + // sure coverage is taking the transform into account. + std::vector positions = {SkPoint::Make(-100, -300), + SkPoint::Make(-200, -100), + SkPoint::Make(-300, -300)}; std::vector colors = {flutter::DlColor::kWhite(), flutter::DlColor::kGreen(), flutter::DlColor::kWhite()}; @@ -1071,6 +1073,7 @@ TEST_P(DisplayListTest, DrawVerticesSolidColorTrianglesWithoutIndices) { flutter::DlPaint paint; paint.setColor(flutter::DlColor::kRed().modulateOpacity(0.5)); + builder.scale(-1, -1); builder.drawVertices(vertices, flutter::DlBlendMode::kSrcOver, paint); ASSERT_TRUE(OpenPlaygroundHere(builder.Build())); diff --git a/impeller/display_list/display_list_vertices_geometry.cc b/impeller/display_list/display_list_vertices_geometry.cc index 1cab24c1fb861..e7ddf3a1a4923 100644 --- a/impeller/display_list/display_list_vertices_geometry.cc +++ b/impeller/display_list/display_list_vertices_geometry.cc @@ -241,7 +241,7 @@ GeometryVertexType DLVerticesGeometry::GetVertexType() const { std::optional DLVerticesGeometry::GetCoverage( const Matrix& transform) const { - return ToRect(vertices_->bounds()); + return ToRect(vertices_->bounds()).TransformBounds(transform); } } // namespace impeller