Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion impeller/entity/geometry/fill_path_geometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ GeometryResult FillPathGeometry::GetPositionBuffer(
}

VertexBuffer vertex_buffer = renderer.GetTessellator()->TessellateConvex(
path_, host_buffer, entity.GetTransform().GetMaxBasisLength());
path_, host_buffer, entity.GetTransform().GetMaxBasisLengthXY());

return GeometryResult{
.type = PrimitiveType::kTriangleStrip,
Expand Down
2 changes: 1 addition & 1 deletion impeller/entity/geometry/stroke_path_geometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ GeometryResult StrokePathGeometry::GetPositionBuffer(
Scalar stroke_width = std::max(stroke_width_, min_size);

auto& host_buffer = renderer.GetTransientsBuffer();
auto scale = entity.GetTransform().GetMaxBasisLength();
auto scale = entity.GetTransform().GetMaxBasisLengthXY();

PositionWriter position_writer;
auto polyline = renderer.GetTessellator()->CreateTempPolyline(path_, scale);
Expand Down
15 changes: 0 additions & 15 deletions impeller/geometry/geometry_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -330,21 +330,6 @@ TEST(GeometryTest, MatrixTransformDirection) {
}
}

TEST(GeometryTest, MatrixGetMaxBasisLength) {
{
auto m = Matrix::MakeScale({3, 1, 1});
ASSERT_EQ(m.GetMaxBasisLength(), 3);

m = m * Matrix::MakeSkew(0, 4);
ASSERT_EQ(m.GetMaxBasisLength(), 5);
}

{
auto m = Matrix::MakeScale({-3, 4, 2});
ASSERT_EQ(m.GetMaxBasisLength(), 4);
}
}

TEST(GeometryTest, MatrixGetMaxBasisLengthXY) {
{
auto m = Matrix::MakeScale({3, 1, 1});
Expand Down
9 changes: 0 additions & 9 deletions impeller/geometry/matrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,6 @@ Scalar Matrix::GetDeterminant() const {
return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;
}

Scalar Matrix::GetMaxBasisLength() const {
Scalar max = 0;
for (int i = 0; i < 3; i++) {
max = std::max(max,
e[i][0] * e[i][0] + e[i][1] * e[i][1] + e[i][2] * e[i][2]);
}
return std::sqrt(max);
}

/*
* Adapted for Impeller from Graphics Gems:
* http://www.realtimerendering.com/resources/GraphicsGems/gemsii/unmatrix.c
Expand Down
2 changes: 0 additions & 2 deletions impeller/geometry/matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,6 @@ struct Matrix {

Scalar GetDeterminant() const;

Scalar GetMaxBasisLength() const;

constexpr Scalar GetMaxBasisLengthXY() const {
// The full basis computation requires computing the squared scaling factor
// for translate/scale only matrices. This substantially limits the range of
Expand Down