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

Unified Diff: experimental/Intersection/CubicBounds.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/CubicBezierClip_Test.cpp ('k') | experimental/Intersection/CubicConvexHull.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/Intersection/CubicBounds.cpp
diff --git a/experimental/Intersection/CubicBounds.cpp b/experimental/Intersection/CubicBounds.cpp
deleted file mode 100644
index 7fd9feff6fa557490ba0868dc368ffc038874985..0000000000000000000000000000000000000000
--- a/experimental/Intersection/CubicBounds.cpp
+++ /dev/null
@@ -1,66 +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 "CurveIntersection.h"
-#include "CurveUtilities.h"
-#include "Extrema.h"
-
-static int isBoundedByEndPoints(double a, double b, double c, double d)
-{
- return between(a, b, d) && between(a, c, d);
-}
-
-double leftMostT(const Cubic& cubic, double startT, double endT) {
- double leftTs[2];
- _Point pt[2];
- int results = findExtrema(cubic[0].x, cubic[1].x, cubic[2].x, cubic[3].x, leftTs);
- int best = -1;
- for (int index = 0; index < results; ++index) {
- if (startT > leftTs[index] || leftTs[index] > endT) {
- continue;
- }
- if (best < 0) {
- best = index;
- continue;
- }
- xy_at_t(cubic, leftTs[0], pt[0].x, pt[0].y);
- xy_at_t(cubic, leftTs[1], pt[1].x, pt[1].y);
- if (pt[0].x > pt[1].x) {
- best = 1;
- }
- }
- if (best >= 0) {
- return leftTs[best];
- }
- xy_at_t(cubic, startT, pt[0].x, pt[0].y);
- xy_at_t(cubic, endT, pt[1].x, pt[1].y);
- return pt[0].x <= pt[1].x ? startT : endT;
-}
-
-void _Rect::setBounds(const Cubic& cubic) {
- set(cubic[0]);
- add(cubic[3]);
- double tValues[4];
- int roots = 0;
- if (!isBoundedByEndPoints(cubic[0].x, cubic[1].x, cubic[2].x, cubic[3].x)) {
- roots = findExtrema(cubic[0].x, cubic[1].x, cubic[2].x, cubic[3].x, tValues);
- }
- if (!isBoundedByEndPoints(cubic[0].y, cubic[1].y, cubic[2].y, cubic[3].y)) {
- roots += findExtrema(cubic[0].y, cubic[1].y, cubic[2].y, cubic[3].y, &tValues[roots]);
- }
- for (int x = 0; x < roots; ++x) {
- _Point result;
- xy_at_t(cubic, tValues[x], result.x, result.y);
- add(result);
- }
-}
-
-void _Rect::setRawBounds(const Cubic& cubic) {
- set(cubic[0]);
- for (int x = 1; x < 4; ++x) {
- add(cubic[x]);
- }
-}
« no previous file with comments | « experimental/Intersection/CubicBezierClip_Test.cpp ('k') | experimental/Intersection/CubicConvexHull.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698