blob: 397b58d927ef748833c7c2b9c7a28b2bb911f56d [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
14union SkReduceOrder {
15 enum Quadratics {
16 kNo_Quadratics,
17 kAllow_Quadratics
18 };
caryclark@google.com07393ca2013-04-08 11:47:37 +000019
caryclark@google.com927b7022013-11-25 14:18:21 +000020 int reduce(const SkDCubic& cubic, Quadratics);
caryclark@google.com07393ca2013-04-08 11:47:37 +000021 int reduce(const SkDLine& line);
caryclark@google.com927b7022013-11-25 14:18:21 +000022 int reduce(const SkDQuad& quad);
caryclark@google.com07393ca2013-04-08 11:47:37 +000023
caryclark@google.com07e97fc2013-07-08 17:17:02 +000024 static SkPath::Verb Cubic(const SkPoint pts[4], SkPoint* reducePts);
25 static SkPath::Verb Quad(const SkPoint pts[3], SkPoint* reducePts);
caryclark@google.com07393ca2013-04-08 11:47:37 +000026
27 SkDLine fLine;
28 SkDQuad fQuad;
29 SkDCubic fCubic;
30};
31
32#endif