Lines Matching refs:transform
562 SkMatrix44 transform(SkMatrix44::kIdentity_Constructor); in test_has_perspective() local
564 transform.setDouble(3, 2, -0.1); in test_has_perspective()
565 REPORTER_ASSERT(reporter, transform.hasPerspective()); in test_has_perspective()
567 transform.reset(); in test_has_perspective()
568 REPORTER_ASSERT(reporter, !transform.hasPerspective()); in test_has_perspective()
570 transform.setDouble(3, 0, -1.0); in test_has_perspective()
571 REPORTER_ASSERT(reporter, transform.hasPerspective()); in test_has_perspective()
573 transform.reset(); in test_has_perspective()
574 transform.setDouble(3, 1, -1.0); in test_has_perspective()
575 REPORTER_ASSERT(reporter, transform.hasPerspective()); in test_has_perspective()
577 transform.reset(); in test_has_perspective()
578 transform.setDouble(3, 2, -0.3); in test_has_perspective()
579 REPORTER_ASSERT(reporter, transform.hasPerspective()); in test_has_perspective()
581 transform.reset(); in test_has_perspective()
582 transform.setDouble(3, 3, 0.5); in test_has_perspective()
583 REPORTER_ASSERT(reporter, transform.hasPerspective()); in test_has_perspective()
585 transform.reset(); in test_has_perspective()
586 transform.setDouble(3, 3, 0.0); in test_has_perspective()
587 REPORTER_ASSERT(reporter, transform.hasPerspective()); in test_has_perspective()
601 static SkVector4 mul_with_persp_divide(const SkMatrix44& transform, const SkVector4& target) { in mul_with_persp_divide() argument
602 SkVector4 result = transform * target; in mul_with_persp_divide()
614 const SkMatrix44& transform) { in empirically_preserves_2d_axis_alignment() argument
622 p1 = mul_with_persp_divide(transform, p1); in empirically_preserves_2d_axis_alignment()
623 p2 = mul_with_persp_divide(transform, p2); in empirically_preserves_2d_axis_alignment()
624 p3 = mul_with_persp_divide(transform, p3); in empirically_preserves_2d_axis_alignment()
625 p4 = mul_with_persp_divide(transform, p4); in empirically_preserves_2d_axis_alignment()
630 static void test(bool expected, skiatest::Reporter* reporter, const SkMatrix44& transform) { in test() argument
632 REPORTER_ASSERT(reporter, empirically_preserves_2d_axis_alignment(reporter, transform)); in test()
633 REPORTER_ASSERT(reporter, transform.preserves2dAxisAlignment()); in test()
635 REPORTER_ASSERT(reporter, !empirically_preserves_2d_axis_alignment(reporter, transform)); in test()
636 REPORTER_ASSERT(reporter, !transform.preserves2dAxisAlignment()); in test()
641 SkMatrix44 transform; in test_preserves_2d_axis_alignment() local
685 transform.setIdentity(); in test_preserves_2d_axis_alignment()
686 transform.set(0, 0, value.a); in test_preserves_2d_axis_alignment()
687 transform.set(0, 1, value.b); in test_preserves_2d_axis_alignment()
688 transform.set(1, 0, value.c); in test_preserves_2d_axis_alignment()
689 transform.set(1, 1, value.d); in test_preserves_2d_axis_alignment()
691 test(value.expected, reporter, transform); in test_preserves_2d_axis_alignment()
698 transform.setIdentity(); in test_preserves_2d_axis_alignment()
699 transform.set(0, 0, value.a); in test_preserves_2d_axis_alignment()
700 transform.set(0, 1, value.b); in test_preserves_2d_axis_alignment()
701 transform.set(1, 0, value.c); in test_preserves_2d_axis_alignment()
702 transform.set(1, 1, value.d); in test_preserves_2d_axis_alignment()
704 transform.set(0, 2, 1.f); in test_preserves_2d_axis_alignment()
705 transform.set(0, 3, 2.f); in test_preserves_2d_axis_alignment()
706 transform.set(1, 2, 3.f); in test_preserves_2d_axis_alignment()
707 transform.set(1, 3, 4.f); in test_preserves_2d_axis_alignment()
708 transform.set(2, 0, 5.f); in test_preserves_2d_axis_alignment()
709 transform.set(2, 1, 6.f); in test_preserves_2d_axis_alignment()
710 transform.set(2, 2, 7.f); in test_preserves_2d_axis_alignment()
711 transform.set(2, 3, 8.f); in test_preserves_2d_axis_alignment()
713 test(value.expected, reporter, transform); in test_preserves_2d_axis_alignment()
720 transform.setIdentity(); in test_preserves_2d_axis_alignment()
721 transform.set(0, 0, value.a); in test_preserves_2d_axis_alignment()
722 transform.set(0, 1, value.b); in test_preserves_2d_axis_alignment()
723 transform.set(1, 0, value.c); in test_preserves_2d_axis_alignment()
724 transform.set(1, 1, value.d); in test_preserves_2d_axis_alignment()
726 transform.set(0, 2, 1.f); in test_preserves_2d_axis_alignment()
727 transform.set(0, 3, 2.f); in test_preserves_2d_axis_alignment()
728 transform.set(1, 2, 3.f); in test_preserves_2d_axis_alignment()
729 transform.set(1, 3, 4.f); in test_preserves_2d_axis_alignment()
730 transform.set(2, 0, 5.f); in test_preserves_2d_axis_alignment()
731 transform.set(2, 1, 6.f); in test_preserves_2d_axis_alignment()
732 transform.set(2, 2, 7.f); in test_preserves_2d_axis_alignment()
733 transform.set(2, 3, 8.f); in test_preserves_2d_axis_alignment()
734 transform.set(3, 0, 9.f); in test_preserves_2d_axis_alignment()
735 transform.set(3, 1, 10.f); in test_preserves_2d_axis_alignment()
736 transform.set(3, 2, 11.f); in test_preserves_2d_axis_alignment()
737 transform.set(3, 3, 12.f); in test_preserves_2d_axis_alignment()
739 test(false, reporter, transform); in test_preserves_2d_axis_alignment()
759 transform.setRotateDegreesAbout(value.a, value.b, value.c, value.d); in test_preserves_2d_axis_alignment()
760 test(value.expected, reporter, transform); in test_preserves_2d_axis_alignment()
781 transform.setRotateDegreesAbout(value.x1, value.y1, value.z1, value.degrees1); in test_preserves_2d_axis_alignment()
783 transform.postConcat(transform2); in test_preserves_2d_axis_alignment()
784 test(value.expected, reporter, transform); in test_preserves_2d_axis_alignment()
788 transform.setIdentity(); in test_preserves_2d_axis_alignment()
789 transform.setDouble(3, 2, -0.1); // Perspective depth 10 in test_preserves_2d_axis_alignment()
791 transform.preConcat(transform2); in test_preserves_2d_axis_alignment()
792 test(false, reporter, transform); in test_preserves_2d_axis_alignment()
794 transform.setIdentity(); in test_preserves_2d_axis_alignment()
795 transform.setDouble(3, 2, -0.1); // Perspective depth 10 in test_preserves_2d_axis_alignment()
797 transform.preConcat(transform2); in test_preserves_2d_axis_alignment()
798 test(true, reporter, transform); in test_preserves_2d_axis_alignment()