Flutter Engine
The Flutter Engine
Functions
FuzzTriangulation.cpp File Reference
#include "fuzz/Fuzz.h"
#include "fuzz/FuzzCommon.h"
#include "include/core/SkPath.h"
#include "src/gpu/ganesh/GrEagerVertexAllocator.h"
#include "src/gpu/ganesh/geometry/GrPathUtils.h"
#include "src/gpu/ganesh/geometry/GrTriangulator.h"

Go to the source code of this file.

Functions

 DEF_FUZZ (Triangulation, fuzz)
 

Function Documentation

◆ DEF_FUZZ()

DEF_FUZZ ( Triangulation  ,
fuzz   
)

Definition at line 16 of file FuzzTriangulation.cpp.

16 {
17#if !defined(SK_ENABLE_OPTIMIZE_SIZE)
19 FuzzEvilPath(fuzz, &path, SkPath::Verb::kDone_Verb);
20
22 SkMatrix::I(), path.getBounds());
23
24
25 // TODO(robertphillips): messing w/ the clipBounds might be another axis to fuzz.
26 // afaict it only affects inverse filled paths.
27 SkRect clipBounds = path.getBounds();
28
29 GrCpuVertexAllocator allocator;
30 bool isLinear;
31
32 int count = GrTriangulator::PathToTriangles(path, tol, clipBounds, &allocator, &isLinear);
33 if (count > 0) {
34 allocator.detachVertexData(); // normally handled by the triangulating path renderer.
35 }
36#endif // SK_ENABLE_OPTIMIZE_SIZE
37}
int count
Definition: FontMgrTest.cpp:50
void FuzzEvilPath(Fuzz *fuzz, SkPath *path, int last_verb)
Definition: FuzzCommon.cpp:237
sk_sp< GrThreadSafeCache::VertexData > detachVertexData()
static int PathToTriangles(const SkPath &path, SkScalar tolerance, const SkRect &clipBounds, GrEagerVertexAllocator *vertexAllocator, bool *isLinear)
static const SkMatrix & I()
Definition: SkMatrix.cpp:1544
Definition: SkPath.h:59
float SkScalar
Definition: extension.cpp:12
static const SkScalar kDefaultTolerance
Definition: GrPathUtils.h:32
SkScalar scaleToleranceToSrc(SkScalar devTol, const SkMatrix &viewM, const SkRect &pathBounds)
Definition: GrPathUtils.cpp:41
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