diff options
Diffstat (limited to 'src/pathops/SkDQuadImplicit.h')
-rw-r--r-- | src/pathops/SkDQuadImplicit.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/pathops/SkDQuadImplicit.h b/src/pathops/SkDQuadImplicit.h new file mode 100644 index 0000000000..24f1aac2ef --- /dev/null +++ b/src/pathops/SkDQuadImplicit.h @@ -0,0 +1,39 @@ +/* + * 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 SkDQuadImplicit_DEFINED +#define SkDQuadImplicit_DEFINED + +#include "SkPathOpsQuad.h" + +class SkDQuadImplicit { +public: + explicit SkDQuadImplicit(const SkDQuad& q); + + bool match(const SkDQuadImplicit& two) const; + static bool Match(const SkDQuad& quad1, const SkDQuad& quad2); + + double x2() const { return fP[kXx_Coeff]; } + double xy() const { return fP[kXy_Coeff]; } + double y2() const { return fP[kYy_Coeff]; } + double x() const { return fP[kX_Coeff]; } + double y() const { return fP[kY_Coeff]; } + double c() const { return fP[kC_Coeff]; } + +private: + enum Coeffs { + kXx_Coeff, + kXy_Coeff, + kYy_Coeff, + kX_Coeff, + kY_Coeff, + kC_Coeff, + }; + + double fP[kC_Coeff + 1]; +}; + +#endif |