Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: tests/Matrix44Test.cpp

Issue 23596006: Revise SVD code to remove arctangents. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix matrix_decompose bench to actually check random matrices. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/core/SkMatrixUtils.h ('k') | tests/MatrixTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Test.h" 8 #include "Test.h"
9 #include "SkMatrix44.h" 9 #include "SkMatrix44.h"
10 10
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 rot.setRotateDegreesAbout(0, 0, -1, 90); 506 rot.setRotateDegreesAbout(0, 0, -1, 90);
507 mat.postConcat(rot); 507 mat.postConcat(rot);
508 mat.postTranslate(1.0e-12, 1.0e-12, 1.0e-12); 508 mat.postTranslate(1.0e-12, 1.0e-12, 1.0e-12);
509 REPORTER_ASSERT(reporter, mat.invert(NULL)); 509 REPORTER_ASSERT(reporter, mat.invert(NULL));
510 mat.invert(&inverse); 510 mat.invert(&inverse);
511 iden1.setConcat(mat, inverse); 511 iden1.setConcat(mat, inverse);
512 REPORTER_ASSERT(reporter, is_identity(iden1)); 512 REPORTER_ASSERT(reporter, is_identity(iden1));
513 513
514 // test mixed-valued matrix inverse 514 // test mixed-valued matrix inverse
515 mat.reset(); 515 mat.reset();
516 mat.setScale(1.0e-10, 3.0, 1.0e+10); 516 mat.setScale(1.0e-11, 3.0, 1.0e+11);
517 rot.setRotateDegreesAbout(0, 0, -1, 90); 517 rot.setRotateDegreesAbout(0, 0, -1, 90);
518 mat.postConcat(rot); 518 mat.postConcat(rot);
519 mat.postTranslate(1.0e+10, 3.0, 1.0e-10); 519 mat.postTranslate(1.0e+11, 3.0, 1.0e-11);
520 REPORTER_ASSERT(reporter, mat.invert(NULL)); 520 REPORTER_ASSERT(reporter, mat.invert(NULL));
521 mat.invert(&inverse); 521 mat.invert(&inverse);
522 iden1.setConcat(mat, inverse); 522 iden1.setConcat(mat, inverse);
523 REPORTER_ASSERT(reporter, is_identity(iden1)); 523 REPORTER_ASSERT(reporter, is_identity(iden1));
524 524
525 // test degenerate matrix 525 // test degenerate matrix
526 mat.reset(); 526 mat.reset();
527 mat.set3x3(1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0); 527 mat.set3x3(1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0);
528 REPORTER_ASSERT(reporter, !mat.invert(NULL)); 528 REPORTER_ASSERT(reporter, !mat.invert(NULL));
529 529
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 test_transpose(reporter); 569 test_transpose(reporter);
570 test_get_set_double(reporter); 570 test_get_set_double(reporter);
571 test_set_row_col_major(reporter); 571 test_set_row_col_major(reporter);
572 test_translate(reporter); 572 test_translate(reporter);
573 test_scale(reporter); 573 test_scale(reporter);
574 test_map2(reporter); 574 test_map2(reporter);
575 } 575 }
576 576
577 #include "TestClassDef.h" 577 #include "TestClassDef.h"
578 DEFINE_TESTCLASS("Matrix44", Matrix44TestClass, TestMatrix44) 578 DEFINE_TESTCLASS("Matrix44", Matrix44TestClass, TestMatrix44)
OLDNEW
« no previous file with comments | « src/core/SkMatrixUtils.h ('k') | tests/MatrixTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698