Home | History | Annotate | Download | only in pathops
      1 /*
      2  * Copyright 2012 Google Inc.
      3  *
      4  * Use of this source code is governed by a BSD-style license that can be
      5  * found in the LICENSE file.
      6  */
      7 #ifndef SkReduceOrder_DEFINED
      8 #define SkReduceOrder_DEFINED
      9 
     10 #include "SkPathOpsCubic.h"
     11 #include "SkPathOpsLine.h"
     12 #include "SkPathOpsQuad.h"
     13 
     14 struct SkConic;
     15 
     16 union SkReduceOrder {
     17     enum Quadratics {
     18         kNo_Quadratics,
     19         kAllow_Quadratics
     20     };
     21 
     22     int reduce(const SkDCubic& cubic, Quadratics);
     23     int reduce(const SkDLine& line);
     24     int reduce(const SkDQuad& quad);
     25 
     26     static SkPath::Verb Conic(const SkConic& conic, SkPoint* reducePts);
     27     static SkPath::Verb Cubic(const SkPoint pts[4], SkPoint* reducePts);
     28     static SkPath::Verb Quad(const SkPoint pts[3], SkPoint* reducePts);
     29 
     30     SkDLine fLine;
     31     SkDQuad fQuad;
     32     SkDCubic fCubic;
     33 };
     34 
     35 #endif
     36