Flutter Engine
The Flutter Engine
Functions
Path_IsQuadDegenerate.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Path_IsQuadDegenerate, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Path_IsQuadDegenerate  ,
256  ,
256  ,
true  ,
 
)

Definition at line 4 of file Path_IsQuadDegenerate.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 auto debugster = [](const SkPath& path, bool exact) -> void {
7 SkDebugf("quad (%1.8g,%1.8g), (%1.8g,%1.8g), (%1.8g,%1.8g) is %s" "degenerate, %s\n",
8 path.getPoint(0).fX, path.getPoint(0).fY, path.getPoint(1).fX,
9 path.getPoint(1).fY, path.getPoint(2).fX, path.getPoint(2).fY,
10 SkPath::IsQuadDegenerate(path.getPoint(0), path.getPoint(1), path.getPoint(2), exact) ?
11 "" : "not ", exact ? "exactly" : "nearly");
12 };
14 path.moveTo({100, 100});
15 path.quadTo({100.00001f, 100.00001f}, {100.00002f, 100.00002f});
16 offset.addPath(path, 1000, 1000);
17 for (bool exact : { false, true } ) {
18 debugster(path, exact);
19 debugster(offset, exact);
20 }
21}
22} // END FIDDLE
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
Definition: SkPath.h:59
static bool IsQuadDegenerate(const SkPoint &p1, const SkPoint &p2, const SkPoint &p3, bool exact)
Definition: SkPath.cpp:3499
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
SeparatedVector2 offset