Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
pathops
SkOpEdgeBuilder.h
Go to the documentation of this file.
1
/*
2
* Copyright 2012 Google Inc.
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
#ifndef SkOpEdgeBuilder_DEFINED
8
#define SkOpEdgeBuilder_DEFINED
9
10
#include "
include/core/SkPoint.h
"
11
#include "
include/core/SkScalar.h
"
12
#include "
include/private/base/SkTDArray.h
"
13
#include "
src/pathops/SkOpContour.h
"
14
#include "
src/pathops/SkPathOpsTypes.h
"
15
#include "
src/pathops/SkPathWriter.h
"
16
17
#include <cstdint>
18
19
class
SkPath
;
20
21
class
SkOpEdgeBuilder
{
22
public
:
23
SkOpEdgeBuilder
(
const
SkPathWriter
& path,
SkOpContourHead
* contours2,
24
SkOpGlobalState
* globalState)
25
: fGlobalState(globalState)
26
, fPath(path.nativePath())
27
, fContourBuilder(contours2)
28
, fContoursHead(contours2)
29
, fAllowOpenContours(
true
) {
30
init
();
31
}
32
33
SkOpEdgeBuilder
(
const
SkPath
& path,
SkOpContourHead
* contours2,
SkOpGlobalState
* globalState)
34
: fGlobalState(globalState)
35
, fPath(&path)
36
, fContourBuilder(contours2)
37
, fContoursHead(contours2)
38
, fAllowOpenContours(false) {
39
init
();
40
}
41
42
void
addOperand
(
const
SkPath
& path);
43
44
void
complete
() {
45
fContourBuilder.
flush
();
46
SkOpContour
*
contour
= fContourBuilder.
contour
();
47
if
(
contour
&&
contour
->count()) {
48
contour
->complete();
49
fContourBuilder.
setContour
(
nullptr
);
50
}
51
}
52
53
bool
finish
();
54
55
const
SkOpContour
*
head
()
const
{
56
return
fContoursHead;
57
}
58
59
void
init
();
60
bool
unparseable
()
const
{
return
fUnparseable; }
61
SkPathOpsMask
xorMask
()
const
{
return
fXorMask[fOperand]; }
62
63
private
:
64
void
closeContour(
const
SkPoint
& curveEnd,
const
SkPoint
& curveStart);
65
bool
close();
66
int
preFetch();
67
bool
walk();
68
69
SkOpGlobalState
* fGlobalState;
70
const
SkPath
* fPath;
71
SkTDArray<SkPoint>
fPathPts;
72
SkTDArray<SkScalar>
fWeights;
73
SkTDArray<uint8_t>
fPathVerbs;
74
SkOpContourBuilder
fContourBuilder;
75
SkOpContourHead
* fContoursHead;
76
SkPathOpsMask
fXorMask[2];
77
int
fSecondHalf;
78
bool
fOperand;
79
bool
fAllowOpenContours;
80
bool
fUnparseable;
81
};
82
83
#endif
SkOpContour.h
SkPathOpsTypes.h
SkPathOpsMask
SkPathOpsMask
Definition
SkPathOpsTypes.h:18
SkPathWriter.h
SkPoint.h
SkScalar.h
SkTDArray.h
SkOpContourBuilder
Definition
SkOpContour.h:441
SkOpContourBuilder::setContour
void setContour(SkOpContour *contour)
Definition
SkOpContour.h:455
SkOpContourBuilder::flush
void flush()
Definition
SkOpContour.cpp:102
SkOpContourBuilder::contour
SkOpContour * contour()
Definition
SkOpContour.h:454
SkOpContourHead
Definition
SkOpContour.h:400
SkOpContour
Definition
SkOpContour.h:28
SkOpEdgeBuilder
Definition
SkOpEdgeBuilder.h:21
SkOpEdgeBuilder::SkOpEdgeBuilder
SkOpEdgeBuilder(const SkPath &path, SkOpContourHead *contours2, SkOpGlobalState *globalState)
Definition
SkOpEdgeBuilder.h:33
SkOpEdgeBuilder::init
void init()
Definition
SkOpEdgeBuilder.cpp:23
SkOpEdgeBuilder::head
const SkOpContour * head() const
Definition
SkOpEdgeBuilder.h:55
SkOpEdgeBuilder::complete
void complete()
Definition
SkOpEdgeBuilder.h:44
SkOpEdgeBuilder::finish
bool finish()
Definition
SkOpEdgeBuilder.cpp:62
SkOpEdgeBuilder::xorMask
SkPathOpsMask xorMask() const
Definition
SkOpEdgeBuilder.h:61
SkOpEdgeBuilder::addOperand
void addOperand(const SkPath &path)
Definition
SkOpEdgeBuilder.cpp:53
SkOpEdgeBuilder::SkOpEdgeBuilder
SkOpEdgeBuilder(const SkPathWriter &path, SkOpContourHead *contours2, SkOpGlobalState *globalState)
Definition
SkOpEdgeBuilder.h:23
SkOpEdgeBuilder::unparseable
bool unparseable() const
Definition
SkOpEdgeBuilder.h:60
SkOpGlobalState
Definition
SkPathOpsTypes.h:36
SkPathWriter
Definition
SkPathWriter.h:22
SkPath
Definition
SkPath.h:59
SkTDArray
Definition
SkTDArray.h:105
contour
Definition
Contour.h:21
SkPoint
Definition
SkPoint_impl.h:163
true
true
Definition
verylargebitmap.cpp:163
Generated on Fri Apr 26 2024 06:17:23 for Flutter Engine by
1.9.8