2013-04-08 11:50:46 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
#ifndef PathOpsTestCommon_DEFINED
|
|
|
|
#define PathOpsTestCommon_DEFINED
|
|
|
|
|
2015-10-16 16:03:38 +00:00
|
|
|
#include "SkPathOpsQuad.h"
|
2013-06-17 14:10:36 +00:00
|
|
|
#include "SkTArray.h"
|
2013-04-08 11:50:46 +00:00
|
|
|
|
2013-07-16 16:11:16 +00:00
|
|
|
struct SkPathOpsBounds;
|
|
|
|
|
2016-10-20 15:32:18 +00:00
|
|
|
struct QuadPts {
|
|
|
|
static const int kPointCount = 3;
|
|
|
|
SkDPoint fPts[kPointCount];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ConicPts {
|
|
|
|
QuadPts fPts;
|
|
|
|
SkScalar fWeight;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CubicPts {
|
|
|
|
static const int kPointCount = 4;
|
|
|
|
SkDPoint fPts[kPointCount];
|
|
|
|
};
|
|
|
|
|
2014-06-18 14:24:19 +00:00
|
|
|
void CubicPathToQuads(const SkPath& cubicPath, SkPath* quadPath);
|
|
|
|
void CubicPathToSimple(const SkPath& cubicPath, SkPath* simplePath);
|
2013-06-17 14:10:36 +00:00
|
|
|
void CubicToQuads(const SkDCubic& cubic, double precision, SkTArray<SkDQuad, true>& quads);
|
2015-04-20 15:31:59 +00:00
|
|
|
bool ValidBounds(const SkPathOpsBounds& );
|
|
|
|
bool ValidConic(const SkDConic& cubic);
|
2013-07-16 16:11:16 +00:00
|
|
|
bool ValidCubic(const SkDCubic& cubic);
|
|
|
|
bool ValidLine(const SkDLine& line);
|
|
|
|
bool ValidPoint(const SkDPoint& pt);
|
|
|
|
bool ValidPoints(const SkPoint* pts, int count);
|
|
|
|
bool ValidQuad(const SkDQuad& quad);
|
|
|
|
bool ValidVector(const SkDVector& v);
|
2013-04-08 11:50:46 +00:00
|
|
|
|
|
|
|
#endif
|