blob: 4ff9a1d127e68ecdea02145d2f41ac8a3d9be77c [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
10#include "SkPath.h"
11#include "SkPathOpsCubic.h"
12#include "SkPathOpsLine.h"
13#include "SkPathOpsQuad.h"
caryclark@google.comd892bd82013-06-17 14:10:36 +000014#include "SkTArray.h"
caryclark@google.com07393ca2013-04-08 11:47:37 +000015
16union 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
caryclark@google.com07e97fc2013-07-08 17:17:02 +000026 static SkPath::Verb Cubic(const SkPoint pts[4], SkPoint* reducePts);
27 static SkPath::Verb Quad(const SkPoint pts[3], SkPoint* reducePts);
caryclark@google.com07393ca2013-04-08 11:47:37 +000028
29 SkDLine fLine;
30 SkDQuad fQuad;
31 SkDCubic fCubic;
32};
33
34#endif