Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit e4aaac6

Browse files
[Impeller] Use Matrix::MakeTranslateScale to compute the source-to-destination mapping in DrawImageRect (#56433)
1 parent d132ada commit e4aaac6

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

impeller/display_list/canvas.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -692,12 +692,7 @@ void Canvas::DrawImageRect(const std::shared_ptr<Texture>& image,
692692
Scalar sy = dest.GetHeight() / source.GetHeight();
693693
Scalar tx = dest.GetLeft() - source.GetLeft() * sx;
694694
Scalar ty = dest.GetTop() - source.GetTop() * sy;
695-
// clang-format off
696-
Matrix src_to_dest( sx, 0.0f, 0.0f, 0.0f,
697-
0.0f, sy, 0.0f, 0.0f,
698-
0.0f, 0.0f, 1.0f, 0.0f,
699-
tx, ty, 0.0f, 1.0f);
700-
// clang-format on
695+
Matrix src_to_dest = Matrix::MakeTranslateScale({sx, sy, 1}, {tx, ty, 0});
701696
dest = clipped_source->TransformBounds(src_to_dest);
702697
}
703698

0 commit comments

Comments
 (0)