Flutter Engine
The Flutter Engine
Classes | Functions | Variables
PathOpsThreeWayTest.cpp File Reference
#include "include/core/SkTypes.h"
#include "include/private/base/SkMalloc.h"
#include "include/private/base/SkTDArray.h"
#include "src/pathops/SkIntersections.h"
#include "src/pathops/SkPathOpsCubic.h"
#include "src/pathops/SkPathOpsLine.h"
#include "src/pathops/SkPathOpsPoint.h"
#include "tests/PathOpsTestCommon.h"
#include "tests/Test.h"
#include <array>

Go to the source code of this file.

Classes

struct  Curve
 
struct  TestSet
 

Functions

static void testSetTest (skiatest::Reporter *reporter, int index)
 
 DEF_TEST (PathOpsThreeWay, reporter)
 
 DEF_TEST (PathOpsThreeWayOneOff, reporter)
 

Variables

static const Curve testSet0 []
 
static const Curve testSet1 []
 
static const struct TestSet testSets []
 
static const int testSetsCount = (int) std::size(testSets)
 

Function Documentation

◆ DEF_TEST() [1/2]

DEF_TEST ( PathOpsThreeWay  ,
reporter   
)

Definition at line 81 of file PathOpsThreeWayTest.cpp.

81 {
82 for (int index = 0; index < testSetsCount; ++index) {
83 testSetTest(reporter, index);
84 reporter->bumpTestCount();
85 }
86}
reporter
Definition: FontMgrTest.cpp:39
static const int testSetsCount
static void testSetTest(skiatest::Reporter *reporter, int index)

◆ DEF_TEST() [2/2]

DEF_TEST ( PathOpsThreeWayOneOff  ,
reporter   
)

Definition at line 88 of file PathOpsThreeWayTest.cpp.

88 {
89 int index = 0;
90 testSetTest(reporter, index);
91}

◆ testSetTest()

static void testSetTest ( skiatest::Reporter reporter,
int  index 
)
static

Definition at line 49 of file PathOpsThreeWayTest.cpp.

49 {
50 const TestSet& testSet = testSets[index];
51 int testCount = testSet.testCount;
54 for (int outer = 0; outer < testCount - 1; ++outer) {
55 const Curve& oTest = testSet.tests[outer];
56 for (int inner = outer + 1; inner < testCount; ++inner) {
57 const Curve& iTest = testSet.tests[inner];
58 SkIntersections* i = combos.append();
59 sk_bzero(i, sizeof(SkIntersections));
60 SkDLine oLine = {{ oTest.curve.fPts[0], oTest.curve.fPts[1] }};
61 SkDLine iLine = {{ iTest.curve.fPts[0], iTest.curve.fPts[1] }};
62 SkDCubic iCurve, oCurve;
63 iCurve.debugSet(iTest.curve.fPts);
64 oCurve.debugSet(oTest.curve.fPts);
65 if (oTest.ptCount == 1 && iTest.ptCount == 1) {
66 i->intersect(oLine, iLine);
67 } else if (oTest.ptCount == 1 && iTest.ptCount == 4) {
68 i->intersect(iCurve, oLine);
69 } else if (oTest.ptCount == 4 && iTest.ptCount == 1) {
70 i->intersect(oCurve, iLine);
71 } else if (oTest.ptCount == 4 && iTest.ptCount == 4) {
72 i->intersect(oCurve, iCurve);
73 } else {
74 SkASSERT(0);
75 }
76// i->dump();
77 }
78 }
79}
sk_bzero(glyphs, sizeof(glyphs))
static const size_t testCount
static const ConicPts testSet[]
static const struct TestSet testSets[]
#define SkASSERT(cond)
Definition: SkAssert.h:116
T * append()
Definition: SkTDArray.h:191
SkDPoint fPts[kPointCount]
CubicPts curve
void debugSet(const SkDPoint *pts)

Variable Documentation

◆ testSet0

const Curve testSet0[]
static
Initial value:
= {
{4, {{{134,11414}, {131.990234,11414}, {130.32666,11415.4824}, {130.042755,11417.4131}}} },
{4, {{{130.042755,11417.4131}, {130.233124,11418.3193}, {131.037079,11419}, {132,11419}}} },
{4, {{{132,11419}, {130.895432,11419}, {130,11418.1045}, {130,11417}}} },
}

Definition at line 26 of file PathOpsThreeWayTest.cpp.

◆ testSet1

const Curve testSet1[]
static
Initial value:
= {
{4, {{{3,4}, {1,5}, {4,3}, {6,4}}} },
{1, {{{6,4}, {3,4}}} },
{4, {{{3,4}, {4,6}, {4,3}, {5,1}}} },
{1, {{{5,1}, {3,4}}} },
}

Definition at line 32 of file PathOpsThreeWayTest.cpp.

◆ testSets

const struct TestSet testSets[]
static
Initial value:
= {
}
static const Curve testSet1[]
static const Curve testSet0[]
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

◆ testSetsCount

const int testSetsCount = (int) std::size(testSets)
static

Definition at line 47 of file PathOpsThreeWayTest.cpp.