@@ -156,29 +156,15 @@ static void TestBounds(const DlImageFilter& filter,
156156 ASSERT_FALSE (matrix.HasPerspective2D ()) << matrix;
157157 TestBoundsWithMatrix (filter, matrix, sourceBounds,
158158 expectedLocalOutputQuad);
159+ matrix.m [3 ] = 0 .001f ;
160+ matrix.m [7 ] = 0 .001f ;
161+ ASSERT_TRUE (matrix.IsInvertible ()) << matrix;
162+ ASSERT_TRUE (matrix.HasPerspective2D ()) << matrix;
163+ TestBoundsWithMatrix (filter, matrix, sourceBounds,
164+ expectedLocalOutputQuad);
159165 }
160166 }
161167 }
162-
163- {
164- // Just test once with a reasonable perspective transform. Combining
165- // perspective with all of the abusively scaled and skewed transforms
166- // created in the loop above tends to lead to coordinates growing out
167- // of any reasonable scale.
168- DlMatrix matrix;
169- matrix = matrix.Scale ({2 .0f , 2 .0f , 1 });
170- matrix = matrix.Translate ({1000 , 1000 , 500 });
171- // matrix = DlMatrix::MakeSkew(0.125f, 0.125f) * matrix;
172- matrix = DlMatrix::MakeRotationX (DlDegrees (5 )) * matrix;
173- // matrix = DlMatrix::MakeRotationY(DlDegrees(5)) * matrix;
174- // matrix = DlMatrix::MakeTranslation({0, 0, 5});
175- matrix = DlMatrix::MakePerspective (DlDegrees (60 ), 0.5 , -500 , 1000 ) * matrix;
176- // matrix = DlMatrix::MakeLookAt({0, 0, -10}, {0, 0, 10}, {0, 1, 0})
177- // * matrix;
178- ASSERT_TRUE (matrix.IsInvertible ()) << matrix;
179- ASSERT_TRUE (matrix.HasPerspective2D ()) << matrix;
180- TestBoundsWithMatrix (filter, matrix, sourceBounds, expectedLocalOutputQuad);
181- }
182168}
183169
184170static void TestBounds (const DlImageFilter& filter,
@@ -375,7 +361,7 @@ TEST(DisplayListImageFilter, ErodeNotEquals) {
375361
376362TEST (DisplayListImageFilter, ErodeBounds) {
377363 DlErodeImageFilter filter = DlErodeImageFilter (5 , 10 );
378- DlRect input_bounds = DlRect::MakeLTRB (20 , 20 , 80 , 80 ). Shift ( 100 , 100 ) ;
364+ DlRect input_bounds = DlRect::MakeLTRB (20 , 20 , 80 , 80 );
379365 DlRect expected_output_bounds = input_bounds.Expand (-5 , -10 );
380366 TestBounds (filter, input_bounds, expected_output_bounds);
381367}
0 commit comments