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

Side by Side Diff: src/pathops/SkDQuadImplicit.cpp

Issue 23542056: path ops work in progress (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: verbose + mutex around file number access Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/pathops/SkDLineIntersection.cpp ('k') | src/pathops/SkDQuadIntersection.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 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
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 }
OLDNEW
« no previous file with comments | « src/pathops/SkDLineIntersection.cpp ('k') | src/pathops/SkDQuadIntersection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698