diff options
Diffstat (limited to 'libs/hwui/ShadowTessellator.cpp')
-rw-r--r-- | libs/hwui/ShadowTessellator.cpp | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/libs/hwui/ShadowTessellator.cpp b/libs/hwui/ShadowTessellator.cpp index fb28531..024ff10 100644 --- a/libs/hwui/ShadowTessellator.cpp +++ b/libs/hwui/ShadowTessellator.cpp @@ -158,71 +158,6 @@ Vector2 ShadowTessellator::calculateNormal(const Vector2& p1, const Vector2& p2) } return result; } -/** - * Test whether the polygon is order in clockwise. - * - * @param polygon the polygon as a Vector2 array - * @param len the number of points of the polygon - */ -bool ShadowTessellator::isClockwise(const Vector2* polygon, int len) { - if (len < 2 || polygon == nullptr) { - return true; - } - double sum = 0; - double p1x = polygon[len - 1].x; - double p1y = polygon[len - 1].y; - for (int i = 0; i < len; i++) { - - double p2x = polygon[i].x; - double p2y = polygon[i].y; - sum += p1x * p2y - p2x * p1y; - p1x = p2x; - p1y = p2y; - } - return sum < 0; -} - -bool ShadowTessellator::isClockwisePath(const SkPath& path) { - SkPath::Iter iter(path, false); - SkPoint pts[4]; - SkPath::Verb v; - - Vector<Vector2> arrayForDirection; - while (SkPath::kDone_Verb != (v = iter.next(pts))) { - switch (v) { - case SkPath::kMove_Verb: - arrayForDirection.add((Vector2){pts[0].x(), pts[0].y()}); - break; - case SkPath::kLine_Verb: - arrayForDirection.add((Vector2){pts[1].x(), pts[1].y()}); - break; - case SkPath::kConic_Verb: - case SkPath::kQuad_Verb: - arrayForDirection.add((Vector2){pts[1].x(), pts[1].y()}); - arrayForDirection.add((Vector2){pts[2].x(), pts[2].y()}); - break; - case SkPath::kCubic_Verb: - arrayForDirection.add((Vector2){pts[1].x(), pts[1].y()}); - arrayForDirection.add((Vector2){pts[2].x(), pts[2].y()}); - arrayForDirection.add((Vector2){pts[3].x(), pts[3].y()}); - break; - default: - break; - } - } - - return isClockwise(arrayForDirection.array(), arrayForDirection.size()); -} - -void ShadowTessellator::reverseVertexArray(Vertex* polygon, int len) { - int n = len / 2; - for (int i = 0; i < n; i++) { - Vertex tmp = polygon[i]; - int k = len - 1 - i; - polygon[i] = polygon[k]; - polygon[k] = tmp; - } -} int ShadowTessellator::getExtraVertexNumber(const Vector2& vector1, const Vector2& vector2, float divisor) { |