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

Unified Diff: experimental/Intersection/CubicLineSegments.cpp

Issue 867213004: remove prototype pathops code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | « experimental/Intersection/CubicLineSegments.h ('k') | experimental/Intersection/CubicParameterization.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/Intersection/CubicLineSegments.cpp
diff --git a/experimental/Intersection/CubicLineSegments.cpp b/experimental/Intersection/CubicLineSegments.cpp
deleted file mode 100644
index 58b7b85d4929b517596ce235fcdbf4f770ab9a65..0000000000000000000000000000000000000000
--- a/experimental/Intersection/CubicLineSegments.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#include "CubicLineSegments.h"
-#include "QuadraticLineSegments.h"
-
-// http://cagd.cs.byu.edu/~557/text/cagd.pdf 2.7
-// A hodograph is the first derivative curve
-void hodograph(const Cubic& cubic, Quadratic& hodo) {
- hodo[0].x = 3 * (cubic[1].x - cubic[0].x);
- hodo[0].y = 3 * (cubic[1].y - cubic[0].y);
- hodo[1].x = 3 * (cubic[2].x - cubic[1].x);
- hodo[1].y = 3 * (cubic[2].y - cubic[1].y);
- hodo[2].x = 3 * (cubic[3].x - cubic[2].x);
- hodo[2].y = 3 * (cubic[3].y - cubic[2].y);
-}
-
-// A 2nd hodograph is the second derivative curve
-void secondHodograph(const Cubic& cubic, _Line& hodo2) {
- Quadratic hodo;
- hodograph(cubic, hodo);
- hodograph(hodo, hodo2);
-}
-
-// The number of line segments required to approximate the cubic
-// see http://cagd.cs.byu.edu/~557/text/cagd.pdf 10.6
-double subDivisions(const Cubic& cubic) {
- _Line hodo2;
- secondHodograph(cubic, hodo2);
- double maxX = SkTMax(hodo2[1].x, hodo2[1].x);
- double maxY = SkTMax(hodo2[1].y, hodo2[1].y);
- double dist = sqrt(maxX * maxX + maxY * maxY);
- double segments = sqrt(dist / (8 * FLT_EPSILON));
- return segments;
-}
« no previous file with comments | « experimental/Intersection/CubicLineSegments.h ('k') | experimental/Intersection/CubicParameterization.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698