• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "include/core/SkPath.h"
11 #include "src/pathops/SkPathOpsCubic.h"
12 #include "src/pathops/SkPathOpsLine.h"
13 #include "src/pathops/SkPathOpsQuad.h"
14 
15 struct SkConic;
16 struct SkPoint;
17 
18 union SkReduceOrder {
19     enum Quadratics {
20         kNo_Quadratics,
21         kAllow_Quadratics
22     };
23 
24     int reduce(const SkDCubic& cubic, Quadratics);
25     int reduce(const SkDLine& line);
26     int reduce(const SkDQuad& quad);
27 
28     static SkPath::Verb Conic(const SkConic& conic, SkPoint* reducePts);
29     static SkPath::Verb Cubic(const SkPoint pts[4], SkPoint* reducePts);
30     static SkPath::Verb Quad(const SkPoint pts[3], SkPoint* reducePts);
31 
32     SkDLine fLine;
33     SkDQuad fQuad;
34     SkDCubic fCubic;
35 };
36 
37 #endif
38