| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #include "SkDQuadImplicit.h" | 7 #include "SkDQuadImplicit.h" |
| 8 | 8 |
| 9 /* from http://tom.cs.byu.edu/~tom/papers/cvgip84.pdf 4.1 | 9 /* from http://tom.cs.byu.edu/~tom/papers/cvgip84.pdf 4.1 |
| 10 * | 10 * |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 bool SkDQuadImplicit::match(const SkDQuadImplicit& p2) const { | 96 bool SkDQuadImplicit::match(const SkDQuadImplicit& p2) const { |
| 97 int first = 0; | 97 int first = 0; |
| 98 for (int index = 0; index <= kC_Coeff; ++index) { | 98 for (int index = 0; index <= kC_Coeff; ++index) { |
| 99 if (approximately_zero(fP[index]) && approximately_zero(p2.fP[index])) { | 99 if (approximately_zero(fP[index]) && approximately_zero(p2.fP[index])) { |
| 100 first += first == index; | 100 first += first == index; |
| 101 continue; | 101 continue; |
| 102 } | 102 } |
| 103 if (first == index) { | 103 if (first == index) { |
| 104 continue; | 104 continue; |
| 105 } | 105 } |
| 106 if (!AlmostEqualUlps(fP[index] * p2.fP[first], fP[first] * p2.fP[index])
) { | 106 if (!AlmostDequalUlps(fP[index] * p2.fP[first], fP[first] * p2.fP[index]
)) { |
| 107 return false; | 107 return false; |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 return true; | 110 return true; |
| 111 } | 111 } |
| 112 | 112 |
| 113 bool SkDQuadImplicit::Match(const SkDQuad& quad1, const SkDQuad& quad2) { | 113 bool SkDQuadImplicit::Match(const SkDQuad& quad1, const SkDQuad& quad2) { |
| 114 SkDQuadImplicit i1(quad1); // a'xx , b'xy , c'yy , d'x , e'y , f | 114 SkDQuadImplicit i1(quad1); // a'xx , b'xy , c'yy , d'x , e'y , f |
| 115 SkDQuadImplicit i2(quad2); | 115 SkDQuadImplicit i2(quad2); |
| 116 return i1.match(i2); | 116 return i1.match(i2); |
| 117 } | 117 } |
| OLD | NEW |