1cb93a386Sopenharmony_ci/*
2cb93a386Sopenharmony_ci * Copyright 2012 Google Inc.
3cb93a386Sopenharmony_ci *
4cb93a386Sopenharmony_ci * Use of this source code is governed by a BSD-style license that can be
5cb93a386Sopenharmony_ci * found in the LICENSE file.
6cb93a386Sopenharmony_ci */
7cb93a386Sopenharmony_ci#ifndef PathOpsTestCommon_DEFINED
8cb93a386Sopenharmony_ci#define PathOpsTestCommon_DEFINED
9cb93a386Sopenharmony_ci
10cb93a386Sopenharmony_ci#include "include/private/SkTArray.h"
11cb93a386Sopenharmony_ci#include "src/pathops/SkPathOpsQuad.h"
12cb93a386Sopenharmony_ci
13cb93a386Sopenharmony_cistruct SkPathOpsBounds;
14cb93a386Sopenharmony_ci
15cb93a386Sopenharmony_cistruct QuadPts {
16cb93a386Sopenharmony_ci    static const int kPointCount = 3;
17cb93a386Sopenharmony_ci    SkDPoint fPts[kPointCount];
18cb93a386Sopenharmony_ci};
19cb93a386Sopenharmony_ci
20cb93a386Sopenharmony_cistruct ConicPts {
21cb93a386Sopenharmony_ci    QuadPts fPts;
22cb93a386Sopenharmony_ci    SkScalar fWeight;
23cb93a386Sopenharmony_ci};
24cb93a386Sopenharmony_ci
25cb93a386Sopenharmony_cistruct CubicPts {
26cb93a386Sopenharmony_ci    static const int kPointCount = 4;
27cb93a386Sopenharmony_ci    SkDPoint fPts[kPointCount];
28cb93a386Sopenharmony_ci};
29cb93a386Sopenharmony_ci
30cb93a386Sopenharmony_civoid CubicPathToQuads(const SkPath& cubicPath, SkPath* quadPath);
31cb93a386Sopenharmony_civoid CubicPathToSimple(const SkPath& cubicPath, SkPath* simplePath);
32cb93a386Sopenharmony_civoid CubicToQuads(const SkDCubic& cubic, double precision, SkTArray<SkDQuad, true>& quads);
33cb93a386Sopenharmony_cibool ValidBounds(const SkPathOpsBounds& );
34cb93a386Sopenharmony_cibool ValidConic(const SkDConic& cubic);
35cb93a386Sopenharmony_cibool ValidCubic(const SkDCubic& cubic);
36cb93a386Sopenharmony_cibool ValidLine(const SkDLine& line);
37cb93a386Sopenharmony_cibool ValidPoint(const SkDPoint& pt);
38cb93a386Sopenharmony_cibool ValidPoints(const SkPoint* pts, int count);
39cb93a386Sopenharmony_cibool ValidQuad(const SkDQuad& quad);
40cb93a386Sopenharmony_cibool ValidVector(const SkDVector& v);
41cb93a386Sopenharmony_ci
42cb93a386Sopenharmony_ci#endif
43