1/*
2 * Copyright 2018 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
8#ifndef SkPathOpsTCurve_DEFINED
9#define SkPathOpsTCurve_DEFINED
10
11#include "src/pathops/SkPathOpsPoint.h"
12
13class SkArenaAlloc;
14class SkIntersections;
15
16class SkTCurve {
17public:
18 virtual ~SkTCurve() {}
19 virtual const SkDPoint& operator[](int n) const = 0;
20 virtual SkDPoint& operator[](int n) = 0;
21
22 virtual bool collapsed() const = 0;
23 virtual bool controlsInside() const = 0;
24 virtual void debugInit() = 0;
25#if DEBUG_T_SECT
26 virtual void dumpID(int id) const = 0;
27#endif
28 virtual SkDVector dxdyAtT(double t) const = 0;
29 virtual bool hullIntersects(const SkDQuad& , bool* isLinear) const = 0;
30 virtual bool hullIntersects(const SkDConic& , bool* isLinear) const = 0;
31 virtual bool hullIntersects(const SkDCubic& , bool* isLinear) const = 0;
32 virtual bool hullIntersects(const SkTCurve& , bool* isLinear) const = 0;
33 virtual int intersectRay(SkIntersections* i, const SkDLine& line) const = 0;
34 virtual bool IsConic() const = 0;
35 virtual SkTCurve* make(SkArenaAlloc& ) const = 0;
36 virtual int maxIntersections() const = 0;
37 virtual void otherPts(int oddMan, const SkDPoint* endPt[2]) const = 0;
38 virtual int pointCount() const = 0;
39 virtual int pointLast() const = 0;
40 virtual SkDPoint ptAtT(double t) const = 0;
41 virtual void setBounds(SkDRect* ) const = 0;
42 virtual void subDivide(double t1, double t2, SkTCurve* curve) const = 0;
43#ifdef SK_DEBUG
44 virtual SkOpGlobalState* globalState() const = 0;
45#endif
46};
47
48#endif
49