Flutter Engine
The Flutter Engine
third_party
skia
experimental
bazel_test
pathop_main.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2023 Google LLC
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#include "
include/core/SkPath.h
"
9
#include "
include/core/SkPathBuilder.h
"
10
#include "
include/pathops/SkPathOps.h
"
11
12
#include <cstdio>
13
14
int
main
(
int
argc,
char
**
argv
) {
15
SkPathBuilder
pb;
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
}
path1
static SkPath path1()
Definition:
PathOpsIssue3651.cpp:19
path2
static SkPath path2()
Definition:
PathOpsIssue3651.cpp:198
SkPathBuilder.h
SkPathOps.h
kIntersect_SkPathOp
@ kIntersect_SkPathOp
intersect the two paths
Definition:
SkPathOps.h:24
SkPath.h
SkPathBuilder
Definition:
SkPathBuilder.h:25
SkPathBuilder::close
SkPathBuilder & close()
Definition:
SkPathBuilder.cpp:155
SkPathBuilder::lineTo
SkPathBuilder & lineTo(SkPoint pt)
Definition:
SkPathBuilder.cpp:107
SkPathBuilder::detach
SkPath detach()
Definition:
SkPathBuilder.cpp:239
SkPathBuilder::moveTo
SkPathBuilder & moveTo(SkPoint pt)
Definition:
SkPathBuilder.cpp:95
SkPath
Definition:
SkPath.h:59
SkPath::dump
void dump(SkWStream *stream, bool dumpAsHex) const
Definition:
SkPath.cpp:2040
argv
char ** argv
Definition:
library.h:9
SkSL::String::printf
std::string printf(const char *fmt,...) SK_PRINTF_LIKE(1
Definition:
SkSLString.cpp:83
skcms_private::Op
Op
Definition:
skcms_Transform.h:107
main
int main(int argc, char **argv)
Definition:
pathop_main.cpp:14
Generated on Sun Jun 23 2024 21:55:56 for Flutter Engine by
1.9.4