blob: 69ea0adb6f2dbe5b83b0a5bccfae69df118c840a [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
Mike Kleinc0bd9f92019-04-23 12:05:21 -050010#include "src/pathops/SkPathOpsCubic.h"
11#include "src/pathops/SkPathOpsLine.h"
12#include "src/pathops/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