37#define MS_TEST_DURATION 10
40 0.0000001f, 0.000001f, 0.00001f, 0.0001f, 0.001f, 0.01f,
41 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 1, 1.1f, 2, 10, 10e2f, 10e3f, 10e4f, 10e5f, 10e6f, 10e7f,
42 10e8f, 10e9f, 10e10f, 10e20f, FLT_MAX };
50 p.setStrokeWidth(
widths[index]);
57 path.moveTo(c[0].fX, c[0].fY);
58 path.cubicTo(c[1].fX, c[1].fY, c[2].fX, c[2].fY, c[3].fX, c[3].fY);
64 path.moveTo(c[0].fX, c[0].fY);
65 path.quadTo(c[1].fX, c[1].fY, c[2].fX, c[2].fY);
71 for (
size_t index = 0; index <
count; ++index) {
72 const CubicPts& dPts = dCubic[index];
74 d.debugSet(dPts.
fPts);
76 {(
float)
d[2].fX, (
float)
d[2].fY}, {(
float)
d[3].fX, (
float)
d[3].fY} };
86 for (
size_t index = 0; index <
count; ++index) {
87 for (
int pair = 0; pair < 2; ++pair) {
88 const CubicPts& dPts = dCubic[index][pair];
90 d.debugSet(dPts.
fPts);
92 {(
float)
d[2].fX, (
float)
d[2].fY}, {(
float)
d[3].fX, (
float)
d[3].fY} };
103 for (
size_t index = 0; index <
count; ++index) {
104 const QuadPts& dPts = dQuad[index];
106 d.debugSet(dPts.
fPts);
108 {(
float)
d[2].fX, (
float)
d[2].fY} };
118 for (
size_t index = 0; index <
count; ++index) {
119 for (
int pair = 0; pair < 2; ++pair) {
120 const QuadPts& dPts = dQuad[index][pair];
122 d.debugSet(dPts.
fPts);
124 {(
float)
d[2].fX, (
float)
d[2].fY} };
152 uint32_t val = r.
nextU();
157 uint32_t val = r.
nextU() & 0x7fffffff;
165#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
167 sk_bzero(gMaxRecursion,
sizeof(gMaxRecursion[0]) * 3);
170 for (
int i = 0;
i < 1000000; ++
i) {
176#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
177 if (best < gMaxRecursion[2]) {
179 SkDebugf(
"\n%s quad=%d width=%1.9g\n", __FUNCTION__, gMaxRecursion[2],
185 best = gMaxRecursion[2];
192#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
194 SkDebugf(
"\n%s max quad=%d\n", __FUNCTION__, best);
203#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
206 sk_bzero(gMaxRecursion,
sizeof(gMaxRecursion[0]) * 3);
209 for (
int i = 0;
i < 1000000; ++
i) {
216 #if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
217 if (bestTan < gMaxRecursion[0] || bestCubic < gMaxRecursion[1]) {
219 SkDebugf(
"\n%s tan=%d cubic=%d width=%1.9g\n", __FUNCTION__, gMaxRecursion[0],
220 gMaxRecursion[1],
p.getStrokeWidth());
225 bestTan =
std::max(bestTan, gMaxRecursion[0]);
226 bestCubic =
std::max(bestCubic, gMaxRecursion[1]);
233#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
235 SkDebugf(
"\n%s max tan=%d cubic=%d\n", __FUNCTION__, bestTan, bestCubic);
244#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
246 sk_bzero(gMaxRecursion,
sizeof(gMaxRecursion[0]) * 3);
249 for (
int i = 0;
i < 1000000; ++
i) {
254 const SkScalar halfSquared = 0.5f * 0.5f;
264 path.moveTo(quad[0].fX, quad[0].fY);
265 path.quadTo(quad[1].fX, quad[1].fY, quad[2].fX, quad[2].fY);
268#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
269 if (best < gMaxRecursion[2]) {
271 SkDebugf(
"\n%s quad=%d width=%1.9g\n", __FUNCTION__, gMaxRecursion[2],
277 best = gMaxRecursion[2];
284#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
286 SkDebugf(
"\n%s max quad=%d\n", __FUNCTION__, best);
295#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
298 sk_bzero(gMaxRecursion,
sizeof(gMaxRecursion[0]) * 3);
301 for (
int i = 0;
i < 1000000; ++
i) {
306 const SkScalar halfSquared = 0.5f * 0.5f;
326#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
327 if (bestTan < gMaxRecursion[0] || bestCubic < gMaxRecursion[1]) {
329 SkDebugf(
"\n%s tan=%d cubic=%d width=%1.9g\n", __FUNCTION__, gMaxRecursion[0],
330 gMaxRecursion[1],
p.getStrokeWidth());
335 bestTan =
std::max(bestTan, gMaxRecursion[0]);
336 bestCubic =
std::max(bestCubic, gMaxRecursion[1]);
343#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
345 SkDebugf(
"\n%s max tan=%d cubic=%d\n", __FUNCTION__, bestTan, bestCubic);
354#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
356 sk_bzero(gMaxRecursion,
sizeof(gMaxRecursion[0]) * 3);
359 for (
int i = 0;
i < 1000000; ++
i) {
368 path.moveTo(quad[0].fX, quad[0].fY);
369 path.quadTo(quad[1].fX, quad[1].fY, quad[2].fX, quad[2].fY);
372#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
373 if (best < gMaxRecursion[2]) {
375 SkDebugf(
"\n%s quad=%d width=%1.9g\n", __FUNCTION__, gMaxRecursion[2],
381 best = gMaxRecursion[2];
388#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
390 SkDebugf(
"\n%s max quad=%d\n", __FUNCTION__, best);
399#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
401 sk_bzero(gMaxRecursion,
sizeof(gMaxRecursion[0]) * 3);
404 for (
int i = 0;
i < 1000000; ++
i) {
411#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
412 if (best[0] < gMaxRecursion[0] || best[1] < gMaxRecursion[1]) {
414 SkDebugf(
"\n%s tan=%d cubic=%d width=%1.9g\n", __FUNCTION__, gMaxRecursion[0],
415 gMaxRecursion[1],
p.getStrokeWidth());
420 best[0] =
std::max(best[0], gMaxRecursion[0]);
421 best[1] =
std::max(best[1], gMaxRecursion[1]);
428#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
430 SkDebugf(
"\n%s max tan=%d cubic=%d\n", __FUNCTION__, best[0], best[1]);
437#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
438 sk_bzero(gMaxRecursion,
sizeof(gMaxRecursion[0]) * 3);
449 SkDebugf(
"\n%s path\n", __FUNCTION__);
454#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
456 SkDebugf(
"max quad=%d\n", gMaxRecursion[2]);
462#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
463 sk_bzero(gMaxRecursion,
sizeof(gMaxRecursion[0]) * 3);
474 SkDebugf(
"\n%s path\n", __FUNCTION__);
479#if defined(SK_DEBUG) && QUAD_STROKE_APPROX_EXTENDED_DEBUGGING
481 SkDebugf(
"max tan=%d cubic=%d\n", gMaxRecursion[0], gMaxRecursion[1]);
sk_bzero(glyphs, sizeof(glyphs))
const size_t quadraticLines_count
const QuadPts quadraticModEpsilonLines[]
const size_t quadraticPoints_count
const size_t quadraticModEpsilonLines_count
const QuadPts quadraticPoints[]
const QuadPts quadraticLines[]
const size_t quadraticTests_count
const QuadPts quadraticTests[][2]
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static float SkBits2Float(uint32_t bits)
#define SkDoubleToScalar(x)
static void quadSetTest(const QuadPts *dQuad, size_t count)
static void cubicSetTest(const CubicPts *dCubic, size_t count)
static void quadPairSetTest(const QuadPts dQuad[][2], size_t count)
static void quadTest(const SkPoint c[3])
static SkScalar unbounded(SkRandom &r)
static SkScalar unboundedPos(SkRandom &r)
DEF_TEST(QuadStrokerSet, reporter)
static DEFINE_bool(timeout, true, "run until alloted time expires")
static void cubicTest(const SkPoint c[4])
static void pathTest(const SkPath &path)
static void cubicPairSetTest(const CubicPts dCubic[][2], size_t count)
@ kStroke_Style
set to stroke geometry
void dump(SkWStream *stream, bool dumpAsHex) const
static SkScalar DistanceToSqd(const SkPoint &pt, const SkPoint &a)
float nextRangeF(float min, float max)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
static float max(float r, float g, float b)
const CubicPts negEpsilonLines[]
const size_t modEpsilonLines_count
const CubicPts lessEpsilonLines[]
const size_t notPointDegenerates_count
const CubicPts notPointDegenerates[]
const size_t lessEpsilonLines_count
const size_t negEpsilonLines_count
const CubicPts pointDegenerates[]
const CubicPts notLines[]
const CubicPts modEpsilonLines[]
const size_t notLines_count
const size_t pointDegenerates_count
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
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
def timeout(deadline, cmd)
SK_API bool FillPathWithPaint(const SkPath &src, const SkPaint &paint, SkPath *dst, const SkRect *cullRect, SkScalar resScale=1)
SkDPoint fPts[kPointCount]
SkDPoint fPts[kPointCount]