blob: 7efb71d4fe6f62677704b2cf8e3e7b1f9ea0c05b [file] [log] [blame]
caryclark@google.com07393ca2013-04-08 11:47:37 +00001/*
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
caryclark@google.com07393ca2013-04-08 11:47:37 +000010#include "SkPathOpsCubic.h"
11#include "SkPathOpsLine.h"
12#include "SkPathOpsQuad.h"
caryclark@google.com07393ca2013-04-08 11:47:37 +000013
caryclark27c015d2016-09-23 05:47:20 -070014struct SkConic;
15
caryclark@google.com07393ca2013-04-08 11:47:37 +000016union SkReduceOrder {
17 enum Quadratics {
18 kNo_Quadratics,
19 kAllow_Quadratics
20 };
caryclark@google.com07393ca2013-04-08 11:47:37 +000021
caryclark@google.com927b7022013-11-25 14:18:21 +000022 int reduce(const SkDCubic& cubic, Quadratics);
caryclark@google.com07393ca2013-04-08 11:47:37 +000023 int reduce(const SkDLine& line);
caryclark@google.com927b7022013-11-25 14:18:21 +000024 int reduce(const SkDQuad& quad);
caryclark@google.com07393ca2013-04-08 11:47:37 +000025
caryclark27c015d2016-09-23 05:47:20 -070026 static SkPath::Verb Conic(const SkConic& conic, SkPoint* reducePts);
caryclark@google.com07e97fc2013-07-08 17:17:02 +000027 static SkPath::Verb Cubic(const SkPoint pts[4], SkPoint* reducePts);
28 static SkPath::Verb Quad(const SkPoint pts[3], SkPoint* reducePts);
caryclark@google.com07393ca2013-04-08 11:47:37 +000029
30 SkDLine fLine;
31 SkDQuad fQuad;
32 SkDCubic fCubic;
33};
34
35#endif