1/* 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 10#include "SkPathOpsQuad.h" 11#include "SkTArray.h" 12 13struct SkPathOpsBounds; 14 15struct 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 30void CubicPathToQuads(const SkPath& cubicPath, SkPath* quadPath); 31void CubicPathToSimple(const SkPath& cubicPath, SkPath* simplePath); 32void CubicToQuads(const SkDCubic& cubic, double precision, SkTArray<SkDQuad, true>& quads); 33bool ValidBounds(const SkPathOpsBounds& ); 34bool ValidConic(const SkDConic& cubic); 35bool 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); 40bool ValidVector(const SkDVector& v); 41 42#endif 43