Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions | Variables
SkPathOpsCubic.cpp File Reference
#include "src/pathops/SkPathOpsCubic.h"
#include "include/private/base/SkFloatingPoint.h"
#include "include/private/base/SkTPin.h"
#include "include/private/base/SkTo.h"
#include "src/base/SkTSort.h"
#include "src/core/SkGeometry.h"
#include "src/pathops/SkIntersections.h"
#include "src/pathops/SkLineParameters.h"
#include "src/pathops/SkPathOpsConic.h"
#include "src/pathops/SkPathOpsQuad.h"
#include "src/pathops/SkPathOpsRect.h"
#include "src/pathops/SkPathOpsTypes.h"
#include <algorithm>
#include <cmath>

Go to the source code of this file.

Functions

static void interp_cubic_coords (const double *src, double *dst, double t)
 
static double derivative_at_t (const double *src, double t)
 
static void formulate_F1DotF2 (const double src[], double coeff[4])
 
static double interp_cubic_coords (const double *src, double t)
 

Variables

static const double PI = 3.141592653589793
 

Function Documentation

◆ derivative_at_t()

static double derivative_at_t ( const double *  src,
double  t 
)
static

Definition at line 245 of file SkPathOpsCubic.cpp.

245 {
246 double one_t = 1 - t;
247 double a = src[0];
248 double b = src[2];
249 double c = src[4];
250 double d = src[6];
251 return 3 * ((b - a) * one_t * one_t + 2 * (c - b) * t * one_t + (d - c) * t * t);
252}
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition main.cc:19
static bool b
struct MyStruct a[10]

◆ formulate_F1DotF2()

static void formulate_F1DotF2 ( const double  src[],
double  coeff[4] 
)
static

Definition at line 539 of file SkPathOpsCubic.cpp.

539 {
540 double a = src[2] - src[0];
541 double b = src[4] - 2 * src[2] + src[0];
542 double c = src[6] + 3 * (src[2] - src[4]) - src[0];
543 coeff[0] = c * c;
544 coeff[1] = 3 * b * c;
545 coeff[2] = 2 * b * b + c * a;
546 coeff[3] = a * b;
547}

◆ interp_cubic_coords() [1/2]

static void interp_cubic_coords ( const double *  src,
double *  dst,
double  t 
)
static

Definition at line 94 of file SkPathOpsCubic.cpp.

94 {
95 double ab = SkDInterp(src[0], src[2], t);
96 double bc = SkDInterp(src[2], src[4], t);
97 double cd = SkDInterp(src[4], src[6], t);
98 double abc = SkDInterp(ab, bc, t);
99 double bcd = SkDInterp(bc, cd, t);
100 double abcd = SkDInterp(abc, bcd, t);
101
102 dst[0] = src[0];
103 dst[2] = ab;
104 dst[4] = abc;
105 dst[6] = abcd;
106 dst[8] = bcd;
107 dst[10] = cd;
108 dst[12] = src[6];
109}
double SkDInterp(double A, double B, double t)
Definition ab.py:1
dst
Definition cp.py:12

◆ interp_cubic_coords() [2/2]

static double interp_cubic_coords ( const double *  src,
double  t 
)
static

Definition at line 656 of file SkPathOpsCubic.cpp.

656 {
657 double ab = SkDInterp(src[0], src[2], t);
658 double bc = SkDInterp(src[2], src[4], t);
659 double cd = SkDInterp(src[4], src[6], t);
660 double abc = SkDInterp(ab, bc, t);
661 double bcd = SkDInterp(bc, cd, t);
662 double abcd = SkDInterp(abc, bcd, t);
663 return abcd;
664}

Variable Documentation

◆ PI

const double PI = 3.141592653589793
static

Definition at line 378 of file SkPathOpsCubic.cpp.