blob: c167951f8bb121380cc94b7f260916820e583598 [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 };
21 enum Style {
22 kStroke_Style,
23 kFill_Style
24 };
25
26 int reduce(const SkDCubic& cubic, Quadratics, Style);
27 int reduce(const SkDLine& line);
28 int reduce(const SkDQuad& quad, Style);
29
caryclark@google.com07e97fc2013-07-08 17:17:02 +000030 static SkPath::Verb Cubic(const SkPoint pts[4], SkPoint* reducePts);
31 static SkPath::Verb Quad(const SkPoint pts[3], SkPoint* reducePts);
caryclark@google.com07393ca2013-04-08 11:47:37 +000032
33 SkDLine fLine;
34 SkDQuad fQuad;
35 SkDCubic fCubic;
36};
37
38#endif