caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 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 "SkPath.h" |
| 11 | #include "SkPathOpsCubic.h" |
| 12 | #include "SkPathOpsLine.h" |
| 13 | #include "SkPathOpsQuad.h" |
caryclark@google.com | d892bd8 | 2013-06-17 14:10:36 +0000 | [diff] [blame] | 14 | #include "SkTArray.h" |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 15 | |
| 16 | union SkReduceOrder { |
| 17 | enum Quadratics { |
| 18 | kNo_Quadratics, |
| 19 | kAllow_Quadratics |
| 20 | }; |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 21 | |
caryclark@google.com | 927b702 | 2013-11-25 14:18:21 +0000 | [diff] [blame] | 22 | int reduce(const SkDCubic& cubic, Quadratics); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 23 | int reduce(const SkDLine& line); |
caryclark@google.com | 927b702 | 2013-11-25 14:18:21 +0000 | [diff] [blame] | 24 | int reduce(const SkDQuad& quad); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 25 | |
caryclark@google.com | 07e97fc | 2013-07-08 17:17:02 +0000 | [diff] [blame] | 26 | static SkPath::Verb Cubic(const SkPoint pts[4], SkPoint* reducePts); |
| 27 | static SkPath::Verb Quad(const SkPoint pts[3], SkPoint* reducePts); |
caryclark@google.com | 07393ca | 2013-04-08 11:47:37 +0000 | [diff] [blame] | 28 | |
| 29 | SkDLine fLine; |
| 30 | SkDQuad fQuad; |
| 31 | SkDCubic fCubic; |
| 32 | }; |
| 33 | |
| 34 | #endif |