Flutter Engine
The Flutter Engine
Functions
FuzzPathMeasure.cpp File Reference
#include "fuzz/Fuzz.h"
#include "fuzz/FuzzCommon.h"
#include "include/core/SkPathMeasure.h"

Go to the source code of this file.

Functions

void ignoreResult (bool)
 
 DEF_FUZZ (PathMeasure, fuzz)
 

Function Documentation

◆ DEF_FUZZ()

DEF_FUZZ ( PathMeasure  ,
fuzz   
)

Definition at line 14 of file FuzzPathMeasure.cpp.

14 {
15 uint8_t bits;
16 fuzz->next(&bits);
18 for (auto index = 0; index < 6; ++index) {
19 fuzz->next(&distance[index]);
20 }
22 FuzzEvilPath(fuzz, &path, SkPath::Verb::kDone_Verb);
23 SkRect bounds = path.getBounds();
24 SkScalar maxDim = std::max(bounds.width(), bounds.height());
25 if (maxDim > 1000000) {
26 return;
27 }
28 SkScalar resScale = maxDim / 1000;
29 SkPathMeasure measure(path, bits & 1, resScale);
30 SkPoint position;
31 SkVector tangent;
32 ignoreResult(measure.getPosTan(distance[0], &position, &tangent));
33 SkPath dst;
34 ignoreResult(measure.getSegment(distance[1], distance[2], &dst, (bits >> 1) & 1));
35 ignoreResult(measure.nextContour());
36 ignoreResult(measure.getPosTan(distance[3], &position, &tangent));
37 ignoreResult(measure.getSegment(distance[4], distance[5], &dst, (bits >> 2) & 1));
38}
void FuzzEvilPath(Fuzz *fuzz, SkPath *path, int last_verb)
Definition: FuzzCommon.cpp:237
void ignoreResult(bool)
Definition: SkPath.h:59
float SkScalar
Definition: extension.cpp:12
static float max(float r, float g, float b)
Definition: hsl.cpp:49
Optional< SkRect > bounds
Definition: SkRecords.h:189
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
Definition: switches.h:57
dst
Definition: cp.py:12

◆ ignoreResult()

void ignoreResult ( bool  )
inline

Definition at line 12 of file FuzzPathMeasure.cpp.

12{}