blob: ba64d931adcedc1cc1a0b987628d9ab8dc5bf656 [file] [log] [blame]
caryclark@google.com818b0cc2013-04-08 11:50:46 +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 PathOpsTestCommon_DEFINED
8#define PathOpsTestCommon_DEFINED
9
caryclark26ad22a2015-10-16 09:03:38 -070010#include "SkPathOpsQuad.h"
caryclark@google.comd892bd82013-06-17 14:10:36 +000011#include "SkTArray.h"
caryclark@google.com818b0cc2013-04-08 11:50:46 +000012
caryclark@google.com8d0a5242013-07-16 16:11:16 +000013struct SkPathOpsBounds;
14
caryclarka35ab3e2016-10-20 08:32:18 -070015struct QuadPts {
16 static const int kPointCount = 3;
17 SkDPoint fPts[kPointCount];
18};
19
20struct ConicPts {
21 QuadPts fPts;
22 SkScalar fWeight;
23};
24
25struct CubicPts {
26 static const int kPointCount = 4;
27 SkDPoint fPts[kPointCount];
28};
29
caryclarke4097e32014-06-18 07:24:19 -070030void CubicPathToQuads(const SkPath& cubicPath, SkPath* quadPath);
31void CubicPathToSimple(const SkPath& cubicPath, SkPath* simplePath);
caryclark@google.comd892bd82013-06-17 14:10:36 +000032void CubicToQuads(const SkDCubic& cubic, double precision, SkTArray<SkDQuad, true>& quads);
caryclark1049f122015-04-20 08:31:59 -070033bool ValidBounds(const SkPathOpsBounds& );
34bool ValidConic(const SkDConic& cubic);
caryclark@google.com8d0a5242013-07-16 16:11:16 +000035bool ValidCubic(const SkDCubic& cubic);
36bool ValidLine(const SkDLine& line);
37bool ValidPoint(const SkDPoint& pt);
38bool ValidPoints(const SkPoint* pts, int count);
39bool ValidQuad(const SkDQuad& quad);
caryclark@google.com8d0a5242013-07-16 16:11:16 +000040bool ValidVector(const SkDVector& v);
caryclark@google.com818b0cc2013-04-08 11:50:46 +000041
42#endif