chromium/third_party/skia/src/pathops/SkPathOpsTypes.h

/*
 * 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 SkPathOpsTypes_DEFINED
#define SkPathOpsTypes_DEFINED

#include "include/core/SkPath.h"
#include "include/core/SkScalar.h"
#include "include/core/SkTypes.h"
#include "src/pathops/SkPathOpsDebug.h"

#include <cfloat>
#include <cmath>

enum SkPathOpsMask {};

class SkArenaAlloc;
class SkOpCoincidence;
class SkOpContour;
class SkOpContourHead;

enum class SkOpPhase : char {};

class SkOpGlobalState {};

#ifdef SK_DEBUG
#if DEBUG_COINCIDENCE
#define SkOPASSERT
#else
#define SkOPASSERT(cond)
#endif
#define SkOPOBJASSERT(obj, cond)
#else
#define SkOPASSERT
#define SkOPOBJASSERT
#endif

// Use Almost Equal when comparing coordinates. Use epsilon to compare T values.
bool AlmostEqualUlps(float a, float b);
inline bool AlmostEqualUlps(double a, double b) {}

bool AlmostEqualUlpsNoNormalCheck(float a, float b);
inline bool AlmostEqualUlpsNoNormalCheck(double a, double b) {}

bool AlmostEqualUlps_Pin(float a, float b);
inline bool AlmostEqualUlps_Pin(double a, double b) {}

// Use Almost Dequal when comparing should not special case denormalized values.
bool AlmostDequalUlps(float a, float b);
bool AlmostDequalUlps(double a, double b);

bool NotAlmostEqualUlps(float a, float b);
inline bool NotAlmostEqualUlps(double a, double b) {}

bool NotAlmostEqualUlps_Pin(float a, float b);
inline bool NotAlmostEqualUlps_Pin(double a, double b) {}

bool NotAlmostDequalUlps(float a, float b);
inline bool NotAlmostDequalUlps(double a, double b) {}

// Use Almost Bequal when comparing coordinates in conjunction with between.
bool AlmostBequalUlps(float a, float b);
inline bool AlmostBequalUlps(double a, double b) {}

bool AlmostPequalUlps(float a, float b);
inline bool AlmostPequalUlps(double a, double b) {}

bool RoughlyEqualUlps(float a, float b);
inline bool RoughlyEqualUlps(double a, double b) {}

bool AlmostLessUlps(float a, float b);
inline bool AlmostLessUlps(double a, double b) {}

bool AlmostLessOrEqualUlps(float a, float b);
inline bool AlmostLessOrEqualUlps(double a, double b) {}

bool AlmostBetweenUlps(float a, float b, float c);
inline bool AlmostBetweenUlps(double a, double b, double c) {}

int UlpsDistance(float a, float b);
inline int UlpsDistance(double a, double b) {}

// FLT_EPSILON == 1.19209290E-07 == 1 / (2 ^ 23)
// DBL_EPSILON == 2.22045e-16
const double FLT_EPSILON_CUBED =;
const double FLT_EPSILON_HALF =;
const double FLT_EPSILON_DOUBLE =;
const double FLT_EPSILON_ORDERABLE_ERR =;
const double FLT_EPSILON_SQUARED =;
// Use a compile-time constant for FLT_EPSILON_SQRT to avoid initializers.
// A 17 digit constant guarantees exact results.
const double FLT_EPSILON_SQRT =; // sqrt(FLT_EPSILON);
const double FLT_EPSILON_INVERSE =;
const double DBL_EPSILON_ERR =;  // FIXME: tune -- allow a few bits of error
const double DBL_EPSILON_SUBDIVIDE_ERR =;
const double ROUGH_EPSILON =;
const double MORE_ROUGH_EPSILON =;
const double WAY_ROUGH_EPSILON =;
const double BUMP_EPSILON =;

const SkScalar INVERSE_NUMBER_RANGE =;

inline bool zero_or_one(double x) {}

inline bool approximately_zero(double x) {}

inline bool precisely_zero(double x) {}

inline bool precisely_subdivide_zero(double x) {}

inline bool approximately_zero(float x) {}

inline bool approximately_zero_half(double x) {}

inline bool approximately_zero_double(double x) {}

inline bool approximately_zero_orderable(double x) {}

inline bool approximately_zero_squared(double x) {}

inline bool approximately_zero_sqrt(double x) {}

inline bool roughly_zero(double x) {}

inline bool approximately_zero_inverse(double x) {}

inline bool approximately_zero_when_compared_to(double x, double y) {}

inline bool precisely_zero_when_compared_to(double x, double y) {}

inline bool roughly_zero_when_compared_to(double x, double y) {}

// Use this for comparing Ts in the range of 0 to 1. For general numbers (larger and smaller) use
// AlmostEqualUlps instead.
inline bool approximately_equal(double x, double y) {}

inline bool precisely_equal(double x, double y) {}

inline bool precisely_subdivide_equal(double x, double y) {}

inline bool approximately_equal_half(double x, double y) {}

inline bool approximately_equal_double(double x, double y) {}

inline bool approximately_equal_orderable(double x, double y) {}

inline bool approximately_equal_squared(double x, double y) {}

inline bool approximately_greater(double x, double y) {}

inline bool approximately_greater_double(double x, double y) {}

inline bool approximately_greater_orderable(double x, double y) {}

inline bool approximately_greater_or_equal(double x, double y) {}

inline bool approximately_greater_or_equal_double(double x, double y) {}

inline bool approximately_greater_or_equal_orderable(double x, double y) {}

inline bool approximately_lesser(double x, double y) {}

inline bool approximately_lesser_double(double x, double y) {}

inline bool approximately_lesser_orderable(double x, double y) {}

inline bool approximately_lesser_or_equal(double x, double y) {}

inline bool approximately_lesser_or_equal_double(double x, double y) {}

inline bool approximately_lesser_or_equal_orderable(double x, double y) {}

inline bool approximately_greater_than_one(double x) {}

inline bool precisely_greater_than_one(double x) {}

inline bool approximately_less_than_zero(double x) {}

inline bool precisely_less_than_zero(double x) {}

inline bool approximately_negative(double x) {}

inline bool approximately_negative_orderable(double x) {}

inline bool precisely_negative(double x) {}

inline bool approximately_one_or_less(double x) {}

inline bool approximately_one_or_less_double(double x) {}

inline bool approximately_positive(double x) {}

inline bool approximately_positive_squared(double x) {}

inline bool approximately_zero_or_more(double x) {}

inline bool approximately_zero_or_more_double(double x) {}

inline bool approximately_between_orderable(double a, double b, double c) {}

inline bool approximately_between(double a, double b, double c) {}

inline bool precisely_between(double a, double b, double c) {}

// returns true if (a <= b <= c) || (a >= b >= c)
inline bool between(double a, double b, double c) {}

inline bool roughly_equal(double x, double y) {}

inline bool roughly_negative(double x) {}

inline bool roughly_between(double a, double b, double c) {}

inline bool more_roughly_equal(double x, double y) {}

inline SkPath::Verb SkPathOpsPointsToVerb(int points) {}

inline int SkPathOpsVerbToPoints(SkPath::Verb verb) {}

inline double SkDInterp(double A, double B, double t) {}

/* Returns -1 if negative, 0 if zero, 1 if positive
*/
inline int SkDSign(double x) {}

/* Returns 0 if negative, 1 if zero, 2 if positive
*/
inline int SKDSide(double x) {}

/* Returns 1 if negative, 2 if zero, 4 if positive
*/
inline int SkDSideBit(double x) {}

inline double SkPinT(double t) {}

#endif