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

Side by Side Diff: tests/MatrixTest.cpp

Issue 1413973002: Modifications to get 'blaze build -c opt //third_party/skia/HEAD/...' to work. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | tests/SRGBReadWritePixelsTest.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 "SkMath.h" 8 #include "SkMath.h"
9 #include "SkMatrix.h" 9 #include "SkMatrix.h"
10 #include "SkMatrixUtils.h" 10 #include "SkMatrixUtils.h"
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 return scalar_array_nearly_equal_relative(res, dst, 3); 657 return scalar_array_nearly_equal_relative(res, dst, 3);
658 } 658 }
659 659
660 static void test_matrix_homogeneous(skiatest::Reporter* reporter) { 660 static void test_matrix_homogeneous(skiatest::Reporter* reporter) {
661 SkMatrix mat; 661 SkMatrix mat;
662 662
663 const float kRotation0 = 15.5f; 663 const float kRotation0 = 15.5f;
664 const float kRotation1 = -50.f; 664 const float kRotation1 = -50.f;
665 const float kScale0 = 5000.f; 665 const float kScale0 = 5000.f;
666 666
667 #if defined(GOOGLE3)
668 // Stack frame size is limited in GOOGLE3.
669 const int kTripleCount = 100;
670 const int kMatrixCount = 100;
671 #else
667 const int kTripleCount = 1000; 672 const int kTripleCount = 1000;
668 const int kMatrixCount = 1000; 673 const int kMatrixCount = 1000;
674 #endif
669 SkRandom rand; 675 SkRandom rand;
670 676
671 SkScalar randTriples[3*kTripleCount]; 677 SkScalar randTriples[3*kTripleCount];
672 for (int i = 0; i < 3*kTripleCount; ++i) { 678 for (int i = 0; i < 3*kTripleCount; ++i) {
673 randTriples[i] = rand.nextRangeF(-3000.f, 3000.f); 679 randTriples[i] = rand.nextRangeF(-3000.f, 3000.f);
674 } 680 }
675 681
676 SkMatrix mats[kMatrixCount]; 682 SkMatrix mats[kMatrixCount];
677 for (int i = 0; i < kMatrixCount; ++i) { 683 for (int i = 0; i < kMatrixCount; ++i) {
678 for (int j = 0; j < 9; ++j) { 684 for (int j = 0; j < 9; ++j) {
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 a.setTranslate(10, 20); 939 a.setTranslate(10, 20);
934 940
935 SkMatrix b; 941 SkMatrix b;
936 b.setScale(3, 5); 942 b.setScale(3, 5);
937 943
938 SkMatrix expected; 944 SkMatrix expected;
939 expected.setConcat(a,b); 945 expected.setConcat(a,b);
940 946
941 REPORTER_ASSERT(r, expected == SkMatrix::Concat(a, b)); 947 REPORTER_ASSERT(r, expected == SkMatrix::Concat(a, b));
942 } 948 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | tests/SRGBReadWritePixelsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698