• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2009 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef SkConcaveToTriangles_DEFINED
18 #define SkConcaveToTriangles_DEFINED
19 
20 #include "SkPoint.h"
21 #include "SkTDArray.h"
22 
23 
24 // Triangulate a polygon.
25 // The polygon can be convex or concave, and can have holes or multiple contours
26 // of arbitrary recursion.
27 // The holes must have opposite orientation of the outer contours, whereas
28 // islands within the holes must have the same orientation as the outer contour.
29 // Contours should be joined by zero-thickness double-edges, to mimic a single
30 // polygon.  The polygon should not be self-intersecting.
31 // Currently, the outer contour must be right-handed, i.e. it should be oriented
32 // in the direction that rotates the X-axis to the Y-axis.
33 bool SkConcaveToTriangles(size_t count,
34                           const SkPoint pts[],
35                           SkTDArray<SkPoint> *triangles);
36 
37 
38 #endif  // SkConcaveToTriangles_DEFINED
39