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

Unified Diff: src/pathops/SkPathOpsQuad.cpp

Issue 19543005: turn off debugging printfs (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove unused code Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pathops/SkPathOpsQuad.h ('k') | src/pathops/SkPathOpsRect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsQuad.cpp
diff --git a/src/pathops/SkPathOpsQuad.cpp b/src/pathops/SkPathOpsQuad.cpp
index 636e3854fd93c478b0ad8a4b48ddb13a558549f5..7d9ff52aa28c824b2192a28cd85ae5c8423bb18b 100644
--- a/src/pathops/SkPathOpsQuad.cpp
+++ b/src/pathops/SkPathOpsQuad.cpp
@@ -30,7 +30,7 @@ double SkDQuad::nearestT(const SkDPoint& pt) const {
double distMin = SkTMin(d0, d2);
int bestIndex = -1;
for (int index = 0; index < roots; ++index) {
- SkDPoint onQuad = xyAtT(ts[index]);
+ SkDPoint onQuad = ptAtT(ts[index]);
double dist = pt.distanceSquared(onQuad);
if (distMin > dist) {
distMin = dist;
@@ -57,7 +57,7 @@ SkDPoint SkDQuad::top(double startT, double endT) const {
double extremeT;
if (FindExtrema(sub[0].fY, sub[1].fY, sub[2].fY, &extremeT)) {
extremeT = startT + (endT - startT) * extremeT;
- SkDPoint test = xyAtT(extremeT);
+ SkDPoint test = ptAtT(extremeT);
if (topPt.fY > test.fY || (topPt.fY == test.fY && topPt.fX > test.fX)) {
topPt = test;
}
@@ -165,7 +165,13 @@ SkDVector SkDQuad::dxdyAtT(double t) const {
}
// OPTIMIZE: assert if caller passes in t == 0 / t == 1 ?
-SkDPoint SkDQuad::xyAtT(double t) const {
+SkDPoint SkDQuad::ptAtT(double t) const {
+ if (0 == t) {
+ return fPts[0];
+ }
+ if (1 == t) {
+ return fPts[2];
+ }
double one_t = 1 - t;
double a = one_t * one_t;
double b = 2 * one_t * t;
« no previous file with comments | « src/pathops/SkPathOpsQuad.h ('k') | src/pathops/SkPathOpsRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698