chromium/third_party/skia/src/base/SkCubics.cpp

/*
 * Copyright 2023 Google LLC
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "src/base/SkCubics.h"

#include "include/private/base/SkAssert.h"
#include "include/private/base/SkFloatingPoint.h"
#include "include/private/base/SkTPin.h"
#include "src/base/SkQuads.h"

#include <algorithm>
#include <cmath>

static constexpr double PI =;

static bool nearly_equal(double x, double y) {}

// When the A coefficient of a cubic is close to 0, there can be floating point error
// that arises from computing a very large root. In those cases, we would rather be
// precise about the smaller 2 roots, so we have this arbitrary cutoff for when A is
// really small or small compared to B.
static bool close_to_a_quadratic(double A, double B) {}

int SkCubics::RootsReal(double A, double B, double C, double D, double solution[3]) {}

int SkCubics::RootsValidT(double A, double B, double C, double D,
                          double solution[3]) {}

static bool approximately_zero(double x) {}

static int find_extrema_valid_t(double A, double B, double C,
                                double t[2]) {}

static double binary_search(double A, double B, double C, double D, double start, double stop) {}

int SkCubics::BinarySearchRootsValidT(double A, double B, double C, double D,
                                      double solution[3]) {}