Flutter Engine
The Flutter Engine
Functions
pathop_main.cpp File Reference
#include "include/core/SkPath.h"
#include "include/core/SkPathBuilder.h"
#include "include/pathops/SkPathOps.h"
#include <cstdio>

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 14 of file pathop_main.cpp.

14 {
16 pb.moveTo(10, 10);
17 pb.lineTo(15, 5);
18 pb.lineTo(20, 10);
19 pb.close();
20 SkPath path1 = pb.detach();
21
22 pb.moveTo(12, 12);
23 pb.lineTo(18, 6);
24 pb.lineTo(24, 12);
25 pb.close();
26 SkPath path2 = pb.detach();
27
28 SkPath combined;
29 if (Op(path1, path2, kIntersect_SkPathOp, &combined)) {
30 printf("Success: \n");
31 combined.dump();
32 printf("\n");
33 } else {
34 printf("Operation failed\n");
35 }
36}
static SkPath path1()
static SkPath path2()
@ kIntersect_SkPathOp
intersect the two paths
Definition: SkPathOps.h:24
SkPathBuilder & close()
SkPathBuilder & lineTo(SkPoint pt)
SkPathBuilder & moveTo(SkPoint pt)
Definition: SkPath.h:59
void dump(SkWStream *stream, bool dumpAsHex) const
Definition: SkPath.cpp:2040
std::string printf(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: SkSLString.cpp:83