Home | History | Annotate | Download | only in core
      1 
      2 /*
      3  * Copyright 2009 The Android Open Source Project
      4  *
      5  * Use of this source code is governed by a BSD-style license that can be
      6  * found in the LICENSE file.
      7  */
      8 
      9 
     10 #ifndef SkConcaveToTriangles_DEFINED
     11 #define SkConcaveToTriangles_DEFINED
     12 
     13 #include "SkPoint.h"
     14 #include "SkTDArray.h"
     15 
     16 
     17 // Triangulate a polygon.
     18 // The polygon can be convex or concave, and can have holes or multiple contours
     19 // of arbitrary recursion.
     20 // The holes must have opposite orientation of the outer contours, whereas
     21 // islands within the holes must have the same orientation as the outer contour.
     22 // Contours should be joined by zero-thickness double-edges, to mimic a single
     23 // polygon.  The polygon should not be self-intersecting.
     24 // Currently, the outer contour must be right-handed, i.e. it should be oriented
     25 // in the direction that rotates the X-axis to the Y-axis.
     26 bool SkConcaveToTriangles(size_t count,
     27                           const SkPoint pts[],
     28                           SkTDArray<SkPoint> *triangles);
     29 
     30 
     31 #endif  // SkConcaveToTriangles_DEFINED
     32